πŸ—„οΈ Recipedia β€” Database Integration Report

Current Architecture

Recipedia is a static HTML/CSS/JS site deployed on Netlify (free tier). Data is currently stored as:

Current Limitations

Problem Impact
Recipes hardcoded in JS Adding/editing requires code changes and redeployment
localStorage is per-device Products don’t sync across devices/browsers
No user accounts No personalization or saved preferences
No admin panel Content management requires developer access
5 MB localStorage limit Sufficient for now, but limits future growth

Netlify Free Tier Context

Any solution must work within Netlify’s free plan:

Resource Limit
Bandwidth 100 GB/month
Build minutes 300/month
Serverless functions 125,000 invocations/month
Edge functions 1M requests/month
Storage 10 GB

[!IMPORTANT] Netlify deploys static sites. Server-side databases (MySQL, PostgreSQL on your own server) require a separate backend or a serverless/BaaS approach.


Option Comparison Matrix

Feature IndexedDB Netlify DB (Neon) Firebase Firestore Supabase Turso MongoDB Atlas
Type Client-side Serverless PostgreSQL NoSQL Document DB PostgreSQL BaaS Edge SQLite NoSQL Document DB
Free tier βœ… Unlimited βœ… Yes βœ… Spark Plan βœ… Yes βœ… Yes βœ… Yes
Setup complexity 🟒 Easy 🟑 Medium 🟑 Medium 🟑 Medium 🟑 Medium 🟑 Medium
Cross-device sync ❌ No βœ… Yes βœ… Yes βœ… Yes βœ… Yes βœ… Yes
Offline support βœ… Full ❌ No βœ… Built-in ❌ No ❌ No ❌ No
Realtime updates ❌ No ❌ No βœ… Built-in βœ… Built-in ❌ No βœ… Change Streams
Auth built-in ❌ No ❌ No βœ… Firebase Auth βœ… GoTrue Auth ❌ No ❌ No
Netlify integration N/A βœ… Native 🟑 Via SDK 🟑 Via SDK βœ… Plugin 🟑 Via SDK
Requires backend ❌ No βœ… Netlify Functions ❌ Direct from client ❌ Direct from client βœ… Netlify Functions βœ… Backend needed
Query language JS API SQL NoSQL (queries) SQL SQL MongoDB Query
Best for Offline-first Full SQL power Real-time apps Full-stack apps Edge performance Flexible schemas

Detailed Analysis

1. 🟒 IndexedDB (Client-Side Upgrade)

What: Built-in browser database β€” a powerful upgrade over localStorage without any external services.

Free tier: Unlimited (it’s a browser API).

Metric Value
Storage limit 50 MB – several GB (browser dependent)
Data types Objects, arrays, blobs, files
Querying Indexes, ranges, cursors
Sync ❌ Local only

Strengths: - Zero cost, zero setup, zero external dependencies - Works offline by default - Supports structured data (objects, not just strings) - Much larger storage than localStorage (GB vs 5 MB) - No API keys or accounts needed - Keeps the app fully static β€” perfect for Netlify

Weaknesses: - Data stays on one device/browser β€” no cross-device sync - No admin panel β€” recipes still managed in code - More complex API than localStorage (consider using Dexie.js wrapper) - Users lose data if they clear browser storage

Integration effort: 🟒 Low β€” replace localStorage calls with IndexedDB via Dexie.js

[!TIP] Best if you want a quick improvement without adding any backend complexity. Ideal as a stepping stone β€” migrate products to IndexedDB now, add a cloud database later.


2. πŸ”΅ Netlify DB (Powered by Neon PostgreSQL)

What: Netlify’s native serverless PostgreSQL database, powered by Neon. One-click setup from the Netlify dashboard.

Free tier limits:

Resource Limit
Storage 512 MB
Compute 0.25 vCPU, shared
Branches 1
Projects 1

Strengths: - Native Netlify integration β€” one-click provisioning, auto-connects to Netlify Functions - Full PostgreSQL β€” relations, joins, constraints, full SQL power - Serverless with auto-scaling and auto-suspend when idle - No cold starts on free tier - Great for structured data (recipes, categories, users) - Can use ORMs like Prisma or Drizzle

Weaknesses: - Requires Netlify Functions as middleware (client β†’ function β†’ DB) - 512 MB storage limit on free tier - No built-in auth (need to add separately) - No realtime subscriptions - No offline support - Slightly more complex architecture

Integration effort: 🟑 Medium β€” need to create Netlify Functions as API endpoints

Client (JS) β†’ Netlify Function (API) β†’ Neon PostgreSQL

