Streama provides a very simple way to publish activity streams using Mongoid. The implementation takes advantage of the Array field type in MongoDB which allows a single activity document to be sent to followers. It does this by storing the receivers of an activity in an array field allowing a single query to retrieve a users activity stream.
This method is perfect for small sites that need a quick and easy way to provide activity streams, however it probably won't scale very well once you start sharding your data or have thousands of followers per user.
To scale effectively, you'd need to be able to shard on the receiving user so that queries hit a single server. Currently, MongoDB doesn't support sharding based on an array field type, although there is a ticket for this but it doesn't look like anyone is working on it.
joe1chen on Github has created a
fork of Streama that implements a scalable solution, however for many of you it may be over kill as it will duplicate activities for each receiver along with any cached data even though you aren't sharding.
So my question to anyone using Streama is; does the current schema suit what you are doing? Should the schema change to support sharding based on receivers and if so, is duplicating activities per receiver the way to go?
Let me know if you have any ideas on how to improve Streama and make it more scalable while keeping it simple enough for smaller sites.
Christos