Kingbase Banner

Multi-Model Database Tutorial_ Evaluate Polyglot Persistence

Precision tools arranged on a clean surface for a technical tutorial on multi-model database architecture

Prerequisites for Evaluating Unified Data Architectures

Before evaluating a multi-model database, you must define the technical environment and baseline requirements. This ensures you can accurately distinguish between native multi-model support and external integration layers.

Environment and Version Prerequisites

  • Commercial License: KingbaseES is a commercial database product. Ensure you have valid licensing for the target environment.
  • Deployment Mode: Verify that the target deployment mode (cloud, edge, IoT, or local data center) aligns with the high-availability architecture requirements, such as shared storage clusters or active-active across cities.
  • Optimization Tools: For performance validation, ensure deep adaptation with optimization tools like PawSQL is configured. Register on the PawSQL website and create a new workspace selecting ‘KingbaseES’ as the workspace type.
  • Environment Variables: Set the following environment variables to ensure correct path resolution for tools and binaries:
export KINGBASE_HOME=/opt/Kingbase/ES/V9/kingbase
export PATH=$KINGBASE_HOME/Server/bin:$PATH
export PATH=$KINGBASE_HOME/ClientTools/bin:$KINGBASE_HOME/ClientTools/guitools/KStudio:$PATH
export KINGBASE_DATA=/opt/Kingbase/ES/V9/data
export KINGBASE_PORT=54321
  • Certification Compliance: If regulatory compliance is a constraint, verify that the installed version holds the necessary certifications, such as EAL4+ from national authoritative institutions.

Scope Definition

  • Supported Models: KingbaseES is a commercial relational database. It does not natively support vector embeddings, time-series data, or native graph traversal as standalone models.
  • Oracle Compatibility: If migrating from legacy systems, verify that the ‘ORACLE’ syntax compatibility mode is selected during initialization.

Defining the Boundary: Native Multi-Model vs. Polyglot Persistence

A multi-model database uses a single system to support multiple popular data models, whereas polyglot persistence uses traditional dedicated databases for different models, requiring complex synchronization.

Architectural Distinction

  • Polyglot Persistence: Involves maintaining separate clusters for document, graph, and key-value data. This introduces synchronization latency and consistency risks.
  • Multi-Model Architecture: Provides a single transactional boundary for diverse access patterns. This reduces operational overhead by eliminating external synchronization layers.

KingbaseES Capability Boundaries

KingbaseES is a commercial relational engine with specific extensions. It does not support all multi-model types.

  • Not Natively Supported: Vector embeddings, time-series data, XML data, property graphs/RDF, key-value stores, document stores, column stores, graph data, spatial data, text data, object-relational models, federated database capabilities, polystore capabilities, multistore capabilities, NoSQL capabilities, native graph traversal over JSON documents, unified query interface handling joins between document fields and graph relationships, transactional consistency across different data models within the same engine, JSON data, Key-Value data, Graph data.
  • Supported Features: Unified deployment architecture (shared storage clusters, read-write separation, active-active across cities), Oracle syntax compatibility, diverse deployment modes (cloud, edge, IoT, local data centers), and integration with PawSQL for performance optimization.

Evaluation Criteria

When evaluating a multi-model database, focus on verifiable technical prerequisites, native support verification, and performance validation. Avoid theoretical claims about unsupported capabilities.

Verifying Transactional Consistency in Relational Data

To verify that relational operations adhere to ACID properties within a single engine, follow this step-by-step procedure. This section focuses on relational data consistency and Oracle-compatibility features, as KingbaseES does not support cross-model transactions across different data models.

Step 1: Setup Test Environment

  • Initialize the database with the required compatibility mode (e.g., ‘ORACLE’ if needed).
  • Configure the environment variables as defined in the prerequisites.

Step 2: Create Relational Test Data

  • Insert relational data into standard tables.
  • Ensure that the data models being tested are natively supported by the engine (relational data).

Step 3: Execute Relational Transactions

  • Begin a transaction.
  • Perform updates on relational data.
  • Commit the transaction.

Step 4: Verify Consistency

  • Query the relational data to ensure it is updated atomically.
  • If the transaction fails, roll back and verify that no partial updates occurred.

Step 5: Performance Validation

  • Use PawSQL to analyze the execution plan and identify any performance bottlenecks.
  • Compare the performance of complex relational transactions against simpler queries.

Failure Modes and Rollback

  • Failure Mode: If the transaction fails due to a constraint violation, ensure that the rollback mechanism correctly reverts all changes.
  • Rollback Procedure: Use standard SQL rollback commands. Verify that the database returns to its pre-transaction state.

Unified Query Interface and Execution Plan Analysis

Evaluate the unified query parser by analyzing how it handles joins between supported data models in a single execution plan.

Query Interface Verification

  • Supported Models: Focus on relational data, as this is natively supported.
  • Unsupported Models: Do not test native graph traversal or vector search, as these are not supported.

Execution Plan Analysis

  • Use the EXPLAIN command to view the execution plan for complex queries involving joins between relational tables.
  • Analyze the plan for efficient index usage and minimal table scans.

Performance Implications

  • Abstraction Layer Overhead: Evaluate the performance impact of the abstraction layer. Use PawSQL to identify any overhead introduced by the unified query interface.
  • Optimization: Ensure that the database optimizer is correctly handling joins between different relational tables.

Example Query

EXPLAIN ANALYZE
SELECT r.id, r.status
FROM relational_table r
JOIN another_relational_table a ON r.id = a.rel_id
WHERE r.status = 'active';

Verification Check

  • Verify that the query executes without errors.
  • Check the execution time and resource usage.
  • Compare the results with a baseline query on a single data model.

