Λογότυπο Mongodb Configuration Validation

Mongodb Configuration Validation

Κοινότητα
selvarajmurugesan90
mongodb-configuration-validation

Validates proposed MongoDB replica set configuration, sharding setup, and index changes before production rollout — checking voting-member quorum math, shard key cardinality against real data, and index build impact. Use when the user asks to "review this MongoDB replica set config," "validate a shard key before we commit to it," "check this index change is safe to run in production," or "will this MongoDB config change cause an election issue."

Επισκόπηση

Εκδότηςselvarajmurugesan90
Αποθετήριοops-engineering-skills
Όνομα δεξιότηταςmongodb-configuration-validation
Αστέρια
44
Διακλαδώσεις
18
Συνοδευτικά αρχεία
Μόνο οδηγίες
Άδεια χρήσηςApache-2.0
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • Αυτοτελής

    Όλα όσα χρειάζεται το μοντέλο περιλαμβάνονται στις οδηγίες — χωρίς επιπλέον αρχεία για συγχρονισμό.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε στο GitHub από τον λογαριασμό selvarajmurugesan90. Ελέγξτε τα αρχεία της δεξιότητας στο αποθετήριο πριν την εγκαταστήσετε.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Mongodb Configuration Validation στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/database-operations/skills/mongodb-configuration-validation
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Προσθήκη δεξιότητας → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που υποστηρίζει τη μορφή Agent Skills μπορεί να χρησιμοποιήσει αυτή τη δεξιότητα — αντιγράψτε τον φάκελο στον κατάλογο δεξιοτήτων του.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/selvarajmurugesan90/ops-engineering-skills.git /tmp/ops-engineering-skills
mkdir -p .claude/skills
cp -r /tmp/ops-engineering-skills/plugins/database-operations/skills/mongodb-configuration-validation .claude/skills/mongodb-configuration-validation
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Mongodb Configuration Validation σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Mongodb Configuration Validation μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι οδηγίες σε απλό κείμενο Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Mongodb Configuration Validation δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλο κατά τη διάρκεια της συνομιλίας

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

MongoDB Configuration Validation

Purpose

MongoDB's flexibility — reconfiguring a replica set, resharding a collection, adding an index — makes it easy to apply a change that looks fine in the shell but has a consequence that only surfaces under production load: a replica set reconfiguration that breaks voting quorum math, a shard key that seemed reasonable in a sample but has terrible real-world cardinality, or a foreground index build that stalls writes on a busy primary. This skill is the pre-production validation gate for those changes, complementing the operational depth in mongodb-operations-and-scaling.

When to use

  • Before running rs.reconfig() to add/remove a replica set member, change priorities/votes, or adjust electionTimeoutMillis.
  • Before committing to a shard key for a new sharded collection, or before running reshardCollection on an existing one.
  • Before creating a new index on a large or high-traffic production collection.
  • Before changing writeConcern/readConcern defaults, or introducing a readPreference change to an application that reads from secondaries.
  • As a review gate for infrastructure-as-code that manages MongoDB replica set/sharding topology.

Prerequisites & environment

  • clusterMonitor role (or higher) for read-only validation queries (rs.conf(), rs.status(), sh.status(), db.collection.stats()); clusterAdmin/dbAdmin only needed to actually apply validated changes.
  • MongoDB 5.0+ assumed for command syntax below; note explicitly where behavior differs on older supported versions (e.g. reshardCollection requires 4.4+, replSetResizeOplog requires 3.6+).
  • Access to representative production data (or a realistic sample) for shard-key cardinality analysis — validating a shard key against a tiny or synthetic dataset with artificially even distribution gives false confidence.
  • Knowledge of the collection's real read/write traffic pattern (peak QPS, whether reads target primary or secondaries) to validate index build timing and write-concern changes against actual load, not just configuration correctness in isolation.

Step-by-step guidance

1. Validate replica set voting/quorum math before any rs.reconfig()

js
cfg = rs.conf()
cfg.members.forEach(m => print(m.host, m.votes, m.priority, m.arbiterOnly))

A replica set needs a majority of voting members reachable to elect a primary and to accept majority-acknowledged writes. Validate:

  • Total voting members should be odd (max 7 voting members is a MongoDB hard limit) — an even number of voters risks an election tie with no majority achievable, stalling failover indefinitely until the tie is broken by a member coming back.
  • Adding a single new member with votes: 1 to an existing set with an even total is a common mistake made "to add capacity" that actually degrades quorum math — validate the resulting total, not just that the new member itself looks reasonable.
  • An arbiter counts as a voting member but never holds data or can become primary — useful to break a tie cheaply, but adding multiple arbiters, or an arbiter to a set that already has an odd number of data-bearing voters, adds complexity without benefit and should be flagged.
  • Any member with priority: 0 cannot become primary but still votes (unless also configured votes: 0) — confirm this is intentional (e.g. a reporting-only or cross-region DR replica) and not an unintended side effect of a copy-pasted config.

