Random Notes
System Design
Unreliable clocks
- Clocks in PCs are unreliable - up to 7 seconds per full day.
- PCs use Network Time Protocol - protocol for synchronising time of local machine with the time server.
- There are skip seconds - minute can have 59 seconds, so scheduling something on
n
second of a minute can lead to bugs.
- Instead, use just time deltas.
- For even better reliability use vector event something...
Caching
Data Storage Systems
SQL vs NoSQL vs Other
- Feels like another iteration over old dispute between document-based IBM db and networked DBs
- Document oriented DB - good when data does not have too many links
- Relational DB - good when you need better control over data links
- Graph DBs - good when links are starting to become as or even more important than just data.
- There is no such thing as "no-schema" DBs. Less structured DBs such as Document DB just have "schema-on-a-read".
Postgres
MySQL