尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗A Kafka-style distributed commit log written from first principles in Java 21, plus a showcase site that renders the running cluster live.
The broker is hand-written and has zero runtime dependencies: segment files, the sparse offset index, the record batch format (CRC-32C, varints), the NIO network layer, pull-based replication with an in-sync replica set, leader election, consumer groups, idempotent producers and log compaction. Apache Kafka appears only in bench/, as the comparison baseline.
Every durability claim in this repository comes from a test that killed a process, and every number comes from a recorded command with its full configuration. See RUN-REPORT.md for the evidence and FINAL-AUDIT.md for the summary.
The hosted demo is one broker on Render's free tier (512 MB, no persistent disk, asleep after 15 idle minutes) behind the Next.js site on Vercel. It proves the broker runs: the site's topology section shows the real deployed node, labelled as one node, whenever it is awake, and a recorded snapshot, labelled as recorded, while it wakes or sleeps.
One node cannot show replication, ISR changes, leader election or failover. Those claims rest on recorded evidence from a local three-node cluster: the crash-recovery replay on the site (a recorded chaos/run-all.sh leader-kill run, played entirely in the browser), bench/results/ and chaos/results/. Every measured number in this repository and on the site comes from that local cluster, with the hardware recorded next to it.
| Path | What |
|---|---|
broker/ | The broker (dev.logforge): log, network, replication, coordinator, controller, admin |
client/ | Java producer, consumer (with groups) and admin client |
bench/ | Throughput and latency harness, LogForge vs Apache Kafka; chaos client |
chaos/ | Kill-and-verify scenarios against Docker Compose |
web/ | Next.js showcase site |
docs/ | PRD, architecture, wire protocol, admin API, design, decisions, interview notes |
Prerequisites: JDK 21+, Docker with Compose, Node 22.18+ (it runs the TypeScript site tests directly) and pnpm 9 for the site.
./mvnw -B -ntp verify
cp .env.example .env
Fill .env with two different random tokens (openssl rand -hex 32), then:
docker compose up -d --build
The controller's admin API is on http://127.0.0.1:8080 (token-protected; /health is public). Broker ports are not published; clients run on the logforge_cluster network.
bash bench/run.sh
bash chaos/run-all.sh
cd web && pnpm install && pnpm dev
Broker on Render (free web service, Docker, from this repository; render.yaml holds the settings). Set in the Render dashboard, Environment:
| Variable | Value |
|---|---|
LOGFORGE_ADMIN_TOKEN | a random secret, at least 24 characters (openssl rand -hex 32) |
LOGFORGE_READ_TOKEN | a different random secret, same length |
LOGFORGE_CORS_ORIGINS | the site's production origin, e.g. https://<project>.vercel.app |
When creating the service by hand instead of from the Blueprint, also set LOGFORGE_NODE_ID=1, LOGFORGE_ROLES=broker,controller, LOGFORGE_SEED_TOPIC=demo-orders:3:600, LOGFORGE_IO_THREADS=1, LOGFORGE_HANDLER_THREADS=2, JAVA_TOOL_OPTIONS as in render.yaml, and the health check path /health. Render provides PORT; do not set it.
Site on Vercel (Hobby, root directory web). Set in Project Settings, Environment Variables, for Production and Preview:
| Variable | Value |
|---|---|
LOGFORGE_ADMIN_URL | the Render service URL, e.g. https://logforge-broker.onrender.com |
LOGFORGE_READ_TOKEN | the same read token as on Render |
Both are server-side only. Never prefix them with NEXT_PUBLIC_, and never give the site the admin token.
| Setting | What is guaranteed | What can be lost |
|---|---|---|
acks=0 | Nothing | Anything; the producer never learns of a failure |
acks=1 | The leader appended the batch (page cache) | Batches the leader acknowledged but no follower copied, if the leader dies (measured 2026-10-27: ReplicationTest, 3 of 3 lost) |
acks=all + min.insync.replicas=2 | Every in-sync replica has the batch before the ack | Nothing, unless every in-sync replica fails at once (measured 2026-10-27: LeaderKillGateTest, 10 leader kills, 1,353,801 acknowledged on Windows and 1,480,001 on Linux, 0 lost; chaos/run-all.sh, five fault scenarios on the Docker cluster, 0 lost) |
| Unclean election (opt-in) | Availability when no in-sync replica survives | Committed records the elected replica never had |
fsync policy (LOGFORGE_FSYNC): the page cache already survives a process crash, because it belongs to the kernel, so a SIGKILL loses nothing acknowledged under any policy. fsync matters only for power loss or a kernel crash.
| Policy | Effect |
|---|---|
never | Highest throughput; a power cut on a single broker can lose roughly the OS flush interval |
ms:1000 (default) | At most about one second of acknowledged writes exposed to a power cut |
records:1 | Flush every batch; safest and by far the slowest (see fsync-records-1 in bench/results) |
A single fixed controller (no consensus), no TLS on the binary protocol and only a shared cluster token for cluster operations (producers and consumers need none; run it on a private network), no zero-copy, no compression, no transactions. The full list is on the site and in docs/DECISIONS.md.