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:
    1. Detects when Render deletes the local SQLite file.
    2. Pulls fresh data from Supabase.
    3. 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.


2. Moving Media to Proper Storage

  • Before: Media files were stored directly in the Supabase DB.
  • After: I switched to Supabase Storage for the files.
  • The DB now only holds metadata (file path, owner, timestamp).

👉 Result: Smaller DB size, faster queries, smoother uploads.


3. Keeping the App Alive

  • Free hosting tends to let apps “fall asleep.”
  • I used cron jobs to run the DB sync script on schedule.
  • Added Uptime Robot to ping the app regularly.

👉 Result: My project feels always online, even on free-tier hosting.


📚 Lessons Learned

  • Use the right tool for the job: DB for structured data, storage for files.
  • Backup + recovery scripts are essential when your hosting platform clears files.
  • Automation (cron + monitoring) makes even hackathon projects more reliable.

🔗 Check It Out

If you want to see this in action:


Have you ever hacked around free hosting limits? I’d love to hear your tricks!