-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use DynamoDB for persistence. #97
Comments
For goal 2, here is my current thought process: From the best practices:
--> So we should shoot to have a single dynamo table for this application. We don't want to hit collisions on IDs between games and players. We want to be able to have a single game grouped close enough together (so likely put a gameID in a single partition, and then have a sortKey to iterate through time, similar to this example). 💡 how about this for a schema design (rough commit):
|
How can we know Or do we use a timestamp (maybe just |
Great question! How important is consistency to us? If we want to ensure that two players playing the same game will never "accidentally" stomp on each others' actions, then we must use some strong consistency/transactions to ensure that we are only ever in the process of applying one player's update at a time. Using a timestamp is one way to try and achieve this consistency, but is not infallible (however, it's highly unlikely considering we only ever have at max 4 players per game. In applications with higher scales, this solution would be right out because that likelihood goes up with the number of actors). The best way is to apply a transaction at the GameID level (like the SQL solution has) so that only one action can ever be in-process across all containers at a given time. Another possible solution is to use the "number of previous actions" as the So how important is consistency? If most players aren't ever going to stomp on each other, I think it's ok to do this without transactional guarantees (like the SQL solution) because the worst case is that someone has to do something twice (which is a bad user experience, but this is a free-time hobby cribbage project:#). If dynamoDB offers transactions, perhaps that would be worth investigating... |
Transactionality would be the sure-fire way to go, but given:
I'm not sure it's a "must have" (as you mentioned) Of course, the other (completely overkill, probably) option would be to use a FIFO queue 😎 |
I think this will have 5 main stages:
The goal:
Have an infrastructure that isn't going to be constantly charging me (ahem RDS) when it's deployed; only use for the requests that the app needs. This would unlock serverless deploy of the app as well.
The text was updated successfully, but these errors were encountered: