Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
End to End: Preparing Bookstore for 10x Growth — Measure, Decide, Apply, Verify
Preparing Bookstore for 10x growth isn't sharding; it's adding an index, a connection budget, archiving, a read replica and partitioning in order, each measured. Under a campaign load "My orders" p99 stayed at 4.0 ms (target 50 ms); when the primary was killed under load and the replica promoted, writes paused for 7.1 seconds, but no request failed and all 3,970 acknowledged orders survived. Gains and costs of each rung, ADRs, failover and restore drills, a checklist.
High Availability and Failover: RPO/RTO, Listeners, Patroni and Making the Application Survive Failover
An application survives failover only with idempotent writes and a retry that waits for the failover; an async replica is not lossless. In the lab an async replica lost 50 orders; the default EF Core retry didn't retry "No suitable host was found" and 98 orders failed, while a widened strategy and Host Recheck Seconds=1 gave zero errors and zero duplicates. RPO/RTO, HA and DR, AG listeners, Patroni and SqlClient ConnectRetryCount.
Replica Sets and Sharding: Elections, the Oplog, Choosing a Shard Key and Hot Shards
When the primary of a replica set crashes, a new primary is elected in about 10 seconds and writes stop during that time; in sharding, the shard key decides whether writes pile up on one shard. With real output: two failed writes and a 10-second gap after kill -9, restoring a deleted order from a delayed member, the last 2,000 orders all going to one shard with an orderedAt key, targeted and scatter-gather queries, and a five-minute resharding.