Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Server-Side Data Storage Method for Simple Data

I'm coding a website that involves storing very simple data, just a very long list of names with no additional data, on the server. As this data is so simple, I don't really want to use MySQL (it would be a bit too clunky) so I'm asking what's the best way to store very simple data on the server.

I definitely would favour speed over anything else, and easy access to the data via javascript and AJAX would be very good too as the rest of the site is coded in javascript/jQuery. I don't really care if the data can be viewed freely (as it will be available anyway), as long as it can't be changed by unauthorised users.

like image 968
DLiKS Avatar asked Jul 16 '10 14:07

DLiKS


People also ask

What are the different methods of data storage?

The most prominent methods of storing data include physical storage devices like tape drives, hard disk drives, solid state drives, USB, CD/DVD and virtual storage medium like cloud. The data is stored exactly in the same manner as it is on the internal storage of your computer. Any data storage device uses the methods depicted in the image below.

What is the best way to store data?

The most prominent methods of storing data include physical storage devices like tape drives, hard disk drives, solid state drives, USB, CD/DVD and virtual storage medium like cloud. The data is stored exactly in the same manner as it is on the internal storage of your computer.

What is network storage for servers?

Network Storage for Servers multiplies the storage capacity of your data center, protect data, augment backup of large amounts of data and maintaining the data recovery stabilizing the process of recovery even in long run.

How is data stored in the computer?

The storage system can be based on electromagnetic, optical or other medium depending on its type. The most prominent methods of storing data include physical storage devices like tape drives, hard disk drives, solid state drives, USB, CD/DVD and virtual storage medium like cloud.


3 Answers

There are a lot of things to think about with this.

  1. Is the information the same for all users with just a single set that applies to all users out there? Or is there a separate set of data for each user?
  2. How is the data going to be served to the client, my guess here is that you would be having a web service or otherwise that might return a JSON.
  3. From a security standpoint, do you want someone to be able to just "grab" the data and run?

Personally I find that a database if often a better choice, but otherwise i would use an XML file. Keep in mind though that you have to be careful with loading/reading of XML files to serve web requests to prevent any potential file locking issues.

like image 56
Mitchel Sellers Avatar answered Sep 20 '22 18:09

Mitchel Sellers


Use an XML file that is web-accessible. Then you can query the XML file from the browser if need be, and still parse/write it in PHP. You'll want to use the flock function in PHP to make sure that two instances of a page don't try to write to the file at the same time.

like image 45
Aaron Avatar answered Sep 19 '22 18:09

Aaron


Write it to a file and save the data as a serialized object. This way when you read in the data it's instantly accessible as the variable type you need (array, obj, etc). This will be faster than XML parsing.

like image 43
Evan Avatar answered Sep 17 '22 18:09

Evan