Do I Need a Backend for My App? A Decision Guide

You need a backend if your app must remember something, keep a secret, or let two people see the same data. A decision guide, with the trap AI-generated apps fall into.

Steve Jefferson
Steve Jefferson
Developer Advocate
2 August 20261 min read

You need a backend the moment your app has to remember something, or keep a secret, or let two people see the same data. If it does none of those, you do not, and adding one is work you will maintain forever for no benefit. That is the whole rule. Everything below is about recognising which situation you are in, because the answer is not always obvious from the outside.

What a backend actually is

Skip the architecture diagrams. A backend is code that runs on a computer you control rather than on your visitor's device, plus somewhere to store data that outlives a browser tab.

Your frontend is what the user sees and touches, and it runs on their phone or laptop. Anything running there is visible to them if they look, and it forgets everything when they close the tab, unless you deliberately store it.

So a backend exists to do exactly three things a frontend cannot:

  • Remember. Store data that persists and that other people or other sessions can see.

  • Keep secrets. Hold API keys, credentials, and business logic where a curious user cannot read them.

  • Be trusted. Enforce rules the user cannot bypass, such as who is allowed to see or change what.

If your app needs none of the three, it genuinely does not need a backend, and people build far more elaborate things than they need because "real apps have a server" sounds true.

The four questions

Work through these. Any yes means you need a backend or a service that acts as one.

1. Does data need to survive the browser closing, or be seen by someone else?

A calculator, a converter, a formatting tool: no. A to-do list where losing everything on a browser cache clear is acceptable: still no, browser storage covers it. A booking system where the business needs to see what customers submitted: yes, obviously.

2. Do you need accounts and logins?

Yes means yes. Authentication done in frontend code alone is theatre, because the user controls the frontend and can simply tell it they are logged in. The check must happen somewhere they cannot edit.

3. Do you call a paid API with a secret key?

If your app talks to an AI model, a payment provider, an email service, or a maps API with a billable key, that key cannot live in frontend code. It is visible to anyone who opens the developer tools, and scraped keys get drained fast. The request has to be made from somewhere private.

4. Do different users need different views of the same data?

Two people seeing the same shared state, or each seeing only their own records, requires something in the middle deciding who gets what.

Nothing above is about how complicated your app looks. A visually rich single-page tool can need no backend, and a plain-looking form can need one.

The middle ground most people should use

The framing above is a bit of a false binary, because in 2026 you rarely build a backend from scratch. Backend-as-a-service platforms give you a database, authentication, file storage, and small server-side functions without you running a server. That is what most app builders generate behind the scenes, and it is the correct answer for the large majority of first apps.

What your app does

What you need

Pure calculation or formatting, no saved data

Frontend only

Saves data for one user, loss tolerable

Frontend plus browser storage

Saves data across devices, needs logins

Managed backend service

Calls a paid API with a secret key

Managed backend, even if tiny

Multi-user shared data, permissions

Managed backend with proper rules

Heavy background processing, scheduled jobs

Managed backend plus a job runner

Genuinely unusual scale or compliance needs

Custom backend, and probably a developer

The practical read: most apps land in rows three to five, and none of those require you to write or operate a traditional server.

What people get wrong

Building a backend for a brochure. If it is a site that shows information and collects the occasional enquiry, a form service that emails you is the whole solution. A database and an admin panel for eleven enquiries a month is a hobby, not an architecture.

Skipping the backend and putting the API key in the frontend. This is the single most common serious mistake in AI-generated apps, and it is easy to make because the app works perfectly in testing. It works right up until someone reads your key out of the page source. If your app calls a model, the call goes through a server-side function. No exceptions worth taking.

Treating "hidden" as "secure". A page nobody links to is not protected. A UI that hides the delete button from non-admins has not stopped anyone from calling the delete endpoint directly. Rules enforced only in the interface are suggestions.

Adding a backend for future scale. You will restructure it anyway when you learn what the app actually needs. Building for imagined load is the most reliable way to ship late.

How this plays out with AI builders

Ask an AI builder for something that clearly needs persistence and it will usually provision a database and authentication without being asked, which is the right default and worth understanding rather than accepting blindly. Two things are worth checking on any generated app.

First, whether secrets are actually server-side. Ask directly where the API key is stored and whether it is exposed to the browser. This is a question with a yes or no answer and it is worth asking every time.

Second, whether the access rules exist. A generated app frequently has a working database and permissive rules that let any authenticated user read every row. That is fine in a prototype and not fine the day you have two customers, and it is the single most common API weakness on OWASP's API Security Top 10.

The broader path from idea to working product is covered in building an app with AI, and if the target is a phone rather than a browser, can AI build a mobile app covers what changes. For a concrete case where the answer is unambiguously yes, building a booking app walks through why customer submissions force the issue immediately.

Internal tools are the one category where people underestimate this most often. A dashboard your team uses looks simple and almost always needs real permissions, because "internal" and "everyone can see everything" are not the same thing. Building an internal tool with AI goes through that.

A backend is also what makes a real internal admin view possible. See how to add an admin dashboard to an AI-built app for how to gate it safely with row-level security instead of a hidden button.

Frequently asked questions

Can I add a backend later if I start without one?

Usually yes, and it is more work than adding it at the start if the app already has users and data in browser storage. If you are reasonably confident you will need accounts within a few months, start with a managed backend service. If you genuinely do not know, ship without and add it when a real need appears.

Is a database the same thing as a backend?

No. A database stores data, a backend is the code that decides who is allowed to touch it and how. Some managed services let a frontend talk to a database directly with security rules doing the gatekeeping, which is a backend in function even though you never wrote one.

Do static sites need a backend?

Not for the pages themselves. They often need a small server-side function for one thing, most commonly a contact form or an API call with a key. One function is a perfectly normal answer, and much better than adding a whole server for it.

What is the cheapest option that includes a backend?

Managed backend services almost all have free tiers that comfortably cover a project with early users, and paid tiers typically start around the price of a couple of coffees per month. Cost is rarely the deciding factor at small scale, and maintenance effort is.

How do I know if my AI-generated app has a security problem?

Ask it three questions: where are secrets stored, what happens if a logged-in user requests another user's data, and what stops someone calling the delete endpoint directly. Vague answers mean the rules probably do not exist yet.

Once the backend question is settled, the next common feature decision is search. See how to add search to an AI-built app.

Once you know you need a backend, the next decision is what to store your data in. See how to choose a database for an AI-built app for a framework that does not assume a database background.

If your data has a semantic-search component rather than pure structured records, vector database vs regular database is worth reading before you commit to a schema.

How did this land?

About the author

Steve Jefferson
Steve Jefferson

Developer Advocate

Steve builds something with Swarmz every week and writes up what worked, what broke, and what he'd do differently. Tutorials and hands-on guides are his lane.

Share

Get the next post in your inbox

One email a month. Product updates, engineering posts, and the best of Built with Swarmz.

I agree to receive emails about AI building tips and Swarmz product news. Unsubscribe any time.