Average TPS = (Average User Activity/ 60 seconds) * Expected Concurrent Users
Average TPS = 1/60 *10000 = 166,67 TPS
Peak TPS = 166.67 * 5 = 833,33 TPS
each instance can handle up to 200 TPS
Database requirements 1000 IOPS (Input/output operations per second)
Number of Presence Services = 833,33 / 200 == ca. 5 instances
Database IOPS Required = 833,33 * 1000 = 833330 IOPS
Key considerations in the database design:
You should identify enough components that are needed to solve the actual problem from end to end. Also remember to draw a block diagram using the diagramming tool to augment your design. If you are unfamiliar with the tool, you can simply describe your design to the chat bot and ask it to generate a starter diagram for you to modify...
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
additionally there could be a better authentication inplace, also we could add an encryption for the databases so we ensure privacy for our customers and their data
to reduce network latency we could use rate limiters
To mitigate database outages we could utilize database sharding or creating replicas of databases, so that when database goes off we have the other databases available
Use health check services like prometheus and graphana to check the health of all services and whether they are up and running and everything is working great
add logging to be able to track potential errors, when they occur and mitigate potential future failures