2. Validate a proposed shard key against real cardinality and distribution, not assumption

js
db.orders.aggregate([
  { $group: { _id: "$tenantId", count: { $sum: 1 } } },
  { $sort: { count: -1 } },
  { $limit: 10 }
])

Run this against the actual candidate shard key fields (or the leading field of a compound key) on production or a representative snapshot, not a synthetic test dataset. Flag as unsafe:

  • A leading field with very low cardinality relative to the number of target shards (e.g. 3 distinct values across 10 shards — cannot usefully distribute).
  • A heavily skewed distribution even with adequate raw cardinality (e.g. one tenant holding 80% of documents) — this produces a hot shard even though the key has "enough" distinct values in aggregate.
  • A monotonically increasing leading field (default _id, or any timestamp/auto-increment field) for a write-heavy collection, since this concentrates new writes on one shard's current chunk range regardless of overall cardinality. Cross-check the query patterns that will run against the sharded collection: a shard key that distributes writes well but doesn't appear as a filter in the majority of queries forces mongos to broadcast (scatter-gather) those queries to every shard — validate this trade-off explicitly rather than optimizing purely for write distribution.

3. Validate an index change's build impact before running it on a live collection

js
db.orders.stats().count          // collection size
db.currentOp({ "command.createIndexes": { $exists: true } })  // check for an in-progress build

Confirm the index build will run in the background/online mode appropriate to the MongoDB version in use (default online builds since 4.2), and — critically — confirm it will be run as a rolling build (secondaries first, each stepped out of the effective read path via readPreference before its build starts, then the primary) for a large collection on a busy replica set, rather than a single foreground build against the primary. Validate the collection's current size and expected build duration against a maintenance window if the workload cannot tolerate any degraded secondary read capacity during the build.

4. Validate writeConcern/readConcern changes against the actual durability requirement

