How I Optimized My First Hackathon Project on Render

During my first hackathon, I built a project hosted on Render. I was excited to get it working quickly, so I used Supabase for everything — database, authentication, even storing media. It worked… but it was slow and sometimes unreliable. After the hackathon, I optimized it so the project could stay online, recover from Render’s file deletions, and run much faster. 🚩 The Original Setup Supabase Database stored all app data plus media files (images, uploads). Render hosted the app, but free-tier instances delete local files regularly. Because every read/write hit Supabase, queries felt sluggish. Storing media in the DB made things even heavier. 🔧 The Optimizations 1. Dual Database Setup I introduced SQLite as the primary DB (fast local reads/writes). Supabase DB remained the source of truth + persistent backup. I wrote a script that: Detects when Render deletes the local SQLite file. Pulls fresh data from Supabase. Recreates a new SQLite database from it. 👉 Result: SQLite gives speed, Supabase ensures persistence, and the script automatically heals the system when Render wipes local files. ...

August 26, 2025 · 2 min