PHP 友好的 NoSQL 解决方案
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2822021/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP-friendly NoSQL solutions
提问by mattbasta
I'm looking to use a NoSQL solution for my next project, which will be written in PHP. What choices do I have in terms of NoSQL solutions that can easily interfaced via PHP? I haven't done much thinking about the architecture yet, so I'm not sure what my needs will be; I'd simply like to know what my choices are so I don't build something I can't reasonably implement.
我希望在我的下一个项目中使用 NoSQL 解决方案,该项目将用 PHP 编写。在可以通过 PHP 轻松连接的 NoSQL 解决方案方面,我有哪些选择?我还没有对架构做太多思考,所以我不确定我的需求是什么;我只是想知道我的选择是什么,所以我不会构建我无法合理实施的东西。
For instance, I know Cassandra has Pandra, but that's just a PHP library. MongoDB has a native PECL extension.
例如,我知道 Cassandra 有 Pandra,但这只是一个 PHP 库。MongoDB 有一个原生的 PECL 扩展。
采纳答案by Gordon
PHPillow is an object orientated wrapper for CouchDB. Releases can be found on the downloads page. Apache CouchDB is a distributed, fault-tolerant and schema-free document-oriented database accessible via a RESTful HTTP/JSON API. Among other features, it provides robust, incremental replication with bi-directional conflict detection and resolution, and is queryable and indexable using a table-oriented view engine with JavaScript acting as the default view definition language.
PHPillow 是 CouchDB 的面向对象的包装器。可以在下载页面上找到版本。Apache CouchDB 是一个分布式、容错和无模式的面向文档的数据库,可通过 RESTful HTTP/JSON API 访问。在其他功能中,它提供强大的增量复制和双向冲突检测和解决方案,并且可以使用面向表的视图引擎进行查询和索引,JavaScript 作为默认视图定义语言。
Also see http://nosql-database.orgfor a good overview.
另请参阅http://nosql-database.org以获得良好的概述。
回答by kristina
I wrote the PHP driver for MongoDB and I think it's a great interface :)
我为 MongoDB 编写了 PHP 驱动程序,我认为这是一个很棒的界面 :)
The mongo PECL package is not only pretty mature (comparatively... nearly a year and a half old now!) and fairly thoroughly documented, it is really widely used. If you check out MongoDB's PHP page, you can see that there are ways of integrating it with Cake, Doctrine, Drupal, Kohana, Symfony, and Zend, as well as a couple admin GUIs (like PHPMoAdmin) and several of it's own ODMs (object document mappers).
mongo PECL 包不仅非常成熟(相对而言......现在已经将近一年半了!)而且相当完整的文档,它确实被广泛使用。如果您查看 MongoDB 的PHP 页面,您会发现有多种方法可以将它与 Cake、Doctrine、Drupal、Kohana、Symfony 和 Zend 以及几个管理 GUI(如PHPMoAdmin)和几个它自己的 ODM(对象文档映射器)。
P.S. salathe has a good point, though, the best solution is really going to depend on what you're doing.
PS Salathe 有一个很好的观点,不过,最好的解决方案实际上取决于你在做什么。
回答by salathe
a NoSQL solution
NoSQL 解决方案
Your question is very vague, whether you intended it or not. Without knowing that you are wanting to get out of the NoSQL solutionthen any recommendations would just be naming names (not necessarily a bad thing, but nothing that you can't Google yourself in a few minutes). For example, the two that you name above (Cassandra and MongoDB) are different animals: to base the choice on friendlinessseems a little short-sighted.
你的问题很模糊,不管你是否有意。在不知道您想要退出NoSQL 解决方案的情况下,任何建议都只是命名名称(不一定是坏事,但没有什么是您无法在几分钟内自行搜索的)。例如,您在上面提到的两个(Cassandra 和 MongoDB)是不同的动物:将选择建立在友好的基础上似乎有点短视。
So, could you have a think about it, then come and elaborate on the project (no need to divulge details; general approaches, wants and desires, that sort of thing) to aid us in helping you move towards a choice?
那么,你能不能想一想,然后来详细说明这个项目(不需要透露细节;一般方法,想要和愿望之类的东西)来帮助我们帮助你做出选择?
P.S. This is only an "answer" because it's too long for a comment. Waffley fingers!
PS 这只是一个“答案”,因为评论太长了。华夫饼手指!
P.P.S. Not that it means anything, but I am quite the fan of MongoDB... with PHP or otherwise.
PPS 并不是说它意味着什么,但我非常喜欢 MongoDB ......使用 PHP 或其他方式。
回答by koen
I have not tried it yet myself, but it's on my to do list: trying out mongo with php.

