Design a Blogging Platform
Why sometimes soft work over hard delete
- Recoverability, Archival, Audit
- Easy on the database engine (No tree re-balancing, but often depends on database internals)
Storing datetime in DB as:
- datetime object
- serializing and deserializing is required
- convenient
- sub-optimal
- heavy on size and index
- epoch integer
- efficient
- optimal
- lightweight
- comparisons are easy
- Readability is an issue so conversion should be done
- Only a limited range of date can be stored based on size of the integer
- custom format integer (eg. YYYYMMDD)
- Readability and benefits of integer
- There is no hard and fast rule, be flexible everything has it’s own trade-off
<aside>
💡 Read MySQL Datetime format from documentation
</aside>
Caching is anything that reduces response times by saving any heavy computation.
- Cache are not always RAM.
- Reduce Disk I/O or Network I/O or compute
- Cache are just glorified Hash Tables with some advanced data structures
Design Online Offline Indicator
Similar System
Failure detection in a distributed system
Design Airline Check-in
Design SQL backed KV Store
Design Slack's Realtime Communication