Jon Packer • RevolverConf 2024.1
(CONTEXT)
Beer festival list app
x-ratelimit-limit: 100 x-ratelimit-remaining: 0
GET /ticks/:userId
-> [{ "checkinId": 62137
"beerId": 23298,
"timestamp": "2022-11-23T18:43:22Z",
"rating": 4.25 }, ...and 8959 more]
GET /tick/:userId/:beerId
-> ❌: 404
-> ✅: { "checkinId": 62137
"beerId": 23298,
... etc }[foreshadowing]
{
"id": 1,
"name": "A thing stored in DynamoDb",
"attributes": {
"contrived": true,
"array": [1, 2, 3]
}
}** not a document database
Schema:
Users table
{
"userId": 12345, // primary key
"checkins": {
"<beer id>": {
"checkinId": 12345,
"timestamp": "2022-12-12T19:23:46Z",
"rating": 3.75
},
... and 8959 more
}
}Rewrite!
Checkins table
{
"checkinId": 12345, // primary key
"userId": 23456,
"beerId": 34567,
"timestamp": "2022-12-12T19:23:46Z",
"rating": 3.75
}❌ ProvisionedThroughputExceededException