CouchBase与Memcached混合,损失了大多数CouchDB的哲学和功能? [英] CouchBase mixed with Memcached, loss of most CouchDB philosophies and functionality?

查看:267
本文介绍了CouchBase与Memcached混合,损失了大多数CouchDB的哲学和功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

截至目前,我使用较新版本的 CouchBase 的唯一方法是通过 memcached客户端 。我使用 Erlang 作为编程语言,所以我已经抓住了一个 Erlang Memcached Client 。我注意到这个客户端通过使用 erlang:term_to_binary / 1和erlang:binary_to_term / 1 将它们从和转换为二进制串行化和解串行化erlang术语(Key和Value)从 memcached 发送和接收数据时。


设置CouchBase时,我们被要求选择memcached桶或CouchBase桶(vbuckets)。现在,我选择了CouchBase(因为我需要持久性)。我开始使用erlang memcached客户端与设置进行交互,这是可以的,我保存erlang条款,并从数据库中获取erlang条款。但是问题从这里开始:

1。由于数据序列化,对象被接收为附件。即使作为JSON发送,从Erlang,它们作为二进制数据发送,对CouchBase(或Memcached?)没有意义。

As of now, the only way i have worked with newer versions of CouchBase, is through a memcached Client. I use Erlang as the programming language and so i had grabbed myself an Erlang Memcached Client. I noticed that this client serialises and de-serialises erlang terms (both Key and Value) by converting them from and to binary using erlang:term_to_binary/1 and erlang:binary_to_term/1 when sending and receiving data from memcached.

While setting up CouchBase, we are asked to choose either memcached buckets or CouchBase buckets (vbuckets). Now, i chose CouchBase (because i needed persistence). I started interacting with the setup using the erlang memcached client and it is okay, i save erlang terms and get back erlang terms from the database. However, the problems begin here:

1. Because of data serialization, objects are received as attachments.Even if sent as JSON From Erlang, they are sent as binary data which makes no meaning to CouchBase (or Memcached ?)


{ 
    "_id": "mykey",
    "_rev": "1-000010fb1a2b02ef0000000d59960000",
    "$flags": 38489, 
    "$expiration": 0,
    "$att_reason": "invalid_json",
    "_attachments": {
    "value": {
                "content_type": "application/content-stream",
                "revpos": 2,
                "digest": "md5-n3mJhf2kKVQtkIunIbCJZQ==",
                "length": 13,
                "stub": true
            }
        }
    }


2。因此,无法通过 CouchDB视图 进行操作,无法搜索此数据。获取数据的唯一方法是Key,但嵌套的对象可能是。使用原始的沙发数据库,​​我们可以编写高级视图,降低地图 来搜索和处理JSON数据在数据库等

3。因此,我们无法清楚地使用以下内容: Couch Apps 设计文档 与Couch Base一样,我们曾经使用Couch DB,因为这些功能用于在沙发中进行JSON数据处理。

问题
1。据了解,CouchBase正在考虑CouchDB采用的不同方法,但作为开发人员,我觉得很多东西已被带走。没有更多的沙发应用程序,设计文档,视图,e.t.c?结果2。可能,我在这里遇到什么问题,可以有一个请告诉我如何使用Couch Base做所有这一切,就像原来的Couch DB一样?有没有其他方法可以插入,读取或更新Couch Base 1.8及更高版本的数据(使用erlang),而不是Erlang memcached客户端?这是因为有数据串行化使得这个数据对于同一个项目中的其他技术无用,因为它们可能无法解码Erlang数据结构。在一个多语言项目中,我们拥有PHP Developers,C ++,Erlang,Ruby e.t.c.使用相同的Couch Base实例(数据库),使用数据序列化,我们应该如何访问和了解所有技术的数据?

有人协助指出从CouchDB到Couch Base的更改,解释了为什么新的沙发底座与Memcached紧密相连,以至于我们必须使用memcached客户端与CouchBase通话。另外,如果还有另外一个Erlang-to-CouchBase SDK,可以帮助我从Couch Base发出JSON(而不是序列化数据),我希望把它放在手上。

**编辑**
假设如下:CouchBase x86_64 1.8.0和Erlang OTP R15B。我需要使用Couch Base中的JSON数据,因此在一个大型的多语言项目中,我们的应用程序可以运行相同的数据集而不会产生序列化问题。谢谢


