System Design
In this page, I detail the basic use cases of techniques/technologies useful in system design.
Rate Limiting Algorithms
- Token bucket
- Leaky bucket
- Sliding window
Redis
- Single threaded with I/O multiplexing
- Use cases
- Session store
- Caching
- Distributed locks
- Rate limiting
- Gaming leaderboard
PostgreSQL
- SQL-based database
- Write-ahead log (WAL)
Kafka
- Sequential I/O and Zero-Copy design
- Offers increased reliability and durability
- Data is retained until the configured retention period
- Architecture is based off topic and partitions
- Messages are partitioned based off a specified partition key
- Messages stored on disk using sequential order, enabling Sequential I/O to increase performance
Distributed ID Generator
- Snowflake ID Generator
- Format
| 1-bit (sign) | 41-bit (timestamp) | 10-bit (node ID) | 12-bit (sequence number) |
- Naturally sortable by timestamp