This question already has an answer here:

I am thinking about using JavaScript for direct connection to our database server. I think I have solutions to all the possible problems about it.

  • Security: Modern database management systems support SSL connections (e.g. PostgreSQL). We can securely connect to a DBMS. There is no difference between securely connecting to a database and securely connecting to an application server.
  • Authorization: We can define stored procedures in modern database management systems. We can define the functional interface of users by using stored procedures and functions. We can authorize users to use only selected ones of those procedures. We can restrict them from using any of create, drop, select, insert, etc. statements.
  • Efficient bandwidth usage: Modern database management systems support data compression. We can get much more compressed raw data from a database server for unit bandwidth and decompress and "HTMLize" that raw data on the client by using the client's computing resources (distributed computing is a plus).
  • We can use an HTTP server to serve static HTML+JavaScript pages. Because the pages will be all static, the HTTP server will cache web pages much more efficiently and this will increase performance.

So I think there is nothing wrong with using a two-tier system on current DBMS and browser technologies. Any objections?

merged by World Engineer Feb 21 '16 at 2:10

This question was merged with Is there any reason not to go directly from client-side Javascript to a database? because it is an exact duplicate of that question.

Browse other questions tagged or ask your own question.