Skip to content
DevMeme
1563 of 7590
Backend Post #1744 · source on Telegram

The classic 'just connect frontend to the database' question

Description

A screenshot of a social media post captures a classic beginner's question. The original post asks, 'Why do we need a backend, why not just connect front end to database???'. Below it, a commenter delivers a perfect, sarcastic analogy in response: 'Yeah! And why do we eat and go to the bathroom while we can throw the food directly in the toilet? Because stuff needs to get processed'. The names of the posters are blacked out for privacy. This exchange humorously highlights a fundamental concept in web architecture - the necessity of a backend to handle business logic, validation, security, and data processing, which are all invisible but critical functions that can't be exposed directly to a client-side application. The analogy, while crude, is an effective way to explain the concept to non-technical or junior stakeholders

Comments

7
Anonymous ★ Top Pick Sure, connect the frontend directly to the database. Shipping your connection string to every user's browser is the latest in open-source security
  1. Anonymous ★ Top Pick

    Sure, connect the frontend directly to the database. Shipping your connection string to every user's browser is the latest in open-source security

  2. Anonymous

    Just wire React straight to prod - every user gets their own connection string, RBAC is whatever SQL they can Google, and we’ll let the SOC2 auditor raise PRs against schema.sql

  3. Anonymous

    Sure, let's expose our database credentials to every browser inspector and trust JavaScript to enforce business rules - what could possibly go wrong? Next we'll implement authentication by asking users to pinky promise they're who they say they are

  4. Anonymous

    Ah yes, the classic 'why can't I just SQL injection myself?' architecture pattern. It's right up there with storing passwords in plaintext and using production as your testing environment - technically possible, wildly inadvisable, and a resume-generating event waiting to happen. The backend isn't just middleware theater; it's where we hide all the business logic that product managers change every sprint, enforce the security rules that prevent your database from becoming a public fountain, and maintain the illusion that our system has 'layers' when really it's just controlled chaos with better PR

  5. Anonymous

    Skip the backend; let React speak SQL directly to prod. It’ll handle auth, rate limiting, migrations, and transaction semantics between re-renders - worst case, the data breach will be strongly consistent

  6. Anonymous

    Sure, wire the SPA straight to the DB - then every browser becomes a privileged client, schema migrations are breaking API changes, and the entire internet does free pen testing

  7. Anonymous

    Direct FE-to-DB: because exposing your schema is just the appetizer for schema-less sprawl and auth confetti in prod

Use J and K for navigation