Javascript / jQuery data storage method (database)

I am currently developing a website that will store a long list of names (without any additional data) on the server , and then output to the client browser upon request.

To save these names, I obviously would need a data storage method, and I'm just wondering, since the whole site is encoded in javascript / jquery, if there is a safe way to store these names and then output them using JavaScript?

I want to avoid the PHP / MySQL route for server load, so I thought it was easiest to save the names in a text file on the server and then use AJAX to read the names and output, but I donโ€™t know how safe it is for unauthorized changes. Please give me your thoughts on this method.

Another way would be to use the TaffyDB library, please also think about it.

I still donโ€™t like the unauthorized viewing of data, since they can still see it all on the site, just unauthorized changes.

Thanks,

DLiKS

+1
javascript jquery database
source share
6 answers

Use CouchDB . Any information is available through AJAX (POST, GET ..).

+2
source share

Saving the names in a text file on the server can be safe, depending on how secure your server is and how you set permissions.

For example, using the secure linux web server, you can set file permissions so that only the root user can write to the file, but everyone can read it. Many very important configuration files are protected only because of permissions like this on Linux.

+1
source share

Check out this plugin: http://www.jstorage.info/

It has an impressive set of browser support, including IE. It will integrate with most modern JS frameworks and can function autonomously.

+1
source share

There is no secure way to save this on the client.

The best scenario I could think of is HTML5 storage . But this means that you doom your customers to HTML5 browsers . Writing and reading textfiles from the local file system is a bad thing (bad bad karma) that requires a lot of security tokens / browser.

I would really consider using database storage on the server.

0
source share

Access to the file system with JavaScript in the browser is prohibited - basically this violates the sandbox policy. See the previous SO post and article .

JavaScript and the DOM provide attackers with the ability to run scripts on a client computer over the Internet. Browser authors contain this risk using two restrictions. First, scripts are run in a sandbox in which they can only perform actions related to a website, and not general-purpose tasks such as creating files.

What you are talking about can be done using a Silverlight application, an ActiveX control (ugh!), Adobe Flash / AIR (I don't know this platform), etc. Something with local storage, which runs as essentially a browser plugin.

If you do not want to go this route, I think that all you can do is to store data in a hidden value in your markup ... but I would not advise. I agree with jAndy - go with the db storage server.

0
source share

SQLite is the only option you can consider in this case. SQLite is a lightweight database server that does not require any overhead such as startup, maintenance, etc. (For example, for other DBMSs, such as Oracle, MySql, etc.).

It works as an embedded db server in your server side application.

0
source share

All Articles