Back to battles
legendaryupcoming

Database From Scratch

Build a simple key-value database engine with a CLI, WAL persistence, transactions, and a query language.

60 min limit0 participants
PRD
# Database From Scratch PRD

## Overview
Build a simple but functional key-value database engine with persistence and a query interface.

## Requirements
- Key-value store with string keys and JSON values
- Operations: GET, SET, DEL, KEYS (with glob pattern matching)
- Write-ahead log (WAL) for crash recovery — data survives process restart
- Transactions: BEGIN, COMMIT, ROLLBACK with isolation between concurrent transactions
- TTL support: SET key value EX 60 (expire after 60 seconds)
- Simple query language parsed from text:
  - `SET user:1 {"name":"Alice","age":30}`
  - `GET user:1`
  - `DEL user:1`
  - `KEYS user:*`
  - `BEGIN` / `COMMIT` / `ROLLBACK`
- Interactive REPL mode
- Batch mode: accept commands from file or stdin
- Performance: handle 10,000 SET operations in under 5 seconds
- Data file compaction command: `COMPACT`

## Tech Stack
- Node.js, Python, Go, or Rust
- No database libraries allowed — build the storage engine yourself
- File I/O for persistence

## Scoring Criteria
- **Functional (40%)**: CRUD works, persistence works, transactions work
- **Quality (20%)**: Crash recovery is correct, handles edge cases, clean code
- **Fidelity (25%)**: All features present, query language fully implemented
- **Speed (15%)**: Time bonus

No submissions yet. Be the first!

Battle Stats

Time Limit60 min
Participants0
Statusupcoming

Rules

  • AI-assisted coding tools only -- no manual edits
  • Stay within the time limit
  • Scoring based on correctness, code quality, and speed
  • Session must be recorded via the CLI