locked
how to store and access database from clientside? RRS feed

  • Question

  • User417741264 posted

    My intention is to avoid server side coding. Is there any framework/library to save and read data from HTML/js

    Tuesday, November 28, 2017 11:11 AM

Answers

  • User283571144 posted

    Hi maheshvishnu,

    My intention is to avoid server side coding. Is there any framework/library to save and read data from HTML/js

    Firstly, I don't suggest you directly use client side library to CRUD the data.

    This is not security.

    For example, the html will return to the user's browser.

    If you use html/js to connect to your database and CRUD the data. You must write the sql query and database connection string in the client-side.

    If someone find these information, he could easily using browser's develop tool(F12) changed the query to get all the record from your database or insert multiple data to attack your database server.

    In my opinion, if you want to access the database, you need write server-side code.

    Normally, we will use js to send the request to the server-side(asp.net web api).

    In the server-side, you could write the code to CRUD the data.

    If you want to use javascript synx code language, I suggest you could try to use Node.js.

    Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 4, 2017 8:30 AM

All replies

  • User971510421 posted

    You can use LocalStorage/SessionStorage using HTML/JS.

    Please see the below link might be helpful for you :

    https://msdn.microsoft.com/en-us/library/bg142799(v=vs.85).aspx

    Tuesday, November 28, 2017 11:57 AM
  • User753101303 posted

    Hi,

    So it seems the first step could be to select a database exposing a REST API (possibly out of the box). Try https://www.google.com/search?q=database+rest+api and check AWS, Google, Azure or other hosting services.

    Tuesday, November 28, 2017 1:02 PM
  • User283571144 posted

    Hi maheshvishnu,

    My intention is to avoid server side coding. Is there any framework/library to save and read data from HTML/js

    Firstly, I don't suggest you directly use client side library to CRUD the data.

    This is not security.

    For example, the html will return to the user's browser.

    If you use html/js to connect to your database and CRUD the data. You must write the sql query and database connection string in the client-side.

    If someone find these information, he could easily using browser's develop tool(F12) changed the query to get all the record from your database or insert multiple data to attack your database server.

    In my opinion, if you want to access the database, you need write server-side code.

    Normally, we will use js to send the request to the server-side(asp.net web api).

    In the server-side, you could write the code to CRUD the data.

    If you want to use javascript synx code language, I suggest you could try to use Node.js.

    Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.

    Best Regards,

    Brando

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 4, 2017 8:30 AM