[!TIP] Best if you want to stay 100% within the Netlify ecosystem and need proper relational data modeling.


3. 🟠 Firebase Firestore

What: Google’s NoSQL cloud database with real-time sync, offline support, and built-in authentication.

Free tier limits (Spark Plan):

Resource Daily/Monthly Limit
Storage 1 GiB
Document reads 50,000/day
Document writes 20,000/day
Document deletes 20,000/day
Outbound transfer 10 GiB/month

Strengths: - Offline support built-in β€” cached data works without internet - Realtime listeners β€” instant UI updates when data changes - Firebase Auth β€” Google, email, anonymous auth out of the box - Direct client-side access (no backend needed) - Generous free tier for a recipe app - Excellent documentation and community - Easy to add push notifications, analytics, hosting

Weaknesses: - NoSQL data model β€” no joins, denormalization required - Complex queries are limited (no full-text search, no OR queries across fields) - Vendor lock-in (Google ecosystem) - Pricing can spike unexpectedly if reads/writes grow - Feb 2026: Cloud Storage requires Blaze plan (pay-as-you-go) even for free usage - Document-oriented structure may feel unnatural for relational recipe data

Integration effort: 🟑 Medium β€” add Firebase SDK, refactor data access layer

Client (JS) β†’ Firebase SDK β†’ Firestore (direct)

[!TIP] Best if you want offline support + realtime sync + auth in one package. Ideal for a recipe app where users might browse recipes without internet.


4. 🟣 Supabase

What: Open-source Firebase alternative built on PostgreSQL. Offers database, auth, storage, realtime, and edge functions.

Free tier limits:

Resource Limit
Database storage 500 MB
Auth users (MAU) 50,000
File storage 1 GB
Egress 2-5 GB
API requests Unlimited
Active projects 2

Strengths: - Full PostgreSQL β€” SQL joins, constraints, views, functions - Built-in auth (email, OAuth, magic links) - Realtime subscriptions over WebSocket - Row-Level Security (RLS) for fine-grained access control - Auto-generated REST and GraphQL APIs - Open-source β€” no vendor lock-in, can self-host - Direct client-side access via supabase-js SDK - Dashboard with SQL editor and table viewer

Weaknesses: - Auto-pause after 7 days of inactivity on free tier ⚠️ - 500 MB storage limit - No built-in offline support - 2 project limit on free tier - Can be complex to set up RLS properly - Community-only support on free tier

Integration effort: 🟑 Medium β€” add Supabase SDK, create tables, set up RLS

Client (JS) β†’ Supabase SDK β†’ PostgreSQL (direct via API)

[!WARNING] The 7-day inactivity auto-pause is a dealbreaker for production apps. Your database will go offline if no one visits for a week, causing downtime until manually restored.

[!TIP] Best if you want full SQL power + auth + realtime without vendor lock-in. Consider the Pro plan ($25/month) if this becomes a production app.


5. 🟀 Turso (Edge SQLite)

What: Distributed SQLite database at the edge, built on libSQL. Data is stored close to users for low latency.

Free tier limits (as of March 2025):

Resource Limit
Rows read 500M/month
Rows written 10M/month
Storage 5 GB
Databases 100
Point-in-time restore 1 day

Strengths: - SQLite-compatible β€” familiar, simple SQL - Edge-hosted β€” extremely low latency - Generous free tier (5 GB, 500M reads) - No cold starts - Lightweight and fast - Embedded database model (libSQL) β€” can also run locally - Good Netlify integration via plugin

Weaknesses: - Requires Netlify Functions as middleware - No built-in auth - No realtime subscriptions - No offline client-side caching - Relatively newer service β€” smaller community - Edge replication removed from free tier

Integration effort: 🟑 Medium β€” set up Turso CLI, create DB, use via Netlify Functions

[!TIP] Best if you want the simplicity of SQLite with cloud distribution and great performance. The 5 GB free storage is the most generous among SQL options.


6. ⚫ MongoDB Atlas

What: Managed MongoDB cloud database with a free tier (M0 Shared cluster).

Free tier limits:

Resource Limit
Storage 512 MB
Shared RAM 512 MB
Connections 500
Collections No limit

Strengths: - Flexible document model β€” perfect for varied recipe structures - Schema-less β€” different recipes can have different fields - Full-text search via Atlas Search - Change Streams for realtime updates - Large ecosystem and community - Aggregation pipeline for complex queries

