Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
System Design Case Study: News Feed and Timeline
Fan-out on write is the default for a news feed, but because followers follow a power law, a single celebrity post turns into a million writes; the fix is a hybrid model that merges accounts above a high threshold at read time, a feed cache holding only post IDs, and cursor pagination. A computed capacity table, a push, pull and hybrid simulation, and real output comparing offset and cursor on a Redis sorted set.
System Design Case Study: Chat and Notification System
In a chat system, connections live on stateful gateways while order and storage live in a stateless chat service: a message is stored first, gets a sequence number from a per-conversation server counter, the recipient's gateway is found through presence, and offline recipients get a push. Real output for routing between two gateways with Redis and for ordering, deduplication and gap detection by seq on the client, read receipts, group fan-out and message storage.
System Design Case Study: Flash Sales and Ticketing
What prevents overselling in a flash sale is doing the stock check and the decrement in a single atomic step; a waiting room served from a CDN absorbs the spike, holds with a TTL manage the payment window, and expired holds return stock in the same statement. Real output with 2,000 concurrent buyers for 100 tickets: 2,000 reservations from naive code, a conditional UPDATE and optimistic concurrency, plus payment timeouts and bot defense.