One query, a whole collection
Items that share a partition key are read together in one Query.
Why
All the items sharing a partition key form an item collection, stored together and sorted by sort key. Query reads a slice of one collection.
Here one Query returns the room and every message in it, in order, in a single round trip. The messages were written next to the room on purpose, so reading them back is one cheap operation rather than a join.
Co-locate what you read together. Then a Query reads it all at once, cheaply.
Try it. Then change it.
Predict what each request will do. Run it, inspect the response, then change a value in the workbench and try again.
Every item under ROOM#general, the room meta and all its messages, in a single request.
Built on this
- Feature Flags - Which features are enabled here?
- Account & Settings - What are this account’s preferences?
- SaaS Multi-Tenant - What belongs to this tenant?
- Customer Orders - What did this customer order?
- Notifications Feed - What’s new for this user?
- Change & Audit Log - What happened, and when?
- Folder Tree - What’s inside this folder?
- Work Orders - Which jobs need attention?
- Product Autocomplete - Which products start with this?
- Commerce Capstone - How does the whole shop fit together?
- Agent Memory Store - What should this agent remember?
Every item under ROOM#general, the room meta and all its messages, in a single request.
Choose an access pattern above, or build your own request. See what comes back and what it costs.