Weaknesses: - Requires a backend β€” cannot safely expose connection strings to the client - No built-in auth (need separate service) - NoSQL β€” no joins, requires denormalization or $lookup - M0 free tier has limited performance - No offline support - Vendor lock-in concerns

Integration effort: πŸ”΄ Higher β€” need Netlify Functions + MongoDB driver + connection management

Client (JS) β†’ Netlify Function β†’ MongoDB Atlas

πŸ† Recommendation Matrix

Scenario Recommended Option Why
Keep it simple, no backend IndexedDB (Dexie.js) Zero cost, zero setup, upgrade from localStorage
Stay in Netlify ecosystem Netlify DB (Neon) Native integration, full SQL, one-click setup
Offline + auth + realtime Firebase Firestore Best all-in-one BaaS, offline-first
Full SQL + open-source Supabase PostgreSQL + auth + realtime, no vendor lock-in
Best free tier storage Turso 5 GB free, edge performance
Flexible schema MongoDB Atlas Schema-less documents, full-text search

Phase 1: Quick Win (No Backend)

Upgrade localStorage to IndexedDB using Dexie.js: - Products get structured storage (~GB capacity) - Recipes stay in recipes.js (still works offline) - Zero cost, zero external dependencies

Phase 2: Cloud Database (When Ready)

Choose one based on priorities:

Priority Go With
Simplest Netlify integration Netlify DB
Offline browsing + auth Firebase
SQL + open-source + auth Supabase (but watch auto-pause)
Maximum free storage Turso

Phase 3: Full Features (Future)


Architecture Diagrams

Current Architecture

graph LR
    A[Browser] -->|Static Files| B[Netlify CDN]
    A -->|Products| C[localStorage]
    B -->|recipes.js| A

With Cloud Database

graph LR
    A[Browser] -->|API Calls| B[Netlify Functions]
    B -->|SQL/NoSQL| C[Cloud Database]
    A -->|Static Files| D[Netlify CDN]
    A -->|Cache| E[IndexedDB]
    C -->|Recipes, Products| B

With Firebase (Direct)

graph LR
    A[Browser] -->|Firebase SDK| B[Firestore]
    A -->|Static Files| C[Netlify CDN]
    A -->|Offline Cache| D[IndexedDB auto]
    B -->|Realtime Sync| A

πŸ–₯️ Part 2: Lightweight Server-Side Databases & Hosting Platforms

This section focuses on self-hosted lightweight backends β€” solutions where you run your own small server with an embedded or lightweight database, and the platforms where you can host them for free or cheaply.

[!NOTE] Unlike Part 1’s BaaS options (Firebase, Supabase), these give you full control over the backend and data. The trade-off is more responsibility for hosting and maintenance.


Lightweight Backend Frameworks

These are all-in-one solutions that bundle a database + API + auth + admin panel in a lightweight package.

1. πŸ† PocketBase

What: A single Go binary (~15 MB) that includes SQLite, REST API, realtime subscriptions, auth, file storage, and an admin dashboard. Drop it on a server and you have a full backend.

Feature Details
Language Go
Database Embedded SQLite
Binary size ~15 MB
Auth Email/password, OAuth2 (Google, GitHub, etc.)
API Auto-generated REST + Realtime (SSE)
Admin UI βœ… Built-in web dashboard
License MIT (100% free, open-source)
File storage Local or S3-compatible

Strengths: - Absurdly simple β€” download one file, run it, done - Zero dependencies β€” no Node.js, no Docker, no runtime needed - Built-in auth with OAuth2 providers - Admin dashboard for managing collections (tables) and data - Realtime subscriptions via Server-Sent Events - Filterig, sorting, pagination, expand relations β€” all via URL params - SQLite is fast and reliable for read-heavy apps - Can extend with Go hooks if needed - Tiny resource footprint β€” runs on 256 MB RAM VPS easily

Weaknesses: - SQLite = single-writer bottleneck (fine for <10,000 concurrent users) - No horizontal scaling (single server only) - Smaller community than Strapi/Directus - No cloud functions or serverless model - Backup = copy the SQLite file (simple but manual)

Best for Recipedia: βœ… Excellent fit. A recipe app with products + translations is well within PocketBase’s sweet spot. You get auth, admin UI, and realtime β€” all from a 15 MB binary.


2. πŸ“¦ Directus

What: Open-source data platform that wraps any existing SQL database with an instant REST/GraphQL API and a rich admin app.

Feature Details
Language Node.js (TypeScript)
Database PostgreSQL, MySQL, MariaDB, SQLite, MS SQL, OracleDB, CockroachDB
Auth Built-in (email, OAuth2, LDAP, SAML)
API Auto-generated REST + GraphQL
Admin UI βœ… Rich, polished dashboard
License Free self-host (BSL for orgs >$5M revenue)
Plugins Flows (automation), Extensions

