diff --git a/docs/adr/ADR-001-htap-delta-merge.md b/docs/adr/ADR-001-htap-delta-merge.md new file mode 100644 index 0000000..396d795 --- /dev/null +++ b/docs/adr/ADR-001-htap-delta-merge.md @@ -0,0 +1,17 @@ +# ADR-001: HTAP via Delta-Merge (HANA-inspired) + +**Status:** Accepted + +## Decision +PaulDB implements HTAP through a Delta (Row-Store) + Main (Column-Store) split, +merged periodically - mirroring SAP HANA's architecture. + +## Rationale +Single-store systems force a choice between OLTP and OLAP performance. +The Delta-Merge pattern allows both: fast writes land in Delta (row-optimized), +analytics scan Main (column-optimized, compressed). + +## Consequences +- Every query must union Delta + Main results. +- A merge worker must run periodically. +- The C ABI boundary (storage.h) cleanly separates both stores. diff --git a/examples/.gitkeep b/examples/.gitkeep new file mode 100644 index 0000000..473a0f4 diff --git a/src/engine/delta_merge.cpp b/src/engine/delta_merge.cpp new file mode 100644 index 0000000..bdec725 --- /dev/null +++ b/src/engine/delta_merge.cpp @@ -0,0 +1 @@ +/* delta_merge.cpp - Engine Logic (C++) */ diff --git a/src/engine/executor.cpp b/src/engine/executor.cpp new file mode 100644 index 0000000..3b340c6 --- /dev/null +++ b/src/engine/executor.cpp @@ -0,0 +1 @@ +/* executor.cpp - Engine Logic (C++) */ diff --git a/src/engine/mvcc.cpp b/src/engine/mvcc.cpp new file mode 100644 index 0000000..f9fa409 --- /dev/null +++ b/src/engine/mvcc.cpp @@ -0,0 +1 @@ +/* mvcc.cpp - Engine Logic (C++) */ diff --git a/src/engine/query_router.cpp b/src/engine/query_router.cpp new file mode 100644 index 0000000..c8e098c --- /dev/null +++ b/src/engine/query_router.cpp @@ -0,0 +1 @@ +/* query_router.cpp - Engine Logic (C++) */ diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..c29220a --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() { + std::printf("PaulDB starting...\n"); + return 0; +} diff --git a/src/sql/ast.cpp b/src/sql/ast.cpp new file mode 100644 index 0000000..a1b20b8 --- /dev/null +++ b/src/sql/ast.cpp @@ -0,0 +1 @@ +/* ast.cpp - SQL Frontend (C++) */ diff --git a/src/sql/parser.cpp b/src/sql/parser.cpp new file mode 100644 index 0000000..907ad69 --- /dev/null +++ b/src/sql/parser.cpp @@ -0,0 +1 @@ +/* parser.cpp - SQL Frontend (C++) */ diff --git a/src/sql/planner.cpp b/src/sql/planner.cpp new file mode 100644 index 0000000..63c4ad9 --- /dev/null +++ b/src/sql/planner.cpp @@ -0,0 +1 @@ +/* planner.cpp - SQL Frontend (C++) */ diff --git a/src/sql/tokenizer.cpp b/src/sql/tokenizer.cpp new file mode 100644 index 0000000..5cdd590 --- /dev/null +++ b/src/sql/tokenizer.cpp @@ -0,0 +1 @@ +/* tokenizer.cpp - SQL Frontend (C++) */ diff --git a/src/storage/arena.c b/src/storage/arena.c new file mode 100644 index 0000000..016a9c1 --- /dev/null +++ b/src/storage/arena.c @@ -0,0 +1,2 @@ +/* arena.c - Storage Engine (C) */ +#include "pauldb/storage.h" diff --git a/src/storage/btree.c b/src/storage/btree.c new file mode 100644 index 0000000..9894bd3 --- /dev/null +++ b/src/storage/btree.c @@ -0,0 +1,2 @@ +/* btree.c - Storage Engine (C) */ +#include "pauldb/storage.h" diff --git a/src/storage/buffer_pool.c b/src/storage/buffer_pool.c new file mode 100644 index 0000000..ef0d253 --- /dev/null +++ b/src/storage/buffer_pool.c @@ -0,0 +1,2 @@ +/* buffer_pool.c - Storage Engine (C) */ +#include "pauldb/storage.h" diff --git a/src/storage/free_space_map.c b/src/storage/free_space_map.c new file mode 100644 index 0000000..90fd5ff --- /dev/null +++ b/src/storage/free_space_map.c @@ -0,0 +1,2 @@ +/* free_space_map.c - Storage Engine (C) */ +#include "pauldb/storage.h" diff --git a/src/storage/heap.c b/src/storage/heap.c new file mode 100644 index 0000000..51da23a --- /dev/null +++ b/src/storage/heap.c @@ -0,0 +1,2 @@ +/* heap.c - Storage Engine (C) */ +#include "pauldb/storage.h" diff --git a/src/storage/page.c b/src/storage/page.c new file mode 100644 index 0000000..2339b01 --- /dev/null +++ b/src/storage/page.c @@ -0,0 +1,2 @@ +/* page.c - Storage Engine (C) */ +#include "pauldb/storage.h" diff --git a/src/storage/wal.c b/src/storage/wal.c new file mode 100644 index 0000000..7fafbec --- /dev/null +++ b/src/storage/wal.c @@ -0,0 +1,2 @@ +/* wal.c - Storage Engine (C) */ +#include "pauldb/storage.h" diff --git a/test/engine/.gitkeep b/test/engine/.gitkeep new file mode 100644 index 0000000..473a0f4 diff --git a/test/sql/.gitkeep b/test/sql/.gitkeep new file mode 100644 index 0000000..473a0f4 diff --git a/test/storage/.gitkeep b/test/storage/.gitkeep new file mode 100644 index 0000000..473a0f4