I'am currently thinking about my DynamoDB database. The goal is to get the best speed with a really large amount of data possible. For me, DynamoDB seems as a good option. Furthermore, it is necessary for me to connect the table to ElasticSearch because I need geopoint-querys (like show me all posts that are within a specific area). Would the following approach make sense to you regarding the best practices of DynamoDB? It is possible, that the sort key for example 'posts' is a hot spot, but if I query only with ElasticSearch, there should be no problem - right? What would be the best solution?

My tables look like this:

So my thoughts are:

  • To query all users just select every row with the sort_key 'user'
  • To get a post with the creator, query the post_id and the sort_key 'post'

In a relational database, the two tables would look like this: enter image description here

2 Answers

1
dDarkLORD On

You can do something like using overloaded attributes (using same columns for different things) enter image description here

Then, query with user_id and post_id=0 for user info and post_id=others for posts

1
Sarath Kumar On

I don't think dynamo DB is a good option for that. Limitation for DynamoDB listed below.

  • You can't get more than 1 MB data per API call
  • wildcard search will give you a poor performance
  • Aggregation will be a nightmare since you plan for the huge data