Choose Your Local DB: SQLite, TinyDB, and ChromaDB for Quick-and-Dirty Efficiency


🚀 Introduction
As a developer working across multiple domains—automation, scripting, small apps—I've found that spinning up heavyweight databases is often overkill. But choosing the right local DB can significantly streamline workflows. Over the years, SQLite, TinyDB, and ChromaDB became my go-to trifecta. Here's how I use each, and why I even built a TinyDB viewer to bridge a crucial UX gap.
1. SQLite: Reliable Relational Power
SQLite is the default “SQL anywhere” tool:
Embedded, zero-config – lightweight, in-process C library.
ACID-compliant, supports complex SQL queries and joins.
Ideal use cases: local data caching, proof‑of‑concept apps, data export/import tasks.
Use Case Example:
sqlCopyEditCREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL
);
INSERT INTO users (name, email) VALUES (?, ?);
SELECT * FROM users WHERE name LIKE '%Anirudra%';
💡 Insight: SQLite lets you scale from quick scripts to real apps with schema integrity and SQL flexibility—no server needed.
2. TinyDB: Pythonic NoSQL for Developers
TinyDB is a pure‑Python, schema‑free NoSQL store for JSON-like data github.com+15github.com+15medium.com+15. It's perfect for:
Quick key-value storage.
Document-style prototyping.
Tiny scripts needing minimal dependencies.
pythonCopyEditfrom tinydb import TinyDB, Query
db = TinyDB('db.json')
db.insert({'name':'Alice', 'score':42})
User = Query()
high = db.search(User.score > 40)
🚧 The TinyDB UX Gap
TinyDB lacks a native UI, which can slow you down during debugging or data auditing.
🎉 Introducing: TinyDB Viewer
To fill that gap, I built TinyDB Viewer:
A lightweight web UI for browsing/editing TinyDB JSON files.
Server mode: spin up a viewer with
TinyDB('db.json').runserver()
Interactive view: search, sort, and paginate entries.
Easy integration: ideal during development or debugging phases.
Check it out on GitHub: https://github.com/AnirudraChoudhury/TinyDbViewer 🎯
3. ChromaDB: Your Gateway to Vector Storage
When your app demands vector search—semantic similarity, embeddings, RAG workflows—ChromaDB steps in github.com+2github.com+2github.com+2github.commedium.com+1en.wikipedia.org+1.
Why it matters:
Stores high-dimensional embeddings.
Provides semantic and cosine similarity queries.
Perfect for LLM-powered tools, document retrieval, recommendation systems.
Anatomy of ChromaDB:
Client – in-memory or persistent (
.chroma
folder).Collection – tagged vector + metadata store.
Query Interface – add/query/update/delete vector data.
pythonCopyEditimport chromadb
from chromadb.config import Settings
client = chromadb.Client(Settings(chroma_db_impl="duckdb+parquet",
persist_directory="./vectorstore"))
col = client.get_or_create_collection("my_collection")
col.add(ids=["1"], embeddings=[[0.1, 0.2, ...]], metadata=[{"text":"Hello"}])
results = col.query(query_embeddings=[[0.1,0.2,...]], n_results=5)
📌 Note: I haven’t integrated ChromaDB yet—but it’s next on the roadmap as my vector workloads grow.
4. When to Choose What
Task Type | Local DB | Why It Works |
Relational data, schema, joins | SQLite | Full SQL, ACID, zero setup. |
JSON-like storage, Python-first | TinyDB + Viewer | Easy Python API, no server, UI for quick inspection. |
Vector-based semantic search | ChromaDB | Supports similarity queries, embeddings, metadata. |
✅ Actionable Tips for Developers
Start with SQLite when you need structure, relations, or standard SQL.
Use TinyDB for lightweight JSON storage—enhanced by TinyDB Viewer for debugging.
Adopt ChromaDB when embedding-based search enters your stack (e.g., chatbots, RAG, recommendations).
Combine tools: e.g., SQLite for users, ChromaDB for embeddings, TinyDB for configs or logs.
Share your workflow: I'd love to hear your experiences with TinyDB Viewer—forks, suggestions welcome!
🧠 Conclusion
Every database has its sweet spot. SQLite excels at structured queries and reliability. TinyDB empowers quick Pythonic document storage, supercharged by my TinyDB Viewer. ChromaDB is poised to be my vector-store-of-choice as AI workloads grow. Together, they form a powerful local-stack toolkit for devs and data engineers.
💬 What’s Your Local Toolbox?
Do you use a different local DB or viewer? Have you started experimenting with vector stores like ChromaDB? Share your setup, challenges, or tips in the comments below—and let’s learn together!
Transform your local scripts and apps with the right database. Share this if you found it useful!
Subscribe to my newsletter
Read articles from Anirudra Choudhury directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
