Welcome everyone!
Here we are at Day-1 of the System Design series,
Storage
Before designing any sytem or making boxes or diagrams,
Document all the possibilities of creating it.Suppose we have 5 bytes for seat number and 5 bytes for its availability,
then we have a total of 10 bytes getting utilized for information regarding 1 seat.So, it is not that huge, even if we have 1 billion data of this amount, but still we want to reduce it.
We need to optimize it further,
What if non-absense of the info regarding its availability, we could delete it.
If no seat in database, we return non-avail..
But How to Delete?
- Approach 1:
Write CRON Job that deletes expired entries.-
Not a robust entries.
We need to handle Edge case in business logic.
Approach 2:
- Database with key value & expiration-Redis And Dynamo DB.
Thanks for reading
Hava A Good Day👍🏼