DB Compare
दो connections के बीच schemas और indexes की तुलना करें। Breaking-change highlighting के साथ Visual diff। PR gate के रूप में wire करें ताकि dev / staging / production के बीच structural drift deploy से पहले पकड़ा जाए।
यह क्या है
एक workspace tab जो दो connections के schema + indexes की तुलना side by side करता है। Engine हर side से collection lists, sample documents (schema inference के लिए), और `db.collection.getIndexes()` पढ़ता है, फिर breaking-change markers (जैसे removed fields, type narrowing, dropped indexes) के साथ एक structural diff render करता है।
कब उपयोग करें
Release से पहले चलाएँ यह पुष्टि करने के लिए कि dev / staging production से match करता है। PR gate के रूप में चलाएँ ताकि structural drift review के बिना land न हो सके। Incident response के दौरान चलाएँ यह verify करने के लिए कि misbehaving cluster ने एक index नहीं खोया।
इसे कैसे खोलें
- NoSqlStudio desktop ऐप में, Tools menu → Migrate and Diff → Compare DBs खोलें, या Ctrl+Alt+Shift+C दबाएँ।
- एक workspace source / target pickers और एक Run Compare बटन के साथ खुलता है।
- तुलना करने के लिए दो connections + databases चुनें, फिर Run Compare पर क्लिक करें।
Diff पढ़ना
- Schema column — एक side पर मौजूद और दूसरे पर नहीं मौजूद fields, type mismatches, और required-field changes।
- Indexes column — एक side पर मौजूद indexes, अलग specs वाले indexes, ऐसे indexes जिन्हें unique होना चाहिए लेकिन नहीं हैं।
- Breaking changes — engine जिन items को runtime failures का कारण बनने की likely flag करता है उन्हें लाल में highlight किया जाता है और पहले सूचीबद्ध किया जाता है।
- Export — engine ticket से attach करने के लिए diff को JSON या CSV के रूप में export करता है। Schema Diff workspace migration script emit करने के लिए वही diff format consume करता है।
सीमाएँ (v1)
- Schema inference sample-based है — Schema Diff वाला ही caveat। Representative documents कवर करने के लिए sample size सेट करें।
- बड़ी collections की full sample size पर तुलना धीमी है। Wizard 1000-doc sample default है; इसे केवल तभी bump करें जब आपको विशेष रूप से full coverage चाहिए।
- Compare केवल पढ़ता है — किसी भी cluster को modify नहीं करता। वास्तव में reconcile करने के लिए Schema Diff या DB Copy का उपयोग करें।