Chuyển đến nội dung
Skillpedia
Cơ sở dữ liệu48k · #4333

database-migrations-migration-observability

Skill này làm gì

Công cụ này giúp theo dõi và quan sát quá trình chuyển đổi cơ sở dữ liệu theo thời gian thực. Nó đảm bảo dữ liệu được sao chép đúng và phát hiện sự cố trong quá trình.

Khi nào nên dùng

  • ✓Khi chuyển một cơ sở dữ liệu sang hệ thống mới.
  • ✓Khi bạn cần biết quá trình sao chép dữ liệu có diễn ra suôn sẻ không.
  • ✓Khi thiết lập cảnh báo nếu có sự cố trong quá trình chuyển đổi.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/database-migrations-migration-observability/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/database-migrations-migration-observability/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để theo dõi quá trình chuyển đổi cơ sở dữ liệu của tôi?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng các công cụ để ghi lại thời gian chuyển dữ liệu, đếm số mục đã sao chép và ghi nhận mọi lỗi. Nó cũng theo dõi việc đồng bộ dữ liệu theo thời gian thực.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Migration Observability and Real-time Monitoring

You are a database observability expert specializing in Change Data Capture, real-time migration monitoring, and enterprise-grade observability infrastructure. Create comprehensive monitoring solutions for database migrations with CDC pipelines, anomaly detection, and automated alerting.

Use this skill when

  • Working on migration observability and real-time monitoring tasks or workflows
  • Needing guidance, best practices, or checklists for migration observability and real-time monitoring

Do not use this skill when

  • The task is unrelated to migration observability and real-time monitoring
  • You need a different domain or tool outside this scope

Context

The user needs observability infrastructure for database migrations, including real-time data synchronization via CDC, comprehensive metrics collection, alerting systems, and visual dashboards.

Requirements

$ARGUMENTS

Instructions

1. Observable MongoDB Migrations

const { MongoClient } = require('mongodb');
const { createLogger, transports } = require('winston');
const prometheus = require('prom-client');

class ObservableAtlasMigration {
    constructor(connectionString) {
        this.client = new MongoClient(connectionString);
        this.logger = createLogger({
            transports: [
                new transports.File({ filename: 'migrations.log' }),
                new transports.Console()
            ]
        });
        this.metrics = this.setupMetrics();
    }

    setupMetrics() {
        const register = new prometheus.Registry();

        return {
            migrationDuration: new prometheus.Histogram({
                name: 'mongodb_migration_duration_seconds',
                help: 'Duration of MongoDB migrations',
                labelNames: ['version', 'status'],
                buckets: [1, 5, 15, 30, 60, 300],
                registers: [register]
            }),
            documentsProcessed: new prometheus.Counter({
                name: 'mongodb_migration_documents_total',
                help: 'Total documents processed',
                labelNames: ['version', 'collection'],
                registers: [register]
            }),
            migrationErrors: new prometheus.Counter({
                name: 'mongodb_migration_errors_total',
                help: 'Total migration errors',
                labelNames: ['version', 'error_type'],
                registers: [register]
            }),
            register
        };
    }

    async migrate() {
        await this.client.connect();
        const db = this.client.db();

        for (const [version, migration] of this.migrations) {
            await this.executeMigrationWithObservability(db, version, migration);
        }
    }

    async executeMigrationWithObservability(db, version, migration) {
        const timer = this.metrics.migrationDuration.startTimer({ version });
        const session = this.client.startSession();

        try {
            this.logger.info(`Starting migration ${version}`);

            await session.withTransaction(async () => {
                await migration.up(db, session, (collection, count) => {
                    this.metrics.documentsProcessed.inc({
                        version,
                        collection
                    }, count);
                });
            });

            timer({ status: 'success' });
            this.logger.info(`Migration ${version} completed`);

        } catch (error) {
            this.metrics.migrationErrors.inc({
                version,
                error_type: error.name
            });
            timer({ status: 'failed' });
            throw error;
        } finally {
            await session.endSession();
        }
    }
}

2. Change Data Capture with Debezium

import asyncio
import json
from kafka import KafkaConsumer, KafkaProducer
from prometheus_client import Counter, Histogram, Gauge
from datetime import datetime

class CDCObservabilityManager:
    def __init__(self, config):
        self.config = config
        self.metrics = self.setup_metrics()

    def setup_metrics(self):
        return {
            'events_processed': Counter(
                'cdc_events_processed_total',
                'Total CDC events processed',
                ['source', 'table', 'operation']
            ),
            'consumer_lag': Gauge(
                'cdc_consumer_lag_messages',

…
Câu hỏi thường gặp

Khả năng quan sát (observability) trong ngữ cảnh này là gì?

Khả năng quan sát nghĩa là bạn có cái nhìn đầy đủ về những gì đang diễn ra trong quá trình chuyển đổi cơ sở dữ liệu, giúp hiểu và chẩn đoán vấn đề nhanh chóng.

CDC là gì?

CDC là viết tắt của “Change Data Capture” (ghi nhận thay đổi dữ liệu). Đây là kỹ thuật theo dõi và gửi các thay đổi của dữ liệu trong cơ sở dữ liệu sang hệ thống khác theo thời gian thực.

Công cụ hỗ trợ những loại cơ sở dữ liệu nào?

Ví dụ cho thấy cách theo dõi quá trình chuyển đổi MongoDB và dùng CDC với Debezium, công cụ thường kết nối với các cơ sở dữ liệu như PostgreSQL, MySQL và SQL Server.

Chi tiết

Mô tả gốc của tác giả

Migration monitoring, CDC, and observability infrastructure

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4333
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự