最佳服务器端数据存储方法,用于简单数据 [英] Best Server-Side Data Storage Method for Simple Data

查看:58
本文介绍了最佳服务器端数据存储方法,用于简单数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编码一个网站,该网站涉及在服务器上存储非常简单的数据,只是一长串名称而没有其他数据.由于这些数据是如此简单,所以我真的不想使用MySQL(这太笨拙了),所以我想问什么是在服务器上存储非常简单的数据的最佳方法.

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.

我绝对会优先考虑速度,而通过javascript和AJAX轻松访问数据也将非常好,因为该网站的其余部分均使用javascript/jQuery编码.我真的不在乎是否可以自由查看数据(因为无论如何它们都将可用),只要未经授权的用户无法更改即可.

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.

推荐答案

使用可通过Web访问的XML文件.然后,您可以根据需要从浏览器查询XML文件,并仍然使用PHP解析/写入该文件.您将要使用PHP中的flock函数来确保页面的两个实例不会尝试同时写入文件.

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.

这篇关于最佳服务器端数据存储方法,用于简单数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