Strengths: - Works with any SQL database β€” plug it into existing PostgreSQL, MySQL, etc. - Most polished admin UI of the three - Granular role-based permissions - Automation flows (like Zapier inside your backend) - REST + GraphQL simultaneously - Strong TypeScript SDK - Large community and extensive docs

Weaknesses: - Heavier than PocketBase β€” requires Node.js runtime (~200-400 MB RAM) - Slower to set up (npm install, configure DB, environment vars) - Self-hosting is more involved - Overkill for small projects - The BSL license limits commercial use for large companies

Best for Recipedia: 🟑 Possible but overkill. Would shine if you later need multi-user content management or editorial workflows.


3. πŸš€ Strapi

What: Popular headless CMS built on Node.js with a content-type builder, admin panel, and plugin system.

Feature Details
Language Node.js (TypeScript)
Database PostgreSQL, MySQL, MariaDB, SQLite
Auth Built-in (Users & Permissions plugin)
API REST + GraphQL (via plugin)
Admin UI βœ… Content-type builder + data manager
License MIT (Community Edition)
Cloud Strapi Cloud free tier (limited)

Strengths: - Visual content-type builder β€” define your recipe schema via the UI - Largest community and plugin ecosystem - Media library for recipe images - Internationalization (i18n) plugin built-in β€” great for BG/EN/FR - Strapi Cloud offers a free plan (2,500 API requests/month) - Excellent for content-heavy apps

Weaknesses: - Heaviest of the three β€” minimum 512 MB RAM, ideally 1 GB+ - Slow startup time (~10-30 seconds) - Node.js dependency - Strapi Cloud free tier is very limited (500 DB entries, 2,500 requests/month) - Self-hosting requires managed DB or local SQLite - Can be complex to customize deeply

Best for Recipedia: 🟑 Good if you want a CMS-like experience with i18n built-in, but resource-heavy for a simple recipe app.


Lightweight Backend Comparison

Feature PocketBase Directus Strapi
Setup time 🟒 2 minutes 🟑 15-30 min 🟑 15-30 min
Min RAM 128-256 MB 256-512 MB 512 MB - 1 GB
Dependencies None Node.js Node.js
Admin UI quality Good Excellent Excellent
Auth built-in βœ… βœ… βœ…
Realtime βœ… SSE βœ… WebSocket ❌ (via plugin)
i18n ❌ Manual βœ… Built-in βœ… Built-in
Database SQLite only Any SQL PostgreSQL/MySQL/SQLite
API style REST REST + GraphQL REST + GraphQL
File storage βœ… Local/S3 βœ… Local/S3/Cloud βœ… Local/S3/Cloud
Horizontal scale ❌ βœ… βœ…
Best for Small-medium apps Data platforms Content-heavy CMS

Lightweight Databases (Stand-alone)

If you prefer to use a lightweight database without a framework like PocketBase, here are the options:

Database Type Storage Model Best For
SQLite Relational (SQL) Single file Small apps, embedded, prototyping
PostgreSQL Relational (SQL) Client-server Apps that may grow, complex queries
MariaDB/MySQL Relational (SQL) Client-server Traditional web apps, WordPress-like
LiteFS Distributed SQLite Replicated file Multi-region SQLite on Fly.io
DuckDB Analytical (SQL) In-process Analytics, OLAP queries

For Recipedia, SQLite (via PocketBase or Turso) or PostgreSQL (via managed services) are the most relevant choices.


Free Hosting Platforms

Where to host your lightweight backend for free (or nearly free):

1. 🟒 PocketHost (PocketBase-specific)

Feature Details
Free tier βœ… Yes β€” 1 project, always free
What it does Managed PocketBase hosting β€” zero config
Storage 100 MB on free tier
URL pockethost.io
Cold starts None β€” always running
Auto-pause ❌ No β€” always available

Why it’s great: Deploy PocketBase in 30 seconds. No Docker, no VPS, no config. Just sign up and you get a PocketBase instance with a URL. Perfect for prototyping and small apps.

Limitation: 100 MB storage on free tier, but more than enough for a recipe app.


2. πŸ”΅ Render

Feature Details
Free tier βœ… Web services (spin down after 15 min inactivity)
Database Free PostgreSQL (expires after 90 days)
RAM 512 MB
Storage Ephemeral (lost on restart for free tier)
Docker support βœ…

