DEV Community

mmllllzcn
mmllllzcn

Posted on

GBase Database: Single vs. Layered Dbspace Layout — A Reproducible Comparison

Summary: Should business tables share rootdbs or use dedicated dbspaces? This guide presents a reproducible benchmark methodology for comparing single-space and layered storage layouts in GBase Database(GBase 8s), covering test design, SQL placement, I/O behavior, temporary space usage, and operational overhead.

Deciding whether business tables need dedicated dbspaces often turns into a debate based on individual experience. A more reliable approach is to run a controlled comparison.

Use the same machine, the same data, and the same SQL workload. Change only the storage layout, then compare the results.

This article focuses on the testing methodology, not a predetermined conclusion. Actual results depend on hardware, data volume, concurrency, and workload characteristics. Someone else's benchmark numbers cannot replace testing in your own environment.

1. Design Two Control Groups

The comparison uses two storage layouts.

Group A: Single-space layout

  • All business tables reside in rootdbs.
  • Temporary sorting uses the default storage arrangement.
  • No additional business dbspaces are introduced.

Group B: Layered-space layout

  • Business tables reside in datadbs01.
  • Historical tables reside in datadbs02.
  • Temporary sorting uses tempdbs01.
  • BLOB data resides in sbspace01.

The purpose is to isolate the impact of storage placement rather than introduce unrelated configuration differences.

Control Variables

Keep the following conditions consistent:

Variable Requirement
Hardware Same machine or identical specifications
Operating system Same OS version and kernel parameters
Data Same volume, table structures, and indexes
SQL workload Same SQL statements and concurrency ramp
Client Same client software and network path
Database state Consistent initialization and cache conditions

One important detail is cache management.

If Group A runs first and Group B runs immediately afterward, the buffer pool may still contain frequently accessed data from the first test. This can distort the comparison.

Restart the instance before each test group and use a consistent warm-up procedure. Also keep the test order documented; repeating the runs with reversed order can help identify order-related bias.

2. Build the Layered Storage Layout

Before creating the dbspaces for Group B, prepare the physical chunk file.

For example:

touch /data/gbase/datachk01
chown gbasedbt:gbasedbt /data/gbase/datachk01
chmod 660 /data/gbase/datachk01
Enter fullscreen mode Exit fullscreen mode

Then create the business dbspace:

onspaces -c -d datadbs01 \
  -p /data/gbase/datachk01 \
  -o 0 \
  -s 102400 \
  -k 16
Enter fullscreen mode Exit fullscreen mode

Repeat the process for the other required storage spaces, including the historical-data and temporary-storage spaces.

For the SQL layer, explicitly specify storage placement:

CREATE DATABASE benchdb IN datadbs01 WITH LOG;

CREATE TABLE t_order (
    id SERIAL,
    c1 VARCHAR(64)
) IN datadbs01;

CREATE TABLE t_order_hist (
    id SERIAL,
    c1 VARCHAR(64)
) IN datadbs02;
Enter fullscreen mode Exit fullscreen mode

Group A should omit explicit IN clauses where the purpose is to test default placement.

Keep the remaining DDL, indexes, and data-loading procedures as similar as possible between the groups.

For large objects, configure and test the appropriate sbspace placement separately. Do not assume that ordinary table placement automatically determines where every large object is stored.

3. What Should the Benchmark Measure?

QPS alone is not enough to evaluate a database storage layout.

In GBase Database(GBase 8s), different dbspace arrangements can affect I/O distribution, temporary storage consumption, capacity management, and operational complexity.

Record at least four categories.

3.1 Dbspace Utilization

Use:

onstat -d
Enter fullscreen mode Exit fullscreen mode

Observe the free values in the Chunks section.

Questions to answer:

  • Does storage consumption match between groups at the same data volume?
  • Which dbspaces experience the fastest capacity decline?
  • Does separating historical and business data change the distribution of storage consumption?

Remember that size and free are measured in pages, not KB or MB. Interpret them using the corresponding page size.

3.2 Temporary Space Behavior

Check whether sorting operations and temporary tables use the intended temporary storage.

Observe:

  • Whether temporary operations consume business dbspace capacity.
  • Whether temporary space approaches its capacity limit.
  • Whether large sorting workloads cause unexpected storage pressure.

A dedicated temp dbspace is useful only if the relevant operations actually use it.

3.3 I/O Contention

Compare the interaction between different storage workloads:

  • Business transaction writes.
  • Transaction logging.
  • Temporary sorting.
  • Historical-data access.

If all these workloads compete for the same physical storage resources, separating logical dbspaces alone may not eliminate the underlying I/O contention.

This distinction is important: logical storage separation and physical disk separation are not the same thing.

3.4 Expansion and Backup Operations

Storage architecture also affects daily operations.

Record the time and complexity involved in:

  • Adding a new chunk.
  • Expanding an existing storage space.
  • Managing historical-data capacity.
  • Backing up different storage areas.
  • Planning maintenance windows.

A layout that offers similar query performance may still provide operational advantages through clearer expansion and backup boundaries.

4. How to Interpret the Results

The objective is not to prove that layered storage always wins. It is to understand under which conditions each layout works better.

Scenario A: Similar performance at low concurrency, but more stable I/O at high concurrency

If Group B maintains more stable I/O behavior and temporary sorting no longer competes with business storage capacity, the layered layout may be providing meaningful operational benefits.

Scenario B: Group B performs worse

Investigate the underlying configuration before concluding that layering is ineffective.

Possible causes include:

  • The new dbspaces reside on slower physical disks.
  • Too many chunks introduce additional management overhead.
  • Storage placement does not match the actual workload.
  • The test groups have different cache or warm-up conditions.

Scenario C: Both groups perform similarly

This is also a valid result.

It may indicate that the current data volume and concurrency have not reached the storage boundaries where layering provides measurable benefits.

There is no reason to introduce unnecessary storage complexity simply to make the architecture look more organized.

The purpose of dbspace layering in GBase Database is to establish clearer boundaries for capacity management, troubleshooting, and backup — not to maximize the number of dbspaces.

5. Write a Reproducible Benchmark Report

A useful benchmark report should allow another DBA to repeat the experiment and understand the conclusion.

Include at least:

Report item Information to record
Machine specifications CPU, memory, disks, and storage configuration
Software environment OS, kernel, and GBase Database version
Data volume Table sizes, row counts, and indexes
Group A layout Single-space configuration
Group B layout Layered-space configuration
Workload SQL statements and concurrency ramp
Storage observations Dbspace utilization and temp space behavior
I/O observations Contention and workload distribution
Operational observations Expansion and backup complexity
Conclusion Conditions under which each layout is suitable

Most importantly, express conclusions in reproducible terms.

Good conclusion:

"At 200 concurrent sessions, Group A showed temporary sorting activity consuming capacity in rootdbs, while Group B directed the tested temporary workload to tempdbs01. Business-space utilization followed different growth patterns."

Weak conclusion:

"Layered storage improved database performance by 30%."

The first statement describes an observable result and its conditions. The second gives a percentage without enough context to reproduce or evaluate it.

Final Thoughts

Storage layout in GBase Database(GBase 8s) deserves careful planning, but careful planning does not mean blindly copying a recommended architecture.

A single-space layout may be sufficient for a smaller workload. A layered layout may provide better operational boundaries when business data, historical records, temporary operations, and large objects grow at different rates.

The right decision depends on actual workload behavior and operational requirements.

Build two configurations, control the variables, measure the differences, and document the results.

One reproducible comparison in your own environment is more valuable than memorizing someone else's "best layout."

Top comments (0)