Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
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.
MongoDB Security and Operations: Authentication, Roles, TLS, Queryable Encryption, Backup and Monitoring
The application's MongoDB user can drop collections even with readWrite; for least privilege, define a custom role that grants only the actions needed. With real output: the 25 actions of readWrite, a custom role that rejects drop and createIndex, TLS that requires a CA, an equality query on an encrypted field with explicit Queryable Encryption on Community, mongodump with a restore test, a filtered profiler, $queryStats with 1% sampling and the driver's OpenTelemetry spans.
From MongoDB 6.0 to 9.0 and C# Driver 2.x to 3.x: Release Model, What's New and a Migration Checklist
You cannot go from MongoDB 6.0 to 9.0 directly; the major versions are installed in turn and the feature compatibility version is raised at every step. When moving to C# driver 3.x, the real risk is not compile errors but the decimals that 2.x wrote as strings and the DateTimeOffsets it wrote as arrays. With real output: 9.0 refusing to open 6.0 data, the 7.0-8.0-9.0 steps, the same LINQ query giving a wrong result on 2.30 and zero results on 3.14, and the migration that moves the data.