Advanced
Open
Pro
Single-Table Design for a Blog Platform
A blogging platform needs to serve, from DynamoDB: (a) get a post by
post_id; (b) list an author's posts, newest first; (c) list the
comments on a post, oldest first; (d) get an author's profile.
- Design a single-table
PK/SKscheme that serves (a)–(d), noting which are served by the base table and which need a GSI. - Why is single-table design preferred over one DynamoDB table per entity type in this kind of system?
- A new requirement arrives: "show the 10 most recent comments across the whole platform, for moderation." How would you serve it without breaking the existing design?
Share this question