DEV Community

mmllllzcn
mmllllzcn

Posted on

Text vs Binary Export in GBase Database: A Reproducible Performance Comparison

Which database export method is faster: text or binary?

There are plenty of performance comparisons online, but their results rarely apply directly to your environment. Hardware, database versions, data volume, and storage performance all influence the outcome.

Instead of relying on someone else's benchmark, you can run a controlled comparison in your own environment.

GBase Database(GBase 8s) provides two data export and import approaches: logical text export using dbexport / dbimport, and binary data transfer using onunload / onload.

This guide explains how to compare both methods using four measurable criteria: export time, import time, artifact size, and verification effort.

1. Establish Four Rules for a Fair Benchmark

Before running the comparison, control the test conditions.

  1. Same source data: Use the same database, tables, and row counts for both methods.
  2. Same hardware: Run both tests on the same machine to eliminate hardware and network differences.
  3. Same target conditions: Import into freshly created, empty target databases with equivalent configurations.
  4. Three runs per metric: Repeat each test three times and use the median as the representative result.

Without these controls, the performance numbers are difficult to compare.

For a meaningful GBase Database export performance benchmark, record the database version, operating system, storage configuration, and relevant environment settings alongside the results.

2. Prepare the Two Export and Import Workflows

Text Export and Import

Use dbexport to generate the logical export files:

time dbexport mydb -o /data/exp_text
Enter fullscreen mode Exit fullscreen mode

Then import the exported data into the target database:

time dbimport mydb_copy -d datadbs1 -i /data/exp_text
Enter fullscreen mode Exit fullscreen mode

The text-based approach exports logical database definitions and data into files that can be inspected before import.

Binary Export and Import

Use onunload to generate a binary archive:

time onunload -t /home/gbasedbt/mydb.archive mydb
Enter fullscreen mode Exit fullscreen mode

Then load the archive into the target environment:

time onload -t /home/gbasedbt/mydb.archive -d datadbs1 mydb_copy
Enter fullscreen mode Exit fullscreen mode

The binary approach moves data in a physical representation rather than reconstructing it through the same logical row-by-row import process.

Important: Binary transfer has stricter compatibility requirements. Source and target versions, architectures, and operating modes must satisfy the applicable requirements.

Run this comparison in a compatible environment. Otherwise, a failed binary import may reflect an environment mismatch rather than a performance limitation.

3. Measure Four Performance and Operational Metrics

A useful GBase Database text vs binary export comparison should measure more than elapsed time.

Metric Measurement What It Tells You
Export time time real Time required to generate the export
Import time time real Time required to populate the target database
Artifact size du -sh Storage required for the exported files
Verification effort Manual step count How much work is required to inspect and validate the result

The first three metrics are quantitative. The fourth captures an operational cost that is easy to overlook.

Text exports can be inspected, compared, and selectively reviewed before import. Binary archives are not directly human-readable and generally require loading before their contents can be queried and verified.

4. Inspect the Text Export Results

After running dbexport, inspect the generated directory:

du -sh /data/exp_text
ls /data/exp_text | head
Enter fullscreen mode Exit fullscreen mode

The text export contains logical database definitions and data files.

Its size may be larger than a binary archive, and the export/import process involves logical data conversion and reconstruction.

However, the text format provides an important advantage: visibility.

You can:

  • Open individual export files.
  • Inspect table definitions and data.
  • Compare exported content.
  • Review selected files before importing.
  • Use the files for cross-environment migration workflows.

For migrations involving different hardware platforms or database versions, subject to supported logical migration compatibility, this flexibility can be more valuable than raw speed.

5. Inspect the Binary Export Results

After running onunload, check the archive:

ls -lh /home/gbasedbt/mydb.archive
Enter fullscreen mode Exit fullscreen mode

Binary export moves data in physical form, avoiding much of the logical row parsing and reconstruction involved in text-based migration.

This can make it attractive for:

  • Refreshing test environments.
  • Creating compatible instance copies.
  • Performing controlled failover exercises.
  • Moving large datasets between compatible environments.

The trade-off is reduced flexibility.

Version, architecture, and operating mode must meet the applicable compatibility requirements. A smaller archive does not automatically mean a successful migration.

Always validate the target environment before starting the transfer.

6. How to Interpret the Benchmark Results

Once all three runs are complete, compare the median results.

A simple result table can look like this:

Metric Text Export/Import Binary Export/Import
Median export time Record result Record result
Median import time Record result Record result
Artifact size Record result Record result
Verification steps Record result Record result

Do not assume binary is always the better choice simply because it imports faster.

If the binary method is significantly faster and the target environment satisfies all compatibility requirements, it may be the better option.

If the migration crosses environments, requires structural inspection, or needs selective verification, the additional time spent using text export may be justified.

Also consider the cost of a failed migration and rerun. A method that saves several minutes but introduces substantial compatibility risk may not be the most efficient choice overall.

7. Keep Backup and Recovery Separate from Export Benchmarks

One final distinction matters: this is a comparison of data export and import methods, not a backup and recovery benchmark.

Database backup and recovery must address different requirements:

  • Point-in-time recovery.
  • Transaction log consistency.
  • Backup retention.
  • Recovery objectives and procedures.

Neither dbexport nor onunload should be treated as a replacement for a complete backup and recovery strategy.

Keep these workflows separate when designing your GBase Database operations plan.

Conclusion

There is no universal performance winner between text and binary export.

In GBase Database(GBase 8s), logical text export prioritizes flexibility and inspectability, while binary transfer prioritizes speed under compatible environmental conditions.

A reproducible benchmark should measure:

  1. Export time.
  2. Import time.
  3. Export artifact size.
  4. Verification effort.

More importantly, the final decision should account for compatibility, recovery cost, and operational requirements.

The best migration method is not necessarily the one with the shortest elapsed time. It is the one that delivers the required data safely, predictably, and within the available maintenance window.

Top comments (0)