Performance Validation and Operational Complexity Reduction

Measure the performance impact of switching to a unified architecture and highlight the role of management tools in reducing operational overhead.

Performance Metrics

  • Latency: Measure the latency of complex relational queries compared to simple queries.
  • Throughput: Measure the throughput of the unified database under load.
  • Resource Usage: Monitor CPU, memory, and I/O usage during peak load.

Operational Complexity Reduction

  • Unified Management: Use the KingbaseES Enterprise Management and Control Center (KEMCC) for centralized monitoring and automated control.
  • Case Study: CNOOC (China National Offshore Oil Corporation) uses KingbaseES to handle massive sensor and business data per second. KEMCC manages resources across cloud, edge, IoT, and local data centers.
  • Benefits: Reduced operational overhead, simplified monitoring, and automated control.

Validation Steps

  • Step 1: Deploy the unified database in a test environment.
  • Step 2: Load test data representing the target workload.
  • Step 3: Run performance benchmarks using standard tools.
  • Step 4: Analyze the results using KEMCC and PawSQL.
  • Step 5: Compare the results with the baseline polyglot stack performance.

Failure Modes

  • Resource Contention: Monitor for resource contention during peak load.
  • Scalability Issues: Test the scalability of the unified database under increasing load.

Migration Strategy and Rollback Procedures

Provide a concrete guide for migrating from siloed databases to a unified architecture, including specific failure modes and rollback steps.

Migration Strategy

  • Step 1: Assessment: Assess the current polyglot stack and identify the data models to be migrated.
  • Step 2: Design: Design the unified schema in the target database.
  • Step 3: Data Migration: Migrate data from the siloed databases to the unified database. Use ETL tools or custom scripts.
  • Step 4: Validation: Validate the migrated data for consistency and completeness.
  • Step 5: Cutover: Switch the application to use the unified database.

Generic Migration Checklist

  • Assess current polyglot stack and identify data models to be migrated.
  • Design unified schema in the target database.
  • Migrate data from siloed databases to the unified database using ETL tools or custom scripts.
  • Validate migrated data for consistency and completeness.
  • Switch the application to use the unified database.

Failure Modes and Rollback

  • Failure Mode: Data inconsistency during migration.

  • Rollback Procedure:

    1. Stop the application.
    2. Restore the siloed databases from backups.
    3. Verify the integrity of the siloed databases.
    4. Restart the application.
  • Failure Mode: Application errors due to schema changes.

  • Rollback Procedure:

    1. Revert the application code to the previous version.
    2. Restart the application.
    3. Investigate the schema changes and fix the issues.

Validation Checklist

  • Native support for required data models verified (excluding unsupported ones like vector/native graph).
  • Transactional consistency verification results confirmed.
  • Operational tooling integration (KEMCC/PawSQL) validated.
  • Rollback readiness confirmed with tested procedures.

FAQ

What are the specific prerequisites and version constraints for implementing a multi-model database in an enterprise environment?

Ensure you have valid commercial licensing, the correct deployment mode (cloud, edge, IoT, or local), and deep adaptation with optimization tools like PawSQL. Set the required environment variables and verify certification compliance (e.g., EAL4+). Note that KingbaseES is a commercial relational database and does not support native multi-model features such as JSON, Graph, or Key-Value stores.

How can I verify data consistency and query performance across different models in a multi-model database before full deployment?

Execute cross-model transactions and verify atomicity. Use EXPLAIN ANALYZE to check execution plans. Measure latency, throughput, and resource usage under load. Use PawSQL for performance analysis. Note that KingbaseES does not support transactional consistency across different data models within the same engine because it does not support those different data models.

What are the common failure modes and rollback procedures when migrating from siloed databases to a multi-model architecture?

Common failure modes include data inconsistency and application errors due to schema changes. Rollback procedures involve restoring siloed databases from backups or reverting application code. Test rollback procedures before full cutover.

How does a multi-model database reduce operational complexity compared to maintaining separate specialized database clusters?

A multi-model database provides a single transactional boundary and unified management platform (KEMCC), eliminating the need for external synchronization layers and simplifying monitoring and control.

What are the ACID trade-offs when maintaining data consistency across different data models within a single unified system?

ACID properties are maintained within the single engine for supported relational data. This eliminates the consistency risks associated with polyglot persistence. KingbaseES does not support ACID trade-offs across different data models because it does not support those different data models.


💡 More Resources

If you would like to dive deeper into KingbaseES and its application practices across various industries, we have compiled the following official resources to help you get started quickly and develop and operate with efficiency:

  • Kingbase Community: A one-stop interactive platform for technical exchanges, Q&A, and experience sharing—join forces with fellow DBAs and developers.
  • Kingbase Solutions: One-stop full-stack database migration and cloud-native solutions, supporting smooth migration of multi-source heterogeneous data, ensuring high availability, real-time integration, and sustained high performance.
  • Kingbase Case Studies: Real-world user scenarios and implementation outcomes, showcasing KingbaseES’s outstanding capabilities in high availability, high performance, and IT adaptation.
  • Kingbase Documentation: Authoritative and comprehensive product manuals and technical guides, covering the entire lifecycle from installation and deployment to development, programming, and operations management.
  • Free Download: Get the latest installation packages, drivers, tools, and patches, supporting multiple platforms and domestic chip architectures.
  • Digital Construction Encyclopedia: Covers digital strategy planning, data integration, metrics management, database visualization applications, and more to empower enterprise digital transformation.

Open Source Resources:

Welcome to explore the resources above and begin your Kingbase journey!