Skip to content

Commit c2001e4

Browse files
jxomampcode-com
andcommitted
docs: update architecture diagram with lazy decode and materialized views
Amp-Thread-ID: https://ampcode.com/threads/T-019c20d5-ed3f-771f-9b81-4c75d116e465 Co-authored-by: Amp <amp@ampcode.com>
1 parent 5cc3c86 commit c2001e4

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,30 @@ curl -L https://tidx.vercel.app/docker | bash
5050
tidx uses a hybrid PostgreSQL + ClickHouse architecture. Use the `engine` parameter to choose:
5151

5252
```
53-
┌─────────────────────┐ ┌─────────────────────┐
54-
│ PostgreSQL │ WAL stream │ ClickHouse │
55-
│ (OLTP) │ ─────────────────────► │ (OLAP) │
56-
│ │ MaterializedPG │ │
57-
│ engine=postgres │ │ engine=clickhouse │
58-
└─────────────────────┘ └─────────────────────┘
53+
┌─────────────────────┐
54+
│ /query │
55+
│ │
56+
│ ?signature=... │◄─── Lazy event decoding
57+
│ ?engine=... │ (no pre-registration)
58+
└──────────┬──────────┘
59+
60+
┌──────────────────────────────────────────┼──────────────────────────────────────────┐
61+
│ │ │
62+
▼ ▼ ▼
63+
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
64+
│ PostgreSQL │ WAL stream │ ClickHouse │ │ Materialized Views │
65+
│ (OLTP) │ ─────────────────► │ (OLAP) │ ─────────────────► │ (auto-updated) │
66+
│ │ MaterializedPG │ │ │ │
67+
│ blocks, txs, logs │ │ blocks, txs, logs │ │ top_holders, etc. │
68+
│ │ │ │ │ │ └─────────────────────┘
69+
│ ▼ │ │ ▼ │
70+
│ ┌─────────────┐ │ │ ┌─────────────┐ │
71+
│ │ Transfer() │ │ │ │ Transfer() │ │
72+
│ │ Approval() │ │ │ │ Approval() │ │
73+
│ │ ... │ │ │ │ ... │ │
74+
│ └─────────────┘ │ │ └─────────────┘ │
75+
│ (lazy decode) │ │ (lazy decode) │
76+
└─────────────────────┘ └─────────────────────┘
5977
```
6078

6179
```bash

0 commit comments

Comments
 (0)