DEV Community

Cover image for SurrealDB is Not a Silver Bullet: 3 Scenarios Where You Still Need a Backend
Jakub Málek
Jakub Málek

Posted on

SurrealDB is Not a Silver Bullet: 3 Scenarios Where You Still Need a Backend

The "No-Backend" Hangover
Look, I know what I said. In my previous posts, I praised SurrealDB like it was the end of the "traditional" backend era. And for 80% of projects, it might be.

But as a medior dev who’s seen his fair share of architectural disasters, I have to be honest: SurrealDB is not magic. If you try to build everything directly on top of the database, you’re eventually going to hit a wall. Sometimes, you just need a "boring" server running Node, Rust, or Go. Here are three reasons why I’m not deleting my Express/Hono repositories just yet.

1. The "Secret Key" Problem (Integrations)
SurrealDB can handle authentication, but it shouldn't be your "Integration Hub."

If your app needs to talk to Stripe, SendGrid, or a 3rd party AI API, you have a problem. You cannot—and I repeat, CAN NOT—expose your secret API keys to the frontend, even with the best Row-Level Security in the world.

The Reality Check: Anything that requires a sensitive handshake with another service belongs in a secure, server-side environment.

2. Heavy Lifting & CPU-Intensive Tasks
SurrealQL is powerful, but it’s a query language, not a general-purpose programming language.

Scenario: You need to resize an image, generate a complex PDF invoice, or run a local AI model inference to score a user's trust level.

The Reality Check: Doing this inside a database layer (even with future-ready functions) is like trying to win a Formula 1 race in a very fast tractor. It's the wrong tool. You need a dedicated microservice that can scale horizontally to handle the CPU load.

3. Proprietary "Black Box" Logic
Sometimes, your business logic is your "secret sauce." If your sorting algorithm or your AI-matching logic is what makes your startup unique, you might not want it sitting in a database schema where (even if secured) it's closer to the edge than you'd like.

The Reality Check: Complex state machines or proprietary algorithms are often easier to write, test, and debug in a standard backend environment with full-fledged logging and monitoring tools.

My "Hybrid" Advice
I don't choose between "No-Backend" and "All-the-Backend." I use a hybrid approach:

  • SurrealDB handles the data, the simple CRUD, and the real-time sync.
  • A Slim Backend (Edge Functions) handles the "heavy" stuff: payments, sensitive integrations, and complex AI processi ng.

Conclusion
Don't be a zealot. SurrealDB is a massive leap forward for developer productivity, but don't let the "No-Backend" dream turn into a "High-Maintenance" nightmare. Use the right tool for the job.

What’s your take? Have you tried building a "pure" DB-only app, or did you crawl back to Node.js after a week? Let's discuss in the comments!

Top comments (0)