js
db.orders.insertOne({...}, { writeConcern: { w: "majority", wtimeout: 5000 } })
  • w: 1 (default in some driver configs) acknowledges a write once the primary applies it, with no guarantee it's replicated anywhere — survivable data loss on primary failure. Validate that any collection storing data where loss is unacceptable (financial, audit) uses w: "majority" explicitly, not an inherited driver default.
  • Validate wtimeout is set to a sane, non-zero value — an unbounded wait for majority acknowledgment during a replica set election or network partition can hang application writes indefinitely otherwise.
  • For readPreference: secondary or secondaryPreferred changes, validate the read traffic being redirected can tolerate replication lag (i.e. it's not read-your-own-write-sensitive application logic) — this is a common source of "the record I just wrote isn't there yet" bugs when validation is skipped.

5. Validate against a staging replica set/cluster with representative shape before production

Apply the reconfiguration/index build/shard key choice against a staging environment seeded with production-shaped data (real cardinality distributions matter far more than raw row count for shard key validation specifically) before scheduling the production change.

Best practices

  • Always compute the resulting voting-member count and majority threshold explicitly after any proposed rs.reconfig(), rather than reviewing each member change in isolation — quorum math is a property of the whole set, not any single member.
  • Validate shard key cardinality and skew against real or realistically representative data before committing — a shard key decision is far more expensive to reverse (a full reshardCollection or manual migration) than the validation effort up front.
  • Require rolling index builds (secondaries first) as the default expectation for any collection above a size/traffic threshold your team defines, and require an explicit justification to skip that and build directly on the primary.
  • Treat w: 1 writeConcern on any collection storing data with real durability requirements as a finding to flag, not a silent default to accept.
  • Bake shard-key and index-build validation into the review process for infrastructure-as-code-managed MongoDB schemas/topology, not just as manual shell-command review.

Common pitfalls

  • Symptom: After adding a new replica set member "for read capacity," the set fails to elect a primary during a later single-node outage that previously would have been survivable. Fix: The new member's vote pushed the total voting member count to an even number, so a single-node loss can produce a tie with no majority achievable. Recompute total voters after every membership change and keep the total odd — consider votes: 0 for a member that's meant to be read-capacity-only, not a failover participant.

  • Symptom: A shard key validated against a small staging dataset looked evenly distributed, but in production one shard receives a wildly disproportionate share of both storage and query load. Fix: The staging dataset's cardinality/skew didn't represent production reality (e.g. synthetic data with uniform random tenant IDs, vs. production's actual heavy-tailed tenant size distribution). Re-validate shard key candidates against a production data snapshot or a statistically representative sample, specifically checking for skew, not just raw cardinality count.

  • Symptom: A createIndex() run directly against the primary of a busy replica set causes a multi-minute write stall and elevated application error rates during the build. Fix: The build wasn' t run as a rolling, secondary-first operation, or the collection was large enough that even a background/online build contended heavily for I/O and CPU on the primary. Validate collection size and current load before deciding foreground vs. rolling build approach, and prefer rolling builds by default on any production-traffic-bearing replica set.

  • Symptom: An application intermittently fails to read a document it just wrote, only under moderate load. Fix: A readPreference: secondaryPreferred change was applied to a code path with read-your-own-write requirements, and replication lag under load exceeds the assumption. Validate read-preference changes against each call site's actual consistency requirement, and use causal consistency sessions or readPreference: primary for read-your-own-write-sensitive paths.

  • Symptom: A reviewer approves a reshardCollection run against a large production collection with no verification that the new shard key was validated, and it triggers a multi-hour, cluster-wide resource-intensive resharding operation during business hours. Fix: This is a high-blast-radius, hard-to-reverse operation once started — always validate the target shard key against real cardinality/skew data first (step 2 above), and schedule reshardCollection for a low-traffic maintenance window with monitoring on cluster resource usage throughout, since it competes for I/O and CPU with live traffic for its full duration.

Worked example

Scenario: A team proposes two changes together: adding a 4th replica set member (a new cross-region DR replica with priority: 0) and creating a new compound index on a 200M-document orders collection to support a new reporting query.

  1. Validate the replica set change: current set has 3 voting data-bearing members (odd, healthy majority math). The proposed 4th member is drafted with default votes: 1, which would bring the total to 4 (even) — flagged as a quorum regression. Corrected proposal: set the new member's votes: 0 in addition to priority: 0, since it's explicitly DR-only and shouldn't participate in elections or count toward write majority overhead across a high-latency cross-region link.
    js
    cfg = rs.conf()
    cfg.members.push({ _id: 3, host: "<DR_HOST>:27017", priority: 0, votes: 0 })
    rs.reconfig(cfg)
  2. Validate the index change: db.orders.stats().count shows ~200M documents, and current traffic shows continuous write load with no natural low-traffic window (24/7 global user base). Recommend a rolling build: build on each secondary first (temporarily removing it from readPreference: secondaryPreferred rotation via hidden: true during the build), verify build completion via db.currentOp() clearing, restore it to rotation, then repeat for the primary last using a brief step-down if a fully non-blocking build isn't available in the deployed version.
  3. Confirm the new index's field order matches the actual reporting query's filter/sort to avoid needing a second, redundant index later:
    js
    db.orders.createIndex({ region: 1, createdAt: -1 }, { background: true })
  4. Recommendation delivered with both changes approved as revised: DR member added with votes: 0/priority: 0, index built as a rolling, secondary-first operation scheduled outside the collection's daily peak window despite no true 24/7 lull, to minimize contention.

Cross-references

  • mongodb-operations-and-scaling — the operational depth (shard key mechanics, replica set election tuning, index build behavior) this skill's validation checks are grounded in.
  • postgresql-configuration-validation — comparable pre-production configuration validation discipline applied to PostgreSQL, useful as a pattern reference in a polyglot database environment.
  • redis-configuration-validation — comparable validation approach for Redis maxmemory/eviction/cluster settings, if the same platform runs both.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Mongodb Configuration Validation;

Validates proposed MongoDB replica set configuration, sharding setup, and index changes before production rollout — checking voting-member quorum math, shard key cardinality against real data, and index build impact. Use when the user asks to "review this MongoDB replica set config," "validate a shard key before we commit to it," "check this index change is safe to run in production," or "will this MongoDB config change cause an election issue."

Γιατί να χρησιμοποιήσετε τη δεξιότητα Mongodb Configuration Validation στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Mongodb Configuration Validation είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη δεξιότητα Mongodb Configuration Validation στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε τη διεύθυνση https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/database-operations/skills/mongodb-configuration-validation. Το TypingMind διαβάζει το αρχείο SKILL.md και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Mongodb Configuration Validation;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη δεξιότητα Mongodb Configuration Validation;

Με όσα θέλετε. Στο TypingMind μπορείτε να χρησιμοποιήσετε τη δεξιότητα Mongodb Configuration Validation με οποιοδήποτε μοντέλο υποστηρίζει δεξιότητες, όπως τα GPT, Claude, Gemini, Grok, DeepSeek, Mistral και Llama, χρησιμοποιώντας τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Mongodb Configuration Validation;

Ναι. Δημοσιεύεται στο GitHub από τον λογαριασμό selvarajmurugesan90 με την άδεια χρήσης Apache-2.0. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Δημιουργήστε τώρα τον δικό σας χώρο εργασίας AI

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