2

I came across this joke the other day. Someone on the internet was asking why do we need a backend, just connect the frontend to the database.

It seemed funny at first, but really is it possible to create a framework which handles frontend and backend at the same time?

Routing and listing views or grids all happen in the same function.

Technically I can't think of a reason why not!

Gamzosh
  • 65
  • 1
  • 9
  • This question has been asked before, see https://stackoverflow.com/questions/857670/how-to-connect-to-sql-server-database-from-javascript-in-the-browser – Shazi Aug 27 '20 at 08:59

1 Answers1

6

Technically you can, but practically its useless for any serious applications, Some reasons from top of my head -

  • At some point, you will expose all your credentials in browser.
  • If you have any novel algorithm, which run's in backend, now you have to expose them to everyone.
  • Your database is exposed, anyone can query the data from your db, just by running a db query in browser console, which exposes other users data too.
  • Authentication & Authorisations are big joke, if you have no backend.
  • Think of big applications like amazon, 100s of services, developed and deployed independently, in different languages, all at once in browser ? and only in javascript ? The client machine will die.

Many more.

Yuvaraj G
  • 1,017
  • 6
  • 15