Web Analytics Made Easy - Statcounter
BaseKV
Sign InSign Up

Knowledge Base

Articles

Thoughts on building reliable infrastructure, database design patterns, and the philosophy behind BaseKV.

Featured

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.

basekv-internalsboltdbarchitectureredisdisk-basedconcurrency
10 min read
Featured

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.

cloudflareworkers kvfree tierlimitscomparisonMay 2026
5 min read
Featured

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.

productdatabasephilosophy
5 min read

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.

usage-meteringkey-valuecountersidempotencyrate-limitingdurabilitybilling
8 min read

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.

b-treelsm-treestorage-enginerocksdbarchitecturekey-value
9 min read

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.

redisvalkeydragonflydbkeydbconcurrencyarchitecture
8 min read

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.

storage-engineamplificationrum-conjectureb-treelsm-treeperformance
8 min read

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.

redisagplvalkeylicensingopen-sourcearchitecture
7 min read

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.

job-queuerediskey-valuebackground-jobsreliabilitystreamsdurability
9 min read

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.

elasticacheawsrediscost-optimizationdisk-basedvalkey
8 min read

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.

basekvredisb-treedata-structureskey-valuestorage-engine
11 min read

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.

basekvsorted-setsredis-compatibleboltdbdata-structuresengineering
10 min read

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.

scanboltdbb-treerediscursorsconsistencyinternals
11 min read

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.

internalsredismemcacheddynamodbprotocolsarchitectureboltdb
11 min read

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.

basekvdurabilitywrite-loopttltransactionsboltdb
11 min read

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.

redisgraphcyphergraphinternalsarchitecturemigration
9 min read

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.

distributed-lockspatternsconcurrencyredisfencing-tokensredlock
8 min read

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.

idempotencypatternswebhooksrediscloudflareconsistency
7 min read

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.

use-casesgame-serversinfrastructurepalworld
7 min read

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.

redisgraphgraphpersistence
6 min read

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.

redisgraphfalkordbmigrationarchitecture
6 min read

Neo4j vs Disk-Based RedisGraph-Style Compatibility

Compare dedicated graph engines with disk-based RedisGraph-style subsets across traversal performance, operations, and migration friction.

neo4jredisgraphcomparison
6 min read

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.

redisgraphmigrationoperations
7 min read

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.

graphperformanceredisgraph
6 min read

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.

agentsci-cdephemeral
4 min read

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.

agentsarchitecturecoordination
5 min read

The Autonomous Cache and Materialization Agent Pattern

Keep expensive downstream computations predictably fast by deploying a dedicated agent to compute derived values automatically.

cachingagentsperformance
5 min read

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.

finopsagentsorchestration
6 min read

Using Agents as Legacy Database Migration Bridges

Migrate from monolithic legacy stores to modern architectures safely using a dedicated autonomous mapping agent.

migrationarchitectureagents
5 min read

Automating Incident Recovery with AI Assistants

System anomalies are inevitable. Learn how autonomous playbooks use persistent KV structures for instant service rehydration.

devopsagentsrecovery
4 min read

Best Practices for Scoping Token APIs for Agents

Stop giving your agents full-access admin tokens. A guide to properly restricting autonomous system privileges.

securityagentsdevops
5 min read

Designing Free-Tier Friendly Autonomous Systems

Architect your AI experiments to fit within tight cloud free tiers and avoid surprise traffic rate limit blocks.

agentscost-savingarchitecture
4 min read

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.

productionagentssecurity
6 min read

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.

tutorialagentsarchitecture
5 min read

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.

aiagentsarchitecture
5 min read

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.

aicost-savingcaching
4 min read

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.

pricingvercelalternative
6 min read

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.

reactnextjsstate
5 min read

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.

aiarchitecturesimplicity
7 min read

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.

edgecloudflarealternative
5 min read

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.

serverlesscomparisonarchitecture
6 min read

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.

startupsindie-hackersweb-dev
4 min read

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.

aisecuritytutorial
5 min read

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.

aidatabasecomparison
6 min read

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.

supabasealternativesimplicity
5 min read

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.

sqliteedgecomparison
6 min read

Managing WebSocket State in Serverless Architectures

Serverless functions and WebSockets are traditionally hard to mix. Learn how a KV store bridges the gap.

websocketsserverlessarchitecture
5 min read

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.

local-firstsyncarchitecture
5 min read

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.

drizzlearchitecturepatterns
6 min read

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.

memcachedpersistencecaching
5 min read

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.

feature-flagsdevopstutorial
5 min read

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.

configurationdevopsarchitecture
5 min read

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.

edgeserverlessperformance
5 min read

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.

sessionssecurityarchitecture
5 min read

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.

nextjstutorialauthentication
6 min read

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.

redisarchitecturecost-saving
6 min read

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.

dynamodbstartupscomparison
5 min read

What is a Serverless Key-Value Database?

Serverless compute needs serverless data. Explore connectionless HTTP APIs and consumption-based pricing models.

serverlesscloudconcepts
5 min read

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.

data-ownershipstrategymigration
4 min read

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.

basicsdatabaseeducation
5 min read

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.

comparisonredisvalkeydragonflydbkeydbarchitecture
8 min read

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.

dynamodbcost-savingalternativecloudflare-kvcloudflare-d1upstash
8 min read

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.

performancepatternsadvanced
5 min read

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.

data-ownershipmigrationstrategy
5 min read

Building with a Simple Key-Value Store

Simplify your stack. How to leverage a simple key-value store for session management, flags, and config.

tutorialdevelopmentsimplicity
5 min read

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.

redissmall-dataalternative
5 min read

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.

use-casesarchitectureexamples
5 min read

Understanding Persistent Key-Value Storage

Persistence is key. Understand the difference between in-memory caches and persistent key-value storage.

persistencestorageconcepts
5 min read

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.

nextjstutorialweb-dev
5 min read

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.

botsdiscordcost-saving
5 min read

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.

dynamodbpricingaws
5 min read

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.

sqlitecomparisonarchitecture
5 min read

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.

redisdevopspersistence
5 min read