← Blog

[Patent] GritDB's fast reports start at the WAL buffer

Technology6 min read

PostgreSQL writes to the WAL buffer, and GritDB's analytics engine takes notes in columns. So GritDB takes writes as rows and reads reports in columns on the same server. GritDB's first registered patent (Korean patent No. 10-2948244), explained in figures.

By Datagrit engine team

GritDB is a dual-engine database that adds a columnar analytics engine to the PostgreSQL engine. PostgreSQL takes the writes as rows. The analytics engine reads reports in columns, which keeps them fast. And you never built a job to move the data.

How is that possible? PostgreSQL writes to the WAL buffer, and the analytics engine takes notes in columns. This method is GritDB’s first registered patent.

What the patent does What it means for GritDB
Picks up only the changes of registered tables from the WAL buffer No job moves data between the two engines
Merges only committed changes for each row Reports show only final values, with updates and deletes applied
Packs rows into compressed columns Reports read only the columns they need

Two engines, one puzzle

The two engines handle data differently. The transaction engine (PostgreSQL) writes rows, and the analytics engine (GritDB engine) reads columns.

That leaves one puzzle. How do changes that arrive as rows reach the analytics engine, which reads columns?

The clue is the WAL (write-ahead log). Before PostgreSQL changes its data files, it first writes down what it is changing in the WAL. After a failure, it recovers the data from this record. Inserts, updates and deletes all end up here. The WAL passes through the WAL buffer in memory on its way down to WAL files on disk.

The answer: take notes from the WAL buffer

The analytics engine takes notes from the changes that the transaction engine writes to its WAL buffer. It takes three steps.

How changes travel inside one GritDB server. The transaction engine (PostgreSQL) writes changes to the WAL buffer. The analytics engine picks up only the changes of registered tables, merges them for each row, packs them into compressed columns, and stores them in columnar files.
How changes travel inside one GritDB server. The analytics engine takes only the changes of registered tables from the WAL buffer, merges them for each row, packs them into columns and stores them in columnar files.
  1. Pick up: Take only the changes of registered tables from the WAL buffer. No separate job pulls the changes out and moves them. So you do not need to build a job that moves data between the two engines.
  2. Merge each row: Chain the changes for each row in time order. Once enough have piled up, apply only the committed changes, in order, and merge them into one latest state for each row. So reports show only final values, with updates and deletes applied.
  3. Pack into columns: Group the merged rows, gather the values of each column into one line (a vector), and compress it. These groups are stored in columnar files. So reports read only the columns they need.

Follow three orders

Three rows of an orders table being merged and packed into columns. Order 1 changed its amount to 120. Order 2 came in at 80 and is being changed to 90, which is not committed yet. Order 3 was deleted. Applying only committed changes gives 120, 80 and deleted. Packing by column gives row ID 1 2 3, amount 120 80 50, and valid 1 1 0.
Three rows of an orders table being merged and packed into columns. Dashed boxes are not applied yet.

An orders table has three rows.

  • Order 1: its amount was changed from 100 to 120.
  • Order 2: it came in at 80 and is being changed to 90. That change is not committed yet.
  • Order 3: it was deleted.

Merging applies only committed changes, so order 2 is still 80. The 90 goes in at the next merge, after it is committed.

When the rows are packed into columns, row IDs line up with row IDs and amounts with amounts. A valid bit is kept for each value as well. Deleted order 3 has a valid bit of 0, so it stays out of reports.

The patent publication draws this as Fig. 8.

Fig. 8 of Korean patent No. 10-2948244. Lines fan out from a table (810) to three rows. For each row, two changes are linked by an arrow inside a dashed box. The top two rows have a box on the right (830, 850) for the merged state.
Fig. 8 of the registered patent (the MVCC change map). 810 is the table. Each dashed box (820, 840, 860) holds the changes chained for one row (change map nodes), and 830 and 850 on the right are the merged latest states (clean state nodes).

What this gives GritDB

Thanks to this path, GritDB works as one analytics server that you place next to your operational database.

One server does it all. Taking rows and reading columns both happen inside one GritDB server. Inside GritDB, you do not need to build and look after a job that carries data.

Your operational database and applications stay as they are. If your operational database is PostgreSQL, you set up built-in replication instead of building a separate ETL pipeline. For other databases, you send changes with a CDC/ETL tool that writes to PostgreSQL. GritDB’s transaction engine takes the changes from your operational database and writes them to its WAL. From there, they follow the path in the figure above.

Your reporting tools stay too. Reporting and BI tools connect to GritDB with PostgreSQL drivers.

GritDB takes the heavy reports. It runs them in place of your operational database, reading columns. See how much faster they get in the TPC-H comparison test.

About the patent

Item Details
Title Technique for processing data using a WAL buffer in a DBMS
Number Korean patent No. 10-2948244
Filed · registered Filed June 25, 2025 · registered March 31, 2026
Patent holder Datagrit Corp.
Publication KR102948244B1 (Google Patents) ↗(opens in a new tab)
Where GritDB uses it PLUG (receiving changes) and UNIFY (turning rows into columns) in the analytics engine

GritDB’s second registered patent, “Dual-engine technique based on an open-source RDBMS”, was registered on November 5, 2026. See our registered and pending patents on the intellectual property page, and how the two engines fit together on the architecture page.

← All blog posts · Subscribe with RSS (in Korean)

See GritDB for yourself

Ask for a discovery meeting or a PoC, and we will get in touch.