fix docs and todo

This commit is contained in:
2026-02-15 11:42:43 -05:00
parent 37b423ce1a
commit ad599a0af7
5 changed files with 53 additions and 3373 deletions

View File

@@ -41,7 +41,7 @@ COMMON_FLAGS := -vet -strict-style
EXTRA_LINKER_FLAGS := $(LIB_PATH) $(SHIM_LIB) $(ROCKSDB_LIBS)
# Runtime configuration
PORT ?= 8000
PORT ?= 8002
HOST ?= 0.0.0.0
DATA_DIR ?= ./data
VERBOSE ?= 0
@@ -191,7 +191,7 @@ help:
@echo " make clean - Remove build artifacts"
@echo ""
@echo "$(GREEN)Run Commands:$(NC)"
@echo " make run - Build and run server (default: localhost:8000)"
@echo " make run - Build and run server (default: localhost:8002)"
@echo " make run PORT=9000 - Run on custom port"
@echo " make dev - Clean, build, and run"
@echo " make quick - Fast rebuild and run"

View File

@@ -101,7 +101,7 @@ export PATH=$PATH:/path/to/odin
### Basic Usage
```bash
# Run with defaults (localhost:8000, ./data directory)
# Run with defaults (localhost:8002, ./data directory)
make run
```
@@ -118,10 +118,10 @@ You should see:
║ ║
╚═══════════════════════════════════════════════╝
Port: 8000 | Data Dir: ./data
Port: 8002 | Data Dir: ./data
Storage engine initialized at ./data
Starting DynamoDB-compatible server on 0.0.0.0:8000
Starting DynamoDB-compatible server on 0.0.0.0:8002
Ready to accept connections!
```
@@ -186,7 +186,7 @@ aws configure
**Create a Table:**
```bash
aws dynamodb create-table \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--key-schema \
AttributeName=id,KeyType=HASH \
@@ -197,13 +197,13 @@ aws dynamodb create-table \
**List Tables:**
```bash
aws dynamodb list-tables --endpoint-url http://localhost:8000
aws dynamodb list-tables --endpoint-url http://localhost:8002
```
**Put an Item:**
```bash
aws dynamodb put-item \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--item '{
"id": {"S": "user123"},
@@ -216,7 +216,7 @@ aws dynamodb put-item \
**Get an Item:**
```bash
aws dynamodb get-item \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--key '{"id": {"S": "user123"}}'
```
@@ -224,7 +224,7 @@ aws dynamodb get-item \
**Query Items:**
```bash
aws dynamodb query \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--key-condition-expression "id = :id" \
--expression-attribute-values '{
@@ -235,14 +235,14 @@ aws dynamodb query \
**Scan Table:**
```bash
aws dynamodb scan \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users
```
**Delete an Item:**
```bash
aws dynamodb delete-item \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--key '{"id": {"S": "user123"}}'
```
@@ -250,7 +250,7 @@ aws dynamodb delete-item \
**Delete a Table:**
```bash
aws dynamodb delete-table \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users
```
@@ -262,7 +262,7 @@ aws dynamodb delete-table \
const { DynamoDBClient, PutItemCommand, GetItemCommand } = require("@aws-sdk/client-dynamodb");
const client = new DynamoDBClient({
endpoint: "http://localhost:8000",
endpoint: "http://localhost:8002",
region: "us-east-1",
credentials: {
accessKeyId: "dummy",
@@ -299,7 +299,7 @@ import boto3
dynamodb = boto3.client(
'dynamodb',
endpoint_url='http://localhost:8000',
endpoint_url='http://localhost:8002',
region_name='us-east-1',
aws_access_key_id='dummy',
aws_secret_access_key='dummy'
@@ -364,8 +364,8 @@ make fmt
### Port Already in Use
```bash
# Check what's using port 8000
lsof -i :8000
# Check what's using port 8002
lsof -i :8002
# Use a different port
make run PORT=9000
@@ -426,7 +426,7 @@ make profile
# Load test
ab -n 10000 -c 100 -p item.json -T application/json \
http://localhost:8000/
http://localhost:8002/
```
## Production Deployment

View File

@@ -55,7 +55,7 @@ sudo apt install librocksdb-dev libsnappy-dev liblz4-dev libzstd-dev libbz2-dev
# Build the server
make build
# Run with default settings (localhost:8000, ./data directory)
# Run with default settings (localhost:8002, ./data directory)
make run
# Run with custom port
@@ -70,7 +70,7 @@ make run DATA_DIR=/tmp/jormundb
```bash
# Create a table
aws dynamodb create-table \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--key-schema AttributeName=id,KeyType=HASH \
--attribute-definitions AttributeName=id,AttributeType=S \
@@ -78,26 +78,26 @@ aws dynamodb create-table \
# Put an item
aws dynamodb put-item \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--item '{"id":{"S":"user123"},"name":{"S":"Alice"},"age":{"N":"30"}}'
# Get an item
aws dynamodb get-item \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--key '{"id":{"S":"user123"}}'
# Query items
aws dynamodb query \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users \
--key-condition-expression "id = :id" \
--expression-attribute-values '{":id":{"S":"user123"}}'
# Scan table
aws dynamodb scan \
--endpoint-url http://localhost:8000 \
--endpoint-url http://localhost:8002 \
--table-name Users
```
@@ -243,7 +243,7 @@ Scan (full table) | 5000 ops | 234.56 ms | 21320 ops/sec
### Environment Variables
```bash
JORMUN_PORT=8000 # Server port
JORMUN_PORT=8002 # Server port
JORMUN_HOST=0.0.0.0 # Bind address
JORMUN_DATA_DIR=./data # RocksDB data directory
JORMUN_VERBOSE=1 # Enable verbose logging
@@ -275,7 +275,7 @@ chmod 755 ./data
Check if the port is already in use:
```bash
lsof -i :8000
lsof -i :8002
```
### "Invalid JSON" errors

23
TODO.md
View File

@@ -12,8 +12,8 @@ This tracks the rewrite from Zig to Odin and remaining features.
- [x] Core types (dynamodb/types.odin)
- [x] Key codec with varint encoding (key_codec/key_codec.odin)
- [x] Main entry point with arena pattern demo
- [x] LICENSE file
- [x] .gitignore
- [x] HTTP Server Scaffolding
## 🚧 In Progress (Need to Complete)
@@ -50,7 +50,7 @@ This tracks the rewrite from Zig to Odin and remaining features.
- Read JSON bodies
- Send HTTP responses with headers
- Keep-alive support
- Options:
- Options (Why we haven't checked this off yet, we need to make sure we chose the right option as the project grows, might make more sense to impliment different option):
- Use `core:net` directly
- Use C FFI with libmicrohttpd
- Use Odin's vendor:microui (if suitable)
@@ -69,6 +69,23 @@ This tracks the rewrite from Zig to Odin and remaining features.
- ADD operations
- DELETE operations
### Replication Support (Priority 4)
- [ ] **Build C++ Shim in order to use RocksDB's WAL replication helpers**
- [ ] **Add configurator to set instance as a master or slave node and point to proper Target and Destination IPs**
- [ ] **Leverage C++ helpers from shim**
### Subscribe To Changes Feature (Priority LAST [But keep in mind because semantics we decide now will make this easier later])
- [ ] **Best-effort notifications (Postgres-ish LISTEN/NOTIFY [in-memory pub/sub fanout. If youre not connected, you miss it.])**
- Add an in-process “event bus” channels: table-wide, partition-key, item-key, “all”.
- When putItem/deleteItem/updateItem/createTable/... commits successfully publish {op, table, key, timestamp, item?}
- [ ] **Durable change streams (Mongo-ish [append every mutation to a persistent log and let consumers read it with resume tokens.])**
- Create a “changelog” keyspace
- Generate a monotonically increasing sequence by using a stable Per-partition sequence cursor
- Expose via an API (I prefer publishing to MQTT or SSE)
## 📋 Testing
- [ ] Unit tests for key_codec
@@ -182,5 +199,5 @@ make test
make run
# Test with AWS CLI
aws dynamodb list-tables --endpoint-url http://localhost:8000
aws dynamodb list-tables --endpoint-url http://localhost:8002
```

File diff suppressed because it is too large Load Diff