← Back to blog
Xinchuang 4 min read 炬鲸团队

Adapting an Observability Platform to Dameng DM8

When a domestic-computing project swaps its database for Dameng DM8, the observability platform must follow. This post records a real adaptation: connection strings, SQL dialect, pagination and transaction differences, plus one-command deployment on domestic ARM.

Why the database has to move too

Every domestic-computing acceptance checklist includes "database localization," and there is no way around it. If the platform still depends on the original Oracle or MySQL, it fails the review. An observability platform stores metadata of its own — services, alert rules, audit logs — so its database must support a domestic replacement.

Observe is built in Go with a dialect abstraction in its data-access layer. Connecting to Dameng DM8 requires no business-logic changes — only a driver and connection-string swap. Here is what a real adaptation looked like.

Connection string and driver

DM8 ships a JDBC-compatible driver. On the Go side you can use Dameng's official go-driver or DM's MySQL compatibility mode. If the project already leans on the MySQL ecosystem, enable MySQL compatibility mode in DM8 for the smallest change:

dsn := "dm://SYSDBA:Sysdba123@192.168.10.20:5236?compatibleMode=mysql"

On the platform side, only a few environment variables change:

DB_TYPE=dm8
DB_HOST=192.168.10.20
DB_PORT=5236
DB_USER=SYSDBA
DB_PASSWORD=********
DB_SCHEMA=OBSERVE

Three dialect differences that will bite you

  1. Pagination — MySQL's LIMIT m, n must become LIMIT n OFFSET m (or DM's TOP). The platform wraps pagination in a single function, so the business layer never notices.
  2. Identifiers — DM upper-cases unquoted identifiers by default. Create tables and indexes with quoted lowercase names to dodge case-sensitivity surprises.
  3. Transaction isolation — DM8 defaults to read-committed, but its behavior under long transactions differs subtly from MySQL's MVCC. Audit writes should use a separate connection to avoid lock waits against query transactions.

These three are the usual suspects; once fixed, the rest generally just works.

Migrating from MySQL

Moving existing data from MySQL to DM8 happens in two steps — structure, then data. Regenerate the DDL under DM's dialect first (mind the identifier rules above), then use Dameng's migration tool or dts to copy the rows. Two things deserve a close look after the move:

  • Timestamp precision and defaults — DM's TIMESTAMP handles milliseconds slightly differently from MySQL.
  • Auto-increment primary keys and indexes — DM's SEQUENCE semantics differ from MySQL's AUTO_INCREMENT, so the key-generation logic must change in step.

One-command deployment on ARM

Domestic environments are typically Kunpeng/Phytium CPUs plus Kylin V10. Observe ships an ARM64 single binary. After setting the variables above:

wget https://download.jjhub.cn/observe/arm64/observe
chmod +x observe
./observe --config ./env

No compilation, no Go runtime — one command starts it. Wrap it in a systemd unit for boot-time startup. Tune the connection pool against DM8's concurrency limits: the default pool is stable on domestic ARM, but under load testing, keeping the maximum connections under 70% of DM8's configured limit is the safer bet.

Tuning for stability on domestic ARM

Beyond the pool ceiling, three settings matter when DM8 runs on Kunpeng/Phytium hardware. First, cap total connections at roughly 70% of DM8's configured limit — the default pool is stable, but a burst of alert-rule evaluations during an incident can exhaust connections and trigger cascading query failures. Second, batch audit writes: the audit table is the platform's hottest writer, so buffer events and flush in batches rather than one row per operation. That keeps the trail complete without hammering DM8's transaction log. Third, align backups with traffic: the platform is query-heavy during working hours and write-heavy overnight when alerts and cron jobs run, so schedule DM8's online backup windows outside peak query hours.

Finally, expose DM8's own health — connections, deadlocks, redo-log growth — as metrics into the platform itself, so a database slowdown appears on the same dashboard as the services that depend on it. When the database is the bottleneck, you want to see that in one glance rather than discovering it only after a ticket escalates.

These are small knobs, but they are the difference between "it runs" and "it survives a quarterly security review under load."

Acceptance checklist

  • Metadata CRUD: services, alert rules and audit logs all read/write correctly on DM8.
  • Failover drill: stop the DM8 primary and confirm the platform switches to standby or degrades to read-only as configured.
  • Data stays internal: everything lands on the in-network DM8, with no outbound channel.
  • Compliance: login, query and export are all audited, with separation of duties supported.