lundi 22 juillet 2019

Allocation of data to Concurrent users

In our application we use microservices architecture. One of the microservice is allocation microservice. This allocation microservice functionality is to assign 100 different records to the user who has logged in our application, from Postgres DB which has a total records of 1 million in one of the table.

Currently we are using spring boot and we are handling it using Optimistic locking mechanism. For even, When around than 100 concurrent users are using the application, the performance of the application is drastically slow, and the allocation microservice takes about more than 2 minutes to allocate the data to users. Once the data is allocated, we are storing the data in redis.

(Its a DB update, we change the status from "assigned" to "allocated" and also update the "assignedTo" field to the particular user. The use case is, no two same records should be allocated to the same user, to avoid this we are using "Optimistic lock" and the performance of the System is very slow in this case. Any other solutions to improve the performance ?)

Any other solution to improve the performance apart from Optimistic locking?

Aucun commentaire:

Enregistrer un commentaire