Databases 5 min read

DBLE Middleware Overview and schema.xml Configuration Guide

This article introduces the open‑source DBLE distributed middleware, provides official resource links, outlines its main configuration files—including server.xml, schema.xml, and rule.xml—explains the role of schema.xml for sharding, and presents a detailed example with code and diagrams to help users configure DBLE effectively.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
DBLE Middleware Overview and schema.xml Configuration Guide

DBLE is an open‑source enterprise‑grade distributed middleware, nicknamed “MyCat Plus”, praised for its simplicity, stability, active community, and extensive support.

Official resources: website https://opensource.actionsky.com , GitHub project https://github.com/actiontech/dble , download page https://github.com/actiontech/dble/releases , and community group number 669663113.

The main configuration files are located in the conf directory. Key files include: server.xml: defines DBLE server parameters such as performance settings, scheduled tasks, ports, and user configurations. schema.xml: defines sharding rules, mapping between logical tables/schemas and physical data nodes, and specifies which sharding method each table uses. rule.xml: configures the actual sharding algorithms used by DBLE.

schema.xml is the most frequently edited file for configuring logical‑to‑physical database relationships. An example schema.xml is shown below, followed by a diagram illustrating the mapping.

Schema diagram
Schema diagram
<?xml version="1.0"?>
<!DOCTYPE dble:schema SYSTEM "schema.dtd">
<dble:schema xmlns:dble="http://dble.cloud/">
    <schema name="testdb">
        <table name="goods" primaryKey="ID" type="global" dataNode="dn1,dn2" />
        <table name="order" primaryKey="ID" dataNode="dn1,dn2" rule="sharding-by-date" />
    </schema>
    <!-- Sharding configuration -->
    <dataNode name="dn1" dataHost="dh1" database="db1"/>
    <dataNode name="dn2" dataHost="dh2" database="db2"/>
    <!-- Physical database configuration -->
    <dataHost name="dh1" maxCon="1000" minCon="10" balance="0" switchType="1" slaveThreshold="100">
        <heartbeat>show slave status</heartbeat>
        <writeHost host="MySQLA" url="172.16.1.1:3306" user="test" password="password"/>
    </dataHost>
    <dataHost name="dh2" maxCon="1000" minCon="10" balance="0" switchType="1" slaveThreshold="100">
        <heartbeat>show slave status</heartbeat>
        <writeHost host="MySQLB" url="172.16.1.2:3306" user="test" password="password">
            <readHost host="MySQLC" url="172.16.1.3:3306" user="test" password="password"/>
        </writeHost>
    </dataHost>
</dble:schema>

The example defines a schema testdb with two tables ( goods and order) assigned to data nodes dn1 and dn2. Data nodes reference physical hosts dh1 and dh2, each with connection details, heartbeat queries, and read/write host configurations.

Mastering the concepts in schema.xml enables effective DBLE configuration; for advanced usage and detailed options, refer to the official documentation.

Schema diagram
Schema diagram
Summary diagram
Summary diagram
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

databasesDBLEschema.xml
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.