对于键>值数据有哪些好的、快速的持久存储选项?

发布于 2024-09-28 08:34:04 字数 1431 浏览 1 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

习惯成性 2024-10-05 08:34:05

只是为了建议一些不同的东西,redis(或redisdb-win32(如果您使用的是 Windows 服务器)

Just to suggest something different, redis (or redisdb-win32 if you're on a Windows servers)

硪扪都還晓 2024-10-05 08:34:05

CouchDB 是您的答案(尽管对于您的需求来说它可能有点过大)。

CouchDB is your answer (although it could be a little bit overkill for your necessities)..

神妖 2024-10-05 08:34:05

奇怪的是,到目前为止还没有人提到Flintstone

Doctrine 也是一个不错的选择。

Strange no one mentioned Flintstone till now.

Also a good option is Doctrine.

白馒头 2024-10-05 08:34:05

可能不是最好的答案。但我会将其存储到 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.

琉璃繁缕 2024-10-05 08:34:05

为了向已经提到的内容添加更多内容,PHP 对

  • MongoDB 提供本机支持,
  • < a href="http://php.net/manual/en/book.tokyo-tyrant.php" rel="nofollow">Tokyo_Tyrant 和
  • Berkeley DB

对于后者,有一个 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.

超可爱的懒熊 2024-10-05 08:34:05

我会选择 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.

梅窗月明清似水 2024-10-05 08:34:04

简短回答: Membase


长答案:
您基本上有三个选择:关系数据库、文件存储或其他。

就像你说的,关系数据库绝对是矫枉过正的。也就是说,如果这是已经拥有 MySQL 或其他数据库的应用程序的一部分,我会同意。同样,文件存储有时很方便(例如写入一堆 XML 文件),但磁盘 I/O 可能很慢。

现在,在“其他”类别中,您有一些很棒的 NoSQL 选项,例如 CouchDBMemcached

如果您不太担心数据的持久性,我建议使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文