29 articles
Knowledge Base
MongoDB
29 articles in the MongoDB category · page 1 of 2.
- MongoDB sharding in depth: config servers, chunks, and balancer behaviour Keep a sharded MongoDB cluster healthy in production by choosing a sound shard key, checking how data is spread across shards, and controlling when the balancer moves it. You will also be able to spot and fix jumbo chunks and orphaned documents.
- MongoDB client-side field-level encryption (CSFLE and Queryable) Learn how to encrypt sensitive MongoDB fields inside your application before they reach the database server, using client-side field-level encryption (CSFLE). This guide shows you how to set up the encryption keys, write the schema that decides which fields get encrypted, and choose between deterministic, random and Queryable Encryption modes.
- MongoDB compound indexes: a cookbook for query patterns Learn how to build MongoDB compound indexes that your queries actually use, ordering the fields with the ESR rule so equality filters come first, then the field you sort on, then ranges. You will also see how to make a query covered by its index, work with array fields safely, and retire the indexes nobody uses.
- Oplog tailing as a CDC source: lower-level alternative to change streams Tail the MongoDB oplog directly with a tailable cursor for CDC — what you gain over change streams, what you give up, and the cluster-time bookkeeping you must do yourself.
- MongoDB aggregation pipeline in depth: stages, index use, and explain Build MongoDB aggregation pipelines that use indexes, spill to disk safely, and merge results without surprising the planner — with explain output you can actually read.
- MongoDB Atlas Device Sync for offline-first mobile apps Use Atlas Device Sync (formerly Realm Sync) to keep a mobile app's local Realm database synchronized with Atlas — flexible sync, conflict resolution, and permissions.
- MongoDB encryption at rest: KMIP, AWS KMS, and local key files Enable WiredTiger encryption at rest in MongoDB Enterprise with KMIP, AWS KMS, or a local keyfile — key rotation, performance impact, and the keystore that becomes your new SPOF.
- Installing MongoDB on Ubuntu with the official repository Install MongoDB 7 on Ubuntu from MongoDB Inc.'s apt repository, enable authentication, configure systemd, and prepare the host for production use.
- MongoDB Ops Manager overview: monitoring, automation, and backup Ops Manager is MongoDB's on-premises control plane — agents, project topology, automation, and continuous backup. What it actually gives you versus rolling your own.
- MongoDB point-in-time recovery with snapshots and oplog replay Restore MongoDB to a specific timestamp by combining a base snapshot with oplog replay — Atlas/Ops Manager mechanics and the self-hosted equivalent.
- MongoDB partial indexes for hot-path queries Use MongoDB partial indexes to index only the documents a query actually matches — smaller indexes, faster writes, fewer collection scans on the unhappy path.
- MongoDB Compass for debugging: schema, explain, and query analysis Use MongoDB Compass to inspect schemas, run explain plans visually, profile slow queries, and validate aggregation pipelines without typing them.
- MongoDB replica-set heartbeat tuning for flaky networks Adjust electionTimeoutMillis, heartbeatIntervalMillis, and catchUpTimeoutMillis to keep MongoDB replica-sets stable when the network is not.
- mongoexport for CSV/JSON pipelines: streaming exports without loading the host Use mongoexport to stream MongoDB data into CSV/JSON pipelines feeding warehouses, BI tools, and downstream services — query filters, field selection, and the consistency caveats.
- MongoDB replica set — three-node initiation and verification Bootstrap a three-node MongoDB replica set with keyfile auth, configure write concerns for durability, and verify primary election and replication.
- MongoDB backups with mongodump and mongorestore Logical backups for MongoDB with mongodump, parallel collection dumps, point-in-time strategies with oplog replay, and the restore drill that proves the dump works.
- MongoDB time-series collections for metrics and IoT workloads Use MongoDB time-series collections for IoT, metrics, and sensor data — automatic bucketing, columnar storage, and the operations that work differently from regular collections.
- MongoDB change streams for real-time event consumers Use MongoDB change streams to emit document-level events from a replica-set or sharded cluster: resume tokens, filtering, full-document lookup, and crash-safe consumers.
- Deploying a MongoDB 7 sharded cluster (3 config + 2 shards x PSS) on AlmaLinux 9 Stand up a horizontally scaled MongoDB 7 deployment on AlmaLinux 9 — 3-node config server replica set, two shard replica sets (PSS), mongos routers, with keyfile auth.
- MongoDB index strategies — picking, building, and verifying indexes How MongoDB indexes are stored, when to use compound or partial or TTL indexes, the ESR rule for compound order, and how to verify with explain().
- MongoDB text indexes for in-database search Use MongoDB text indexes for substring and phrase search inside the database — stemming, language analyzers, score sorting, and when to graduate to Atlas Search.
- MongoDB server-side JavaScript: $function, $accumulator, and the risks Use $function and $accumulator to run JavaScript inside MongoDB aggregation pipelines — when it's the right answer, when it's a perf footgun, and the security knobs.
- MongoDB ACID transactions: read concern, write concern, and the cost Run multi-document ACID transactions in MongoDB — when to use them, the read/write concern combination that gives you serializable behaviour, and the cost you accept versus single-document writes.
- Streaming mongodump for large datasets: archive mode and parallelism Use mongodump --archive and --numParallelCollections to stream large MongoDB backups to S3 or a remote disk without filling local storage.