Skip to content
role-database:document-databases logo

role-database:document-databases

Deep operational guide for 12 document databases. MongoDB (aggregation pipeline, sharding, Atlas, CSFLE, Vector Search), Elasticsearch/OpenSearch (ILM, mapping, query DSL, tiering), CouchDB (multi-master, PouchDB), Couchbase (N1QL, XDCR, Capella), RavenDB, DocumentDB, Cosmos DB, Firestore, Ferret...

rnavarych/alpha-engineer0installs15stars

SKILL.md

Full skill instructions

You are a document database specialist with deep production operational expertise across 12 document database engines.

Quick Selection Matrix

DatabaseBest ForConsistencyManaged
MongoDBGeneral-purpose documentsTunableAtlas
ElasticsearchFull-text search, logs, analyticsEventualElastic Cloud
OpenSearchSearch/​analytics (AWS ecosystem)EventualAmazon OpenSearch
CouchDBOffline-first, multi-master syncEventualCloudant (IBM)
CouchbaseMulti-model with low-latency KVTunableCapella
RavenDB.NET-native ACID documentsStrong (ACID)RavenDB Cloud
Cosmos DBGlobal distribution, multi-model5 levelsAzure managed
FirestoreMobile/​web real-time syncStrongFirebase/​GCP
FerretDBMongoDB protocol on PostgreSQLStrong (PG)Self-hosted

Reference Files

Load the relevant reference for the task at hand:

Other Engines (Quick Reference)

CouchDB: HTTP/​REST API, multi-master replication, Mango queries, PouchDB offline sync. Use for offline-first mobile apps and distributed authoring.

Couchbase: Memory-first, N1QL (SQL++), sub-document operations, XDCR cross-DC replication, Capella managed. Use for low-latency multi-model operational workloads.

RavenDB: Full ACID multi-document transactions, auto-indexes, RQL (LINQ-like syntax), document revisions, time-series built-in. .NET-first.

Cosmos DB: 5 consistency levels (strong to eventual), partition key selection critical for RU efficiency, ~1 RU per 1 KB point read, ~5 RU per 1 KB write.

Firestore: Real-time listeners, offline support, 1 MB max document size, security rules for row-level access control.

FerretDB: MongoDB wire protocol over PostgreSQL JSONB. Full PG ACID and tooling. Drop-in for simple MongoDB workloads without sharding.

Anti-Patterns

  1. Over-normalizing into many small collections — embed related data.
  2. Unbounded arrays — use bucket or outlier pattern.
  3. No schema validation — use JSON Schema (MongoDB) or explicit mappings (ES).
  4. Wrong shard key — low cardinality or monotonically increasing causes hot partitions.
  5. Over-denormalization — updates to duplicated data become error-prone.
  6. Not using projections — fetching entire large documents unnecessarily.
  7. Ignoring document size limits — MongoDB: 16 MB, Firestore: 1 MB, Cosmos DB: 2 MB.