2. As a result of this, this data cannot be searched, manipulated through CouchDB views. The only way to get the data is by "Key", however nested an object may be. With original Couch DB, we could write Advanced Views, Map reduce to search and manipulate JSON data in the database e.t.c

3. Hence, we cannot clearly use things like: Couch Apps and Design Documents with Couch Base as we used to do with Couch DB, because, these features are meant for JSON data processing within Couch.

Questions
1. I understand that CouchBase is looking at a different approach from CouchDB, however, as a developer i feel like a lot has been taken away from us. No more Couch Apps, Design Docs, Views, e.t.c ?
2. Probably, i am getting something wrong here, can some one please show me how i can still do all this with Couch Base as i did with original Couch DB ?
3. Is there any other way to insert, read or update data in Couch Base 1.8 and above, (using erlang) other than an Erlang memcached client ? This is because, there is data serialization which makes this data useless to other technologies within the same project as they may not be able to decode Erlang data Structures
4. In a multi-language project where we have PHP Developers, C++, Erlang, Ruby e.t.c. working with the same Couch Base instance (Database), with the data serialization, how are we supposed to access and understand data across all technologies ?

Someone assist point out the changes from CouchDB to Couch Base, explain why the new Couch Base is so tied up to Memcached to a point where by we have to use memcached clients to speak with CouchBase. Also, if there is another Erlang-to-CouchBase SDK which can help me speak JSON (and NOT serialized data) from and to Couch Base, i wish to lay my hands on it.

** EDIT **
Assume the following: CouchBase x86_64 1.8.0 and Erlang OTP R15B. I need to work with JSON data in Couch Base so that in a large multi-language project, our applications operate the same data set without having serialization challenges. Thank you

推荐答案

CouchDB和Couchbase之间有很大的区别,如果我是正确的Couchbase使用CouchDB来存储数据,但是不提供/呈现CouchDB的意见和其他功能。

There's a big difference between CouchDB and Couchbase, if I'm right Couchbase use CouchDB to store the data but do not offer/present the views and others nice functionality of CouchDB.

我从Couchbase网站和Couchbase服务器文档中浏览了不同的API(ruby,php)和I没有找到任何关于视图或地图缩小的内容。
请参阅文档: http://www.couchbase.com/docs/ couchbase-manual-1.8.pdf

I went through the different API (ruby, php) from the Couchbase website and the Couchbase server documentation and I didn't find anything about view or map-reduce. see doc: http://www.couchbase.com/docs/couchbase-manual-1.8.pdf

Couchbase看起来更像一个具有由CouchDB供电的持久层的Memcache服务器,也许它不符合您的需求。您可以存储的数据可以是从int到序列化的任何东西,如JSON,但在这种情况下,您必须在所有的端点对其进行排序。

Couchbase looks more like a memcache server with a persistence layer powered by CouchDB, and maybe it does not fit your needs. The data that you can store within can be anything from int to something serialize such as JSON, but in this case you have to unserialize it on all ends.

为什么使用Couchbase而不是CouchDB?我没有旧的Couchbase版本的经验,但我知道这些名称,即使它们相当相似,指的是不同的应用程序,也许它值得进一步,如果它真的是你正在考虑的。

Why are you using Couchbase instead of CouchDB? I do not have experience of the older Couchbase versions but I know that these name, even if they are quite similar refer to different applications and maybe it do worth looking further if it's really the one you are thinking about.

修改
有趣的链接: http://damienkatz.net/2012/01/the_future_of_couchdb.html 阅读评论以及很多有趣的内容。

Edit Interesting link: http://damienkatz.net/2012/01/the_future_of_couchdb.html read the comments as well, lot of interesting stuff within.

从评论我明白Damien Katz正在开发这个名为Couchbase的新项目,但它不是CouchDB的最后一个版本,只是另一个NoSQL数据库。

From the comment I understand that Damien Katz is now working on this new project called Couchbase but it's not CouchDB's last version but just another NoSQL database.

所以如果你习惯了CouchDB,你可以使用最后一个版本的CouchDB。或者如果您想考虑切换到Couchbase,请查看2.0的功能,路线图等,并调查是否真的适合您的需要。

So if you were used to CouchDB you could just use the last version of CouchDB. Or if you want to consider switching to Couchbase, look at the features, roadmap for 2.0, etc. and investigate if it does really fit your needs.

这篇关于CouchBase与Memcached混合,损失了大多数CouchDB的哲学和功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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