
Unpopular Opinion: You Don't Need a Database for Most Side Projects
Hear Me Out Every side project tutorial starts with "set up PostgreSQL" or "configure MongoDB." But for 90% of side projects , you don't need a database server at all. Here's what I use instead — and why my projects actually ship. Option 1: JSON Files (For <10K Records) import json from pathlib import Path DB_FILE = Path ( " data.json " ) def load (): return json . loads ( DB_FILE . read_text ()) if DB_FILE . exists () else [] def save ( data ): DB_FILE . write_text ( json . dumps ( data , indent = 2 )) # Usage users = load () users . append ({ " name " : " Alice " , " email " : " alice@example.com " }) save ( users ) When it works: Personal tools, config storage, small datasets, prototypes. When it doesn't: Concurrent writes, >10K records, need for queries. Option 2: SQLite (For Everything Else) import sqlite3 db = sqlite3 . connect ( " app.db " ) db . execute ( """ CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL, email TEXT UNIQUE, created_
Continue reading on Dev.to Python
Opens in a new tab




