DEV Community

Cover image for A Broken Backend Chronicle: Lost in the Labyrinth of AWS, Docker, and a Next.js App Screaming for a Database
Gabriel Cerdio
Gabriel Cerdio

Posted on

A Broken Backend Chronicle: Lost in the Labyrinth of AWS, Docker, and a Next.js App Screaming for a Database

My Next.js frontend is a 10/10. My backend is a 0/10 graveyard of failed AWS instances and broken Docker containers. I'm stuck in tutorial hell trying to connect a simple Postgres DB. Is Prisma overkill? Am I over-engineering this? Help me break the cycle! What's the 'it-just-works' stack for this?

I'm not here with a 5-step tutorial for success. I'm here with a war story, a call for help, and hopefully, a future redemption arc.

I have this project, Manhattan v1.0, a frontend I've been building with Next.js and React. I love how it looks, how it feels, and the potential it has. You can check it out for yourself right here:

➡️ GitHub Repo: https://github.com/3lneer/Manhattanv1.0

The problem is, right now, it's just a pretty face. A shiny, soulless shell. It needs a backend—a PostgreSQL database to be exact—and this is where my journey went off a cliff.

The Mission: A Free Backend in the Cloud
My goal seemed simple: connect my app to a PostgreSQL database that wouldn't cost me an arm and a leg (ideally, free) while I'm developing.

Attempt #1: The Big Cloud Dream (AWS RDS) 🌩️
Like many, I thought, "Let's do this the 'professional' way." I dove headfirst into AWS RDS. I configured my instance on the free tier, felt the power of the cloud... and was quickly overwhelmed. The security configurations (VPCs, Security Groups), the IAM credentials, and that constant paranoia that one wrong click would land me a bill the size of a new car.

Result: After hours of frustration and feeling like I was building a rocket ship just to go to the corner store, I gave up. AWS is incredibly powerful, but for my current stage, it was like using a sledgehammer to kill a fly. Failure.

Attempt #2: The Local Fortress (Docker) 🐳
"I know!" I thought. "I'll do it locally. Total control, zero cost." I submerged myself in the world of Docker. I wrote my docker-compose.yml with my Postgres service, ready to connect with DBeaver and my app.

It sounded perfect in theory. In practice, I found myself fighting with volumes, container networks that wouldn't talk to each other, and cryptic errors that my Stack Overflow searches only made more confusing.

Result: I have a Docker image that is probably offended at me and refuses to cooperate. I feel more lost than before. Failure, again.

The Current State: Analysis Paralysis 😵
And here I am. My frontend is ready, DBeaver is open waiting for a connection that never comes, and a terminal that stares back at me with disdain. I'm so stuck that, just to feel productive and cool, I started downloading Omarchy. At least that way I feel like I'm on the cutting edge of something.

The Additional Dilemma: Is Prisma My Friend or My Foe?
My project uses Prisma as an ORM. I love the idea of type safety and automatic migrations. But now, in the midst of this chaos, I'm wondering:

Am I just adding an unnecessary layer of complexity? Should I ditch Prisma and go back to raw SQL queries to simplify things, or is it precisely the tool that, if used correctly, could save me?

Top comments (0)