[Patent] GritDB's fast reports start at the WAL buffer
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.
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.
- 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.
- 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.
- 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
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.
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)