Scalable status updates / private messaging for a rails social network app
I'm trying to learn more about scalability for RoR. I have a basic social networking app that is currently using MySQL to store everything (User relationships, Status Upda开发者_开发技巧tes, Private Messages).
NoSQL databases sound ideal but are they able to lookup/maintain relationships as effectively as a RDBS? Or would a hybrid solution be more ideal (Store just the status updates and private messages in the NoSQL DB)
For the status updates, how would an AMQP solution fit in? Would I have a process reading from the status update queue and pushing it out (XMPP?) to all followers/friends ? This seems like it can turn into the bottleneck unless I keep increasing the threads/processes reading off of the queue.
Or should I just take the twitter route and stick to MySQL? Any thoughts / suggestions would be helpful.
Thanks.
Incase someone else is wandering down the same path, there is a Ruby on Rails open source project, Insoshi, that has already addressed most of these issues.
Also, if your application is heavily based on near real-time updates, it may be a better idea to pursue an implementation in Node.js or Erlang.
精彩评论