Strengths: - Simple deploy from Git or Docker - Free PostgreSQL database (90-day limit) - Good for Node.js apps (Strapi, Directus) - Auto-deploy on git push

Weaknesses: - Free services spin down after 15 min β†’ cold starts of 30-60 seconds - Free PostgreSQL deleted after 90 days - No persistent disk on free tier - Not ideal for PocketBase (SQLite needs persistent disk)

[!WARNING] The 90-day database expiry and spin-down behavior make Render’s free tier unsuitable for always-on production apps.


3. 🟠 Railway

Feature Details
Free tier ❌ No permanent free tier
Trial $5 credit for 30 days
Hobby plan $5/month + usage
Database One-click PostgreSQL, MySQL, MongoDB, Redis
Docker βœ…

Strengths: - One-click database provisioning - Very developer-friendly UI - Easy deploy from Git - Good networking between services

Weaknesses: - No permanent free tier β€” trial credits only - $5/month minimum after trial - Can be cost-effective though ($5 covers most hobby apps)


4. 🟀 Fly.io

Feature Details
Free tier Limited (trial credits, no permanent free VMs)
Trial 2 hours VM runtime or 7 days
Hobby plan Pay-as-you-go (~$2-5/month for small apps)
Persistent storage 3 GB free for Postgres
Docker βœ…
Edge deployment βœ… Global regions

Strengths: - Deploy globally (multiple regions) - LiteFS for distributed SQLite - Great for PocketBase deployments - Very fast networking

Weaknesses: - No real free tier for new users (2025+) - Requires credit card - More complex CLI-based deployment - Usage-based pricing can be unpredictable


5. 🟣 Oracle Cloud Free Tier (Always Free)

Feature Details
Free tier βœ… Always Free β€” no time limit
VMs 2 AMD VMs (1 GB RAM each) or 4 ARM VMs (24 GB RAM total!)
Storage 200 GB block storage
Database 2 Autonomous Databases (20 GB each)
Networking 10 TB/month outbound

Strengths: - Genuinely free forever β€” not a trial - ARM instances are incredibly generous (up to 24 GB RAM) - 200 GB storage β€” more than any other free tier - Full VMs β€” run anything (PocketBase, Docker, PostgreSQL) - Autonomous Database (managed Oracle DB) included

Weaknesses: - Signup can be difficult (rejections common) - Oracle Cloud UI is complex - Requires VPS management knowledge (SSH, firewall, etc.) - Idle VMs may be reclaimed (controversial policy) - Smaller community for web dev use cases

[!TIP] If you can get an Oracle Cloud account, the ARM free tier is absurdly powerful β€” you could run PocketBase, PostgreSQL, and a full Node.js app simultaneously with 24 GB RAM.


Hosting Platform Comparison

Platform Free Tier Persistent Disk Always On Best For
PocketHost βœ… 100 MB βœ… βœ… PocketBase projects
Render βœ… (spins down) ❌ Free tier ❌ (15 min) Node.js apps (Strapi/Directus)
Railway ❌ ($5 trial) βœ… βœ… Quick prototyping
Fly.io ❌ (trial only) βœ… 3 GB βœ… Global edge deployment
Oracle Cloud βœ… Always free βœ… 200 GB βœ… Full VM control
Netlify βœ… (static + functions) ❌ N/A Static sites + serverless

🎯 Final Recommendation for Recipedia

Approach Stack Cost Complexity
πŸ₯‡ Easiest PocketBase on PocketHost $0 🟒 Very Low
πŸ₯ˆ Most powerful free PocketBase on Oracle Cloud ARM $0 🟑 Medium (VPS setup)
πŸ₯‰ Netlify-native Netlify DB (Neon PostgreSQL) $0 🟑 Medium
4th PocketBase on Fly.io ~$2-5/month 🟑 Medium
5th Strapi on Render $0 (with limitations) πŸ”΄ Higher

Why PocketBase + PocketHost Wins:

  1. 30-second deploy β€” no Docker, no build, no config
  2. Admin dashboard for managing recipes, products, translations
  3. Built-in auth β€” add user accounts later
  4. Realtime β€” live updates when data changes
  5. Free β€” PocketHost free tier is enough for a recipe app
  6. Keep Netlify β€” your frontend stays on Netlify, PocketBase handles the API
  7. SQLite β€” perfect for a recipe app’s data volume
graph LR
    A[Browser] -->|Static Files| B[Netlify CDN]
    A -->|API Calls| C[PocketBase on PocketHost]
    C -->|SQLite| D[Recipes + Products + Users]
    C -->|Realtime SSE| A