Knowledge Base
Articles
Thoughts on building reliable infrastructure, database design patterns, and the philosophy behind BaseKV.
The Bet on a Disk-Based Redis: Why BaseKV Puts Data on Disk
Part 1 of the BaseKV internals series: why a disk-based Redis on BoltDB, the one-file two-bucket layout, and the read-fan-out, single-writer concurrency model.
Cloudflare Workers KV Limits 2026: What Hit, What Bit, and the Cheaper Drop-In
100,000 reads per day, 1,000 writes per day, 1 GB storage, hard caps with no throttling. The 100:1 read/write asymmetry decides whether you stay on the free tier or migrate. Numbers and decision rules for May 2026.
Why BaseKV Exists
A clear look at the gap between Redis and DynamoDB, and why small-to-mid scale workloads deserve infrastructure that stays predictable.
Usage Metering on a Key-Value Store: Counters, Idempotency, and When You Outgrow It
A usage counter is a single key and an atomic increment - exactly what KV is fastest at. The counter patterns that work (month-to-date totals, idempotency keys that stop retries double-billing, TTL rate-limit windows, pre-aggregated rollups), why disk-first persistence matters so counters are never evicted, and the honest line where a counter stops being enough and you need a purpose-built meter with an audit trail.
LSM-Tree vs B-Tree: How Key-Value Storage Engines Actually Differ (2026)
RocksDB and Cassandra are LSM-trees; LMDB, etcd, SQLite, and BaseKV are B-trees. The same GET/PUT interface hides two opposite machines. What each optimizes, the amplification tradeoffs, and which fits your workload on modern NVMe.
Single-Threaded vs Multi-Threaded Key-Value Stores: Redis, Valkey, Dragonfly, KeyDB (2026)
Redis executes commands on one thread on purpose; DragonflyDB and KeyDB use every core. What single-threaded design buys (free atomicity, predictable latency), how shared-nothing differs from locked multi-threading, and why thread count is the wrong axis for a disk-bound store.
Read, Write, and Space Amplification: The Three Costs Every Key-Value Store Trades
Every storage engine pays for speed in extra reads, extra writes, or extra space. Define the three amplifications, the RUM conjecture that says you can only minimize two, how LSM-trees and B-trees spend differently, and how to read past any benchmark.
Does AGPL Redis Force You to Open Source Your App? The 2026 Answer
Redis 8 defaults to AGPLv3 after the 2024 SSPL relicense and Valkey fork. What the network clause actually requires, when it bites, and how to pick a store.
Using a Key-Value Store as a Job Queue (and When It Bites)
Why a naive BRPOP list queue silently loses jobs when workers crash, the reliable BLMOVE two-list and Redis Streams consumer-group patterns that fix it, and when to stop hand-rolling.
Your ElastiCache Bill Is Huge: How to Actually Cut It in 2026
Why AWS ElastiCache gets expensive in 2026: node-hours, inter-AZ transfer, Extended Support premiums, and the disk-first fix that cuts the biggest line item.
Fitting Redis Data Types into a B+tree
How BaseKV encodes strings, sets, hashes, lists, and streams onto a single ordered B+tree using composite keys and prefix range scans, with no per-collection headers.
Sorted Sets on Disk, and an Honest Trade-Off
How BaseKV stores ZADD scores as float64 bits, why IEEE-754 is not byte-sortable, and the honest in-RAM sort behind ZRANGE and ZRANK.
BaseKV Internals: SCAN Cursors over a Live B+tree
How BaseKV implements Redis SCAN on a BoltDB B+tree: an opaque random cursor backing a server-side session, a multi-phase walk across type buckets, and per-call snapshots.
BaseKV Internals: Three Protocols, One File
How one BoltDB file serves Redis RESP, the Memcached text protocol, and a DynamoDB HTTP subset, all funneling through one write loop with protocol-isolated key namespaces.
BaseKV Internals: Durability, the Write Loop, and TTL
How BaseKV makes writes durable through one single-writer goroutine, runs MULTI/EXEC atomically, and expires keys with lazy reads, a heap, and a background sweeper.
BaseKV Internals: A RedisGraph Subset on a KV Engine
How BaseKV layers a property graph and a Cypher subset on one B+tree, the GRAPH.* commands, and an honest account of what works and what does not.
Distributed Locks with a Key-Value Store: The Safe Pattern and Where It Breaks
How to build a distributed lock on a KV store: the atomic SET NX PX acquire, the compare-and-delete release that stops you stealing another holder's lock, and why a stalled holder defeats any TTL. Plus when you need fencing tokens versus when a single-instance lock is fine.
Idempotency Keys with a Key-Value Store: The Atomic Claim Everyone Gets Wrong
How to implement idempotency keys on a KV store: the record you actually store, the read-then-write race that double-charges cards, and why the atomic claim (Redis SET NX) is the whole game. Plus where Cloudflare Workers KV's eventual consistency breaks the guarantee.
Key-Value Storage for Multiplayer Game Server Backends
Multiplayer game servers need persistent state for player profiles, ban lists, server configs, and world metadata. Why key-value databases are the right shape, with patterns from Palworld, Valheim, and friends.
Disk-Based Redis With RedisGraph Compatibility
How disk-based Redis engines implement old RedisGraph-style commands, what compatibility means in practice, and where this model fits.
RedisGraph Deprecated (2026): Migration Guide to FalkorDB & Alternatives
RedisGraph EOL migration paths for 2026: FalkorDB (the official successor), Neo4j for full graph DB, or a KV-backed subset for simpler workloads.
Neo4j vs Disk-Based RedisGraph-Style Compatibility
Compare dedicated graph engines with disk-based RedisGraph-style subsets across traversal performance, operations, and migration friction.
Migrating Legacy GRAPH.QUERY Workloads Without a Full Rewrite
Step-by-step guidance for moving old RedisGraph query workloads to a disk-based compatibility subset with lower risk.
Why Graph Traversal Performance Drops on Disk-Backed RedisGraph Subsets
A plain-language explanation of why traversal-heavy graph queries slow down on disk-backed compatibility engines and how to mitigate it.
Ephemeral Environment Provisioning for AI Agents
Learn how autonomous agents can spin up short-lived database environments for test runs or preview pipelines using BaseKV.
Multi-Agent Systems Need a Shared State Backend
Why complex workflows with multiple LLM actors require a fast, persistent key-value store to coordinate securely without step loss.
The Autonomous Cache and Materialization Agent Pattern
Keep expensive downstream computations predictably fast by deploying a dedicated agent to compute derived values automatically.
Budget-Aware Agent Orchestration in the Cloud
Autonomous systems can quickly drain your wallet. Here is how budget-aware agents use quota APIs to govern limits.
Using Agents as Legacy Database Migration Bridges
Migrate from monolithic legacy stores to modern architectures safely using a dedicated autonomous mapping agent.
Automating Incident Recovery with AI Assistants
System anomalies are inevitable. Learn how autonomous playbooks use persistent KV structures for instant service rehydration.
Best Practices for Scoping Token APIs for Agents
Stop giving your agents full-access admin tokens. A guide to properly restricting autonomous system privileges.
Designing Free-Tier Friendly Autonomous Systems
Architect your AI experiments to fit within tight cloud free tiers and avoid surprise traffic rate limit blocks.
Production Guardrails for Agentic Workflows
Before you take your agent into production, here are the absolute mandatory guardrails you must establish over the data plane.
A Practical Starter Blueprint for AI Agents
Ready to build your first autonomous system with state? Combine an orchestrator, a shared context KV, and fallback logic.
Why AI Agents Need a Simple Key-Value Store for Memory
LLMs combined with tools are powerful, but they need long-term memory. See how KV stores solve the AI agent state problem.
Caching LLM Responses: Reduce OpenAI Bills with a KV Store
Stop paying for the exact same LLM generations. Learn how to implement semantic and exact caching using a serverless key-value base.
Vercel KV Pricing Got You Down? Here is an Alternative
Vercel KV is convenient, but the pricing scales aggressively. Compare the costs and see when it's time to migrate off.
Managing State in Next.js React Server Components with a KV DB
RSCs change how we think about state. Learn how to persist session and user state safely across server component renders.
Shared State for Multi-Agent Workflows: Why SQL is Overkill
When multiple autonomous agents communicate, they need a blackboard to share state. SQL is too heavy; KV is just right.
Cloudflare Workers KV Alternatives in 2026: Persistent KV with Predictable Pricing
Cloudflare Workers KV alternatives for 2026: BaseKV, Upstash Redis, Deno KV, DynamoDB Global. Tradeoffs and when each fits.
Upstash Redis vs Persistent KV Stores for Serverless
Redis API over HTTP is great, but do you actually need Redis? Compare serverless Redis with simple persistent KV stores for modern apps.
The Lean Indie Hacker Tech Stack for 2026
Build fast and keep costs at zero. Why Next.js, Tailwind, and a Simple KV Database are the meta for shipping quickly.
Building a Global Rate Limiter for Your OpenAI Wrapper
Stop abuse on your AI SaaS. Step-by-step logic for implementing token bucket rate limiting using a key-value store.
Do You Really Need a Vector DB, or Just a KV Store?
Pinecone and Milvus are powerful, but complex. Discover how a simple KV store can handle basic embedding lookups and meta-data.
When Supabase is Too Complex: A Lightweight Alternative
Postgres and Row Level Security are incredible tools, but sometimes you just need to store a single JSON object per user.
Turso SQLite vs Serverless KV Stores: Which for Edge Apps?
SQLite at the edge is popular via Turso. Compare the developer experience of edge SQL with a pure KV API.
Managing WebSocket State in Serverless Architectures
Serverless functions and WebSockets are traditionally hard to mix. Learn how a KV store bridges the gap.
Building Local-First Apps: Syncing State to a KV Cloud
Local-first development using indexedDB or local SQLite is surging. See how a KV store simplifies cloud synchronization.
Hybrid Data: Using Drizzle ORM Relational + KV Store
Use Postgres for your core relational logic, and a KV store for volatile data like sessions, flags, and caches.
Memcached Alternative with Persistent Storage
Love the speed of Memcached but hate losing data on restart? Discover how persistent key-value stores solve the volatility problem.
Simple Feature Flags Implementation with Key-Value Store
Don't pay for expensive SaaS feature flags. Build your own robust toggle system using a simple persistent key-value store.
Dynamic App Config in 2026: KV Store vs .env, Consul & Vercel KV (Pick One in 5 Minutes)
Compare KV-store-based config to .env files, HashiCorp Consul, AWS AppConfig and Vercel KV — when each one wins, latency benchmarks, and a 5-minute switchover for Next.js, Go and Python services.
Edge Caching with Key-Value Store for Global Performance
Your edge functions need data close by. Learn why HTTP-based key-value stores are the perfect companion for serverless edge compute.
Why Session Storage Needs Persistence
In-memory sessions are a ticking time bomb. Learn why persistent storage is critical for keeping your users logged in.
Next.js 15 Persistent Sessions in 2026: Redis vs Vercel KV vs BaseKV (with App Router Code)
Build secure persistent sessions in Next.js 15 App Router. Compare Redis, Vercel KV and BaseKV on price, latency and cold-start behavior — full server-action code, edge runtime caveats, and CSRF patterns.
Disk-Backed Redis Alternative Explained
Understand the architecture of disk-backed key-value stores and when to choose them over pure in-memory Redis to save costs.
DynamoDB Alternative for Small Workloads
DynamoDB is great for scale, but heavy for startups. Explore simpler, cheaper key-value alternatives for small-to-medium datasets.
What is a Serverless Key-Value Database?
Serverless compute needs serverless data. Explore connectionless HTTP APIs and consumption-based pricing models.
Key-Value Store Export Data & No Vendor Lock-In
Don't let your data be held hostage. Why JSON/Parquet export capabilities are the most important feature to look for.
Key-Value Database Explained (2026): DynamoDB vs Redis vs BaseKV — When to Pick Which
How a key-value database actually works in 2026, with side-by-side DynamoDB, Redis, RocksDB and BaseKV — latency, durability, pricing, and the schema decisions teams regret two years in.
Key-Value Store vs Redis in 2026: Valkey Fork, Disk-First Alternatives, Decision Tree
Redis vs Valkey vs DragonflyDB vs KeyDB after the 2024 license fork, plus the disk-first category (BaseKV, RocksDB-backed) that solves the RAM-cost problem none of the forks address. Real 2026 benchmark numbers and a five-question decision tree.
Cheap DynamoDB Alternatives in 2026: Cloudflare KV, D1, Upstash, BaseKV
DynamoDB on-demand is cheaper than people think after the Nov 2024 50% cut, but the failure modes (Scan trap, GSI multiplication, DDOS exposure) still bite. 2026 prices and tradeoffs across Cloudflare KV, D1, Upstash, and disk-backed BaseKV — with a worked 50M-read example.
Materialized Views Use Cases with Key-Value Storage
Learn how to use key-value storage to cache materialized views and improve your database read performance.
Export Data vs Vendor Lock-In: Why It Matters
Why data portability is crucial. Ensure your key-value store allows you to easily export your data.
Building with a Simple Key-Value Store
Simplify your stack. How to leverage a simple key-value store for session management, flags, and config.
The Best Redis Alternative for Small Datasets
Don't pay for RAM you don't use. Discover the best Redis alternatives for projects with smaller datasets.
Top 5 Key-Value Database Use Cases
From session caching to shopping carts. Explore the top 5 most common and effective use cases for KV stores.
Understanding Persistent Key-Value Storage
Persistence is key. Understand the difference between in-memory caches and persistent key-value storage.
Using a Key-Value Store with Next.js App Router
A complete guide to integrating a remote key-value store with Next.js 15 App Router. Server actions, caching, and persistence explained.
Best Cheap Database Hosting for Discord Bots
Building a bot? Don't overpay for a massive SQL database. Here is why a key-value store is the perfect, low-cost choice for bot state and user configs.
DynamoDB On-Demand Pricing: Hidden Costs Explained
DynamoDB's free tier looks generous, until it isn't. We break down the read/write unit costs and show where the surprise bills come from.
SQLite vs Key-Value Store: Better for Web Apps?
SQLite is amazing, but managing the file in a serverless environment is a pain. Compare it with a dedicated key-value service API.
Redis Persistence is Hard: A Simpler Alternative
AOF? RDB? Snapshots? If you just want your data to stay saved, configuring Redis persistence is surprisingly complex. There is an easier way.