Friday 2 June 2017

Best practice on how to persist large customerId selection in mysql

I'm developing an application with NodeJS, Express, MySQL an plain HTML, CSS, JavaScript.

Objective of this application is invoice analysis for a large amount of customers.

Each customer has its own customerId and each customerId is associated to different login users. When I login as a user i can enable and disable those customerIds. This is saved in my Redis Database which I use for Session/Cookie handling. In my SQL Statement I use the "WHERE customerId IN (customerIds)" clause to check available invoices for the selected customerIds.

The Problem is that saving those customerIds (up to 2000) in the session is sometimes terrible slow. Also the SQL Query is not very efficient maybe because I always need to send the comma separated String of enabled customerIds.

Now I'm asking for some help or any suggestion which is best practice for this case.



via icodeweb

No comments:

Post a Comment