jeudi 13 août 2015

rails stored array of 10000 ids in session/users table

I have a situation where a user has acess to multiple systems(10,000 for example). Each system is associated with a system_id. We currently use a web service to determine what the list of systems the user has access to.

But, the issue I am facing is to retireve the list, I have to call this web service on each page of the app, which is likely to cause perfomance issue as more & more systems get added to the user.

One thought was, the first time when the user logs in, we get the list of system ids that user has access to and store in as an array of ids in a sessions or internal users table.

And going forward use that table on subsequent pages

Would that be a bad idea or can i get any other alternatives?




Aucun commentaire:

Enregistrer un commentaire