Might not be the best answer. But I would store it into a mySQL Database and probably use a mysql_pconnect if the data are not being extracted at the same time.
Long answer:
You basically have three options: a relational database, file storage, or something else.
Like you said, a relational database could definitely be overkill. That said, if this is part of an application that already has a MySQL or other database, I would go with that. Likewise, file storage can be handy sometimes (writing to a bunch of XML files, for example), but disk I/O can be slow.
Now in the other category, you have some great NoSQL options like CouchDB or Memcached.
If you aren't too worried about the persistence of your data, I'd recommend memcache. It's lightweight, easy to get running, and there is a Memcache PHP extension that makes using it easy. It is made for key-value storage like this.
The one drawback memcache has is that all your data is lost the second the memcache service stops. This is where Membase comes in. It is an open-source fork of memcache that is protocol-compatible, meaning it will work with all existing client libraries. However, it can persist your data and actually provide consistency and reliability, something memcache can't on its own.
NOTE: This answer is a relic of its time, as is the question itself. Please do not take it literally.
发布评论
评论(7)
只是为了建议一些不同的东西,redis(或redisdb-win32(如果您使用的是 Windows 服务器)
Just to suggest something different, redis (or redisdb-win32 if you're on a Windows servers)
CouchDB 是您的答案(尽管对于您的需求来说它可能有点过大)。
CouchDB is your answer (although it could be a little bit overkill for your necessities)..
奇怪的是,到目前为止还没有人提到Flintstone。
Doctrine 也是一个不错的选择。
Strange no one mentioned Flintstone till now.
Also a good option is Doctrine.
可能不是最好的答案。但我会将其存储到 mySQL 数据库中,并且如果不同时提取数据,可能会使用 mysql_pconnect 。
有关 pconnect 的信息请参见: php.net
数据库的常见替代方案是纯文件,但如果我错了请纠正我,但并发文件访问可能会更慢。
祝你好运。
Might not be the best answer. But I would store it into a mySQL Database and probably use a
mysql_pconnect
if the data are not being extracted at the same time.Informations about pconnect here: php.net
A common alternative to Database is a plain file but correct me if I'm wrong but concurent file access might be slower.
Good luck.
为了向已经提到的内容添加更多内容,PHP 对
对于后者,有一个 Johannes Schlüter 的好文章。
To add some more to those already mentioned, PHP has native support for
For the latter there is a nice article by Johannes Schlüter.
我会选择 MySQl,以防万一您将来需要升级您的应用程序。在应用程序方面最好能面向未来。
i would go for MySQl, just in case you need to upgrade your application in the future. Better be future proof when it comes to applications.
简短回答: Membase。
长答案:
您基本上有三个选择:关系数据库、文件存储或其他。
就像你说的,关系数据库绝对是矫枉过正的。也就是说,如果这是已经拥有 MySQL 或其他数据库的应用程序的一部分,我会同意。同样,文件存储有时很方便(例如写入一堆 XML 文件),但磁盘 I/O 可能很慢。
现在,在“其他”类别中,您有一些很棒的 NoSQL 选项,例如 CouchDB 或 Memcached。
如果您不太担心数据的持久性,我建议使用 memcache。它是轻量级的,易于运行,并且有一个 Memcache PHP 扩展使使用变得简单。它是为这样的键值存储而设计的。
Memcache 的一个缺点是,一旦 Memcache 服务停止,所有数据都会丢失。这就是 Membase 的用武之地。它是 memcache 的一个开源分支,与协议兼容,这意味着它将与所有现有的客户端库一起使用。但是,它可以持久保存您的数据,并实际上提供一致性和可靠性,而这是 memcache 本身无法做到的。
注意:这个答案是那个时代的遗物,问题本身也是如此。请不要按字面意思理解。
Short answer: Membase.
Long answer:
You basically have three options: a relational database, file storage, or something else.
Like you said, a relational database could definitely be overkill. That said, if this is part of an application that already has a MySQL or other database, I would go with that. Likewise, file storage can be handy sometimes (writing to a bunch of XML files, for example), but disk I/O can be slow.
Now in the other category, you have some great NoSQL options like CouchDB or Memcached.
If you aren't too worried about the persistence of your data, I'd recommend memcache. It's lightweight, easy to get running, and there is a Memcache PHP extension that makes using it easy. It is made for key-value storage like this.
The one drawback memcache has is that all your data is lost the second the memcache service stops. This is where Membase comes in. It is an open-source fork of memcache that is protocol-compatible, meaning it will work with all existing client libraries. However, it can persist your data and actually provide consistency and reliability, something memcache can't on its own.
NOTE: This answer is a relic of its time, as is the question itself. Please do not take it literally.