write json file to database

Asked

Viewed 1,892 times

3

it’s a good idea?

was thinking of doing a project where the user will create several elements dynamically (tables, choose a certain option, fill in etc), these elements generated dynamically should be saved in the database to be later updated, modified (something similar to jsfiddle, where you update an existing project, modify, etc).

How do developers usually do? save json to the database? then read it and generate and fill the elements in html?

{["firstName":{"required":"true","type":"text"},"lastName":{"required":"true","type":"text"}}

1 answer

4


Not only can it, it’s a common and recommended practice for this type of situation. In addition, saved data can be used by any language and framework, since JSON is universally understood.

For example, passing Json to your frontend, with Javascript you create the fields. You can also use Json and generate HTML with PHP. You can even use JSON and generate a screen for an iPhone App with Swift. And so on.

It is so acceptable that major RDBMS have internal structures for JSON:

Banks noSQL are purely Json:

Couchdb, is an open-source database that focuses on ease of use and the philosophy of being "a database that encompasses the Web"1 . It is a non-relational database (Nosql) that uses JSON to store the data, Javascript as your query language https://en.wikipedia.org/wiki/Apache_CouchDB

Browser other questions tagged

You are not signed in. Login or sign up in order to post.