Designing "social-feed" in DynamoDB Designing "social-feed" in DynamoDB database database

Designing "social-feed" in DynamoDB


I happen to work with news feeds daily. (Author of Stream-Framework and founded getstream.io)

The most common solutions I see are:

  • Cassandra (Instagram)
  • Redis (expensive, but easy)
  • MongoDB
  • DynamoDB
  • RocksDB (Linkedin)

Most people use either fanout on write or fanout on read. This makes it easier to build a working solution, but it can get expensive quickly. Your best bet is to use a combination of those 2 approaches. So do a fanout on write in most cases, but for very popular feeds keep them in memory.

Stream-Framework is open source and supports Cassandra/Redis & Python

getstream.io is a hosted solution build on top of Go & Rocksdb.

If you do end up using DynamoDB be sure to setup the right partition key:https://shinesolutions.com/2016/06/27/a-deep-dive-into-dynamodb-partitions/

Also note that a Redis or DynamoDB based solution will get expensive pretty quickly. You'll get the lowest cost per user by leveraging Cassandra or RocksDB.


I would check out the Titan graph database (http://thinkaurelius.github.com/titan/) and Neo4j (http://www.neo4j.org/).

I know Titan claims to scale pretty well with large data sets.

Ultimately I think your model maps well to a graph. Users and posts would be nodes, and then you can connect them arbitrarily via edges. A user (node) is a friend (edge) of another user (node).

A user (node) has many posts (nodes) in their timeline. Then you can run interesting traversals via the graph.


You can also use Amazon Neptune (https://aws.amazon.com/neptune/) (Graph DB) which is well suited for social network. I don't think DynomoDB would be a good choice for yours use cases.