Strategy For Heavy Workloads That Can't Happen In Real-time? (webapp, User-matching, Caching)
I'm currently writing a webapp in Ruby on Rails that matches users based on questions they answered. Then they can search for a range of users, the system matches the searcher with
Solution 1:
One way is to try to have one SQL query. Right now you are doing one query per user, but I mean one query over all. So the one query would be doing the work you are doing when you loop through the users.
You can do a database cache, and daily store the results for each user. You don't need a NoSQL data store for this, just a cron job to write the results to the database.
You could also store the results in memcache. The memcache would be shared between instances of Rails for your web app, so one copy would be available for all the instances. I would access the results through a method which checks for expiration conditions to test if it needs to refresh the data.
Post a Comment for "Strategy For Heavy Workloads That Can't Happen In Real-time? (webapp, User-matching, Caching)"