mir-database-mongo

Solid

Make It Right (MongoDB module). MongoDB 8.x mechanics the engine-independent pillar omits: embed vs reference decided per relationship by access pattern, cardinality, update frequency; the 16 MB BSON limit and unbounded arrays; $jsonSchema validators — a collection accepts any shape until you add one; write concern w:1 losing acknowledged writes on failover; read concern, stale secondary reads, retryable writes — updateMany/deleteMany are NOT retryable; the 60-second transaction lifetime limit vs a single-document atomic update; compound-index prefix rules, ESR ordering, covered queries; aggregation stage ordering and the 100 MB stage limit; shard-key selection — a monotonic key creates a hot shard; NoSQL operator injection. Chains: mir-database (the gates) → this. TRIGGER only when the datastore is MongoDB itself (Community, Enterprise, Atlas) — designing a collection or document schema, picking a shard key, writing an aggregation pipeline or index, or debugging a Mongo consistency, concurrency, or query-pla

API & Backend 15 stars 0 forks Updated 1 weeks ago Apache-2.0

Install

View on GitHub

Quality Score: 81/100

Stars 20%
40
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# /mir-database-mongo · Make It Right (MongoDB) Engine module. `mir-database` runs the gates and decides what is true of the data. **This file carries only MongoDB's mechanics.** Use it at Gate 0 (engine fitness), Gate 5 (design), Gate 6 (collections, validators, indexes), Gate 7 (review). **Release state, verified 13 Aug 2026** (mongodb.com/docs/manual/release-notes, /reference/versioning): | Release | Status | What it changes for you | |---|---|---| | **8.3** (8.3.8, Aug 2026) | current | Cost-Based Ranker is now the **default** plan selector — query plans can change on upgrade. `removeShard` replaced by `startShardDraining` / `shardDrainingStatus` / `commitShardRemoval`. Only single-version downgrades | | **8.2** | supported minor | Queryable Encryption prefix/suffix/substring queries are **public preview** — not for production; GA will be incompatible with the preview format | | **8.0** | major, 5-year lifecycle | `j:true` now requires **every member counted by `w`** to journal (pre-8.0 only the primary did). `w:"majority"` members apply asynchronously after durably writing the oplog entry | | **7.0** | major, supported | `analyzeShardKey` / `configureQueryAnalyzer` land here | Majors ship every 2 years with a 5-year lifecycle. Minors (8.1 → 8.2 → 8.3) must be upgraded through **sequentially**, each step a binary upgrade **plus** an FCV bump. Pin a major if you need Atlas Live Migration or `mongosync` — minors do not always support them. --- ## 1. Schema design **E...

Details

Author
anantbhandarkar
Repository
anantbhandarkar/make-it-right
Created
3 months ago
Last Updated
1 weeks ago
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Solid

mir-database-postgres

Make It Right (PostgreSQL module). Postgres mechanics the engine-agnostic pillar omits: which ALTER TABLE subforms take ACCESS EXCLUSIVE and the lock queue where a blocked DDL stalls every read behind it; lock_timeout/statement_timeout migration discipline; NOT VALID then VALIDATE; CREATE INDEX CONCURRENTLY and invalid-index cleanup; MVCC bloat, autovacuum, XID wraparound; isolation levels and 40001/40P01 retry; SELECT FOR UPDATE vs FOR NO KEY UPDATE, SKIP LOCKED queues, advisory locks; b-tree/GIN/GiST/BRIN choice, partial and covering indexes, why an index is unused; PgBouncer pooling modes and transaction-pooling breakage; RLS multi-tenancy and its bypass paths. Chains: mir-database (the gates) → this. TRIGGER when the engine is PostgreSQL or Postgres-compatible (RDS/Aurora, Cloud SQL, Neon, Supabase) and the task writes DDL, a migration, an index, a locking or isolation decision, a partitioning or RLS layout, or diagnoses a slow query, EXPLAIN plan, missing index, bloat, vacuum, deadlock, or connection poo

15 Updated 1 weeks ago
anantbhandarkar
API & Backend Solid

mir-database

Make It Right (database pillar). Constraint-first schema and data-modeling protocol. Decides what is TRUE of the data before the first CREATE TABLE. Forces explicit decisions on cardinality and ownership, natural vs surrogate keys, what the database enforces vs what the application enforces, deliberate denormalization, nullability as a domain statement, soft delete's effect on uniqueness and foreign keys, tenancy model (shared-schema tenant column, schema-per-tenant, database-per-tenant), index design driven by the actual query set, and migration safety on populated tables. Runs the hard-gated pipeline: Intent → Constraint Interrogation → Assumption Ledger → Invariants & Enforcement Boundary → Risk Register → Design Review → DDL/Migration → Production-Readiness. Engine-independent. Chains: this → an engine module. TRIGGER when the task designs or changes a schema, data model, keys, constraints, indexes, tenancy layout, or a migration against populated tables. SKIP for application business logic, transaction/i

15 Updated 1 weeks ago
anantbhandarkar
AI & Automation Solid

mir-backend-ruby-rails

Make It Right (Rails module). Ruby on Rails 8.1 specific reliability augmentation. Use alongside mir-backend and mir-backend-ruby when the target stack is Rails — carries the mechanical footguns the framework-agnostic skills deliberately omit: ActiveRecord N+1 and eager-loading strategies, params.expect / strong parameters and mass-assignment safety, callback side-effect timing (after_commit vs after_save) and jobs enqueued inside transactions, transaction semantics and nested transactions, migration safety on populated tables (the #1 Rails production incident class), connection pool sizing across the Rails 8 primary/cache/queue/cable databases, and the Rails security defaults and Active Storage advisories. TRIGGER only when the Ruby backend is Rails — building, reviewing, or debugging a Rails controller, model, concern, migration, Active Storage attachment, or background job that uses ActiveRecord. Always loads TOGETHER WITH mir-backend (the gates) and mir-backend-ruby (YARV runtime: GVL, Ractors, YJIT, Puma

15 Updated 1 weeks ago
anantbhandarkar