CockroachDB - Some questions

257 views
Skip to first unread message

Edgar Lanting

unread,
Nov 11, 2014, 9:34:26 AM11/11/14
to cockro...@googlegroups.com
Hi there,

I’ve been looking at CockroachDB and I think it a seriously interesting product, even though its in an alpha phase, I’m definitely backing it.
Apart from implementing it in an application, is there already some documentation available for use by dba’s (connecting a client to the node cluster, querying, etc…)

Thanks in advance!

Best regards,
Edgar Lanting

Spencer Kimball

unread,
Nov 11, 2014, 11:04:34 AM11/11/14
to Edgar Lanting, cockro...@googlegroups.com
Edgar, at this stage, we're working towards a beta which would provide an application access to a transactional, synchronously replicated, scalable key-value store. At this point, we're working on the final stretch but it's an important final stretch and until it's complete, the product is simply not usable in a production environment.

With those caveats, the way that an application would connect to the cluster and use it is through one of two HTTP interfaces. One is a RESTful API which does pretty much what you'd expect: CRUD operations around key/value resources. The REST API does not provide transactional access, nor does it expose all of the functionality which the underlying Key-Value store provides, such as conditional puts (compare and swap). The REST API is exposed by any node in the cluster at https://host:port/kv/rest/...

The second is protobuf/json over HTTP which exposes the full Key-Value API. This API isn't really meant for direct application access, but is intended for use through a client library. At this point, only a Go client library is implemented, although adding additional versions should be quite simple. The client library is really just some retry logic, request / response marshaling, and HTTP transport. The go client library is used by the system itself to bootstrap and store system metadata, stats and transactional data. The client library is a few hundred lines of Go code and we'll want to be adding support for other languages. Which language do you expect to use? We were thinking that we'd start with support for Go, Java & Javascript, though we expect the list to eventually include a longer list. Some more programmer-centric client documentation can be found at: http://godoc.org/github.com/cockroachdb/cockroach/client

We will be working to roll out a decent getting started guide once the product has reached the first beta iteration. We're hoping the timing of that is in the next month.


--
You received this message because you are subscribed to the Google Groups "Cockroach DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cockroach-db...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

James Graves

unread,
Nov 13, 2014, 3:33:41 PM11/13/14
to cockro...@googlegroups.com
Spencer Kimball wrote:
The second is protobuf/json over HTTP which exposes the full Key-Value API. This API isn't really meant for direct application access, but is intended for use through a client library. At this point, only a Go client library is implemented, although adding additional versions should be quite simple. The client library is really just some retry logic, request / response marshaling, and HTTP transport. The go client library is used by the system itself to bootstrap and store system metadata, stats and transactional data. The client library is a few hundred lines of Go code and we'll want to be adding support for other languages.


So for yucks I tried to write a simple application to connect to a Cockroach DB cluster:

https://gist.github.com/jamesgraves/67ed52e2effff6428498

I was able to install all the Cockroach dependencies and build everything apparently successfully using bootstrap.sh and make on a Ubuntu 14.04 machine.

I then ran the deploy/local-cluster.sh script to bring up three nodes.  They seem to come up fine, and they are apparently talking to each other.

However, when I run the above application, I get a '404 not found' error.  I can, using curl, see the same thing when trying to connect to http://localhost:49155/kv/db/Get URL.  I can see stuff, however, when trying the http://localhost:49155/_status/gossip URL with curl.

So, I'm not sure what's going on.  From what I can tell of the client code, that seems to be OK.  The http server is obviously running.  I've started looking through the server side code, but any hints would be appreciated.

Best Regards,

James Graves

Spencer Kimball

unread,
Nov 18, 2014, 3:03:01 PM11/18/14
to James Graves, cockro...@googlegroups.com
James,

We're still pre-alpha. That unfortunately means we can't yet provide support. None of us is running a cluster in anything other than unittests, so while we're keen to move on to the bigger and better things you're trying to get at, we're still missing a couple of key pieces before that makes sense. The biggest critical missing piece is the synchronous replication and rebalancing. At present, Cockroach would only bother to use a single machine with no replication, no matter how many nodes you have participating in the gossip network.

The timing isn't that far off, however, for when we will be moving things close enough to Beta to start this kind of testing, at which point we will be working hard to address these kinds of bug reports.

--

James Graves

unread,
Nov 18, 2014, 3:32:37 PM11/18/14
to Spencer Kimball, cockro...@googlegroups.com
Spencer Kimball <spencer...@gmail.com> wrote:

We're still pre-alpha. That unfortunately means we can't yet provide support. None of us is running a cluster in anything other than unittests, so while we're keen to move on to the bigger and better things you're trying to get at, we're still missing a couple of key pieces before that makes sense. The biggest critical missing piece is the synchronous replication and rebalancing. At present, Cockroach would only bother to use a single machine with no replication, no matter how many nodes you have participating in the gossip network.

The timing isn't that far off, however, for when we will be moving things close enough to Beta to start this kind of testing, at which point we will be working hard to address these kinds of bug reports.

James Graves <james.c....@gmail.com> wrote:
So for yucks I tried to write a simple application to connect to a Cockroach DB cluster:

Well, for what it's worth, as of the current HEAD, this example program now works fine.  I'm really not sure what was wrong initially, perhaps the docker upgrade helped.

I totally understand the support issue and the pre-alpha status.  I'm not planning on putting this into production or anything; I'm just trying to get up to speed with the codebase by trying things out.

I've been going through the documentation, and starting to update it based on the current API.  Pull requests are forthcoming.

I'm super enthusiastic about this project, and I would like to help in any practical way.

BR,

James Graves

Spencer Kimball

unread,
Nov 18, 2014, 3:34:26 PM11/18/14
to James Graves, cockro...@googlegroups.com
That's fabulous. Really happy to have you join the project! Looking forward to upcoming pull requests.
Reply all
Reply to author
Forward
0 new messages