Live data from Hacker News

Why CockroachDB and PostgreSQL Are Compatible

cockroachlabs.com

41–50 of 62 posts

Re: Why CockroachDB and PostgreSQL Are Compatible

#41
post #35

I am truly looking forward for CockroachDB to become the next PostgreSQL for planet-spanning database workloads. In our ecosystem we get more and more requests for CRDB integration. Generally though, I would not say that full compatibility should even be desired. A k/v database simply works differently from a strictly relational database. There are things like shard IDs, avoiding hot spots, deciding on how to paginat…

CockroachDB is not a key-value store though.

You are mistaken, it is a key-value store. It just adds a ton of layers on top of the K/V to offer SQL capabilities.

Re: Why CockroachDB and PostgreSQL Are Compatible

#42
post #27
post #12

Earlier quoted context omitted.

We migrated a medium-to-large (in terms of model complexity, not rows), from PG to CR about a year ago. It went pretty smoothly, but you'll definetly run into issues. (Very happy overall, btw) Every release has improved the compatibility story at an impressive rate. The 20.2 released added partial indexes and enums, which helped close the gap in our app(though, enums don't support binary encoding yet, so might not wo…

Hi, regarding number 3, I have filed https://github.com/cockroachdb/cockroach/issues/58032 . Would love to get your feedback on the proposal; does it address your need? do you have a different idea for how it would work?

[deleted]

Re: Why CockroachDB and PostgreSQL Are Compatible

#43
post #19
post #15

Earlier quoted context omitted.

PostgreSQL enums don't have a binary encoding AFAIK. This is partially why they aren't considered that useful in many contexts vs a fact table. From memory this is because there is no natural binary encoding, you could use the int number of the member in the enum but then you would need to communicate the enum members to the client in some way. PostgreSQL network protocol currently doesn't have such out of band infor…

Whatever the issue, it's compatibility related, as Elixir's PostgreSQL driver (Postgrex) works with PostgreSQL enums but not CockroachDB's enums, and it has to do how the driver encodes the values.

Are Postgrex/Ecto usable with cockroach now?

I’m about to start a new project, and would very much like to utilize an existing cluster.

Re: Why CockroachDB and PostgreSQL Are Compatible

#44
post #35

Earlier quoted context omitted.

CockroachDB is not a key-value store though.

You are mistaken, it is a key-value store. It just adds a ton of layers on top of the K/V to offer SQL capabilities.

In that sense, all SQL databases are just KV stores. They compile SQL into actions on various internal KV stores. CRBD's approach just makes the separation more explicit than most since it's designed to run as a cluster.

Re: Why CockroachDB and PostgreSQL Are Compatible

#45
post #25

The title is deceitful since it is not really compatible.

We do have compatibility gaps -- some big, some small. But I would still call it compatible because it's definitely close enough to use a PostgreSQL driver with it in production. I would be curious to hear your opinion on which incompatibilities are most important to address.

Re: Why CockroachDB and PostgreSQL Are Compatible

#46
post #36
post #35

Earlier quoted context omitted.

CockroachDB is not a key-value store though.

Unless I misunderstood the docs, it is a KV store underneath the abstraction layers: > At the highest level, CockroachDB converts clients' SQL statements into key-value (KV) data, which is distributed among nodes and written to disk. https://www.cockroachlabs.com/docs/stable/architecture/overv...

Sure, but this is an implementation detail. It is designed to be consistent in the style of and support the affordances of more traditional single-node RDBMS.

Re: Why CockroachDB and PostgreSQL Are Compatible

#47
post #24
post #8

Earlier quoted context omitted.

>Cockroach is asking not to take open source and start offering it as a service. Which sounds like completely reasonable thing to do! But i just wrote "be aware of it", with that license i don't consider it "Free Software", just imagine Apache or Nginx would do that. On the other hand I'm totally fine if they want to protect themself from leeches like Amazon/Google/Oracle/IBM.

> imagine Apache or Nginx would do that. Nginx will likely do something similar, very soon. It's not that long ago when F5 bought them, with clear plans to offer paid-only features while the core itself remains open. Give it another 5 years and I expect nginx to propagate some of those special features to the open-source version, but with the restriction that you can't offer them as a service vendor without a specifi…

>Nginx will likely do something similar, very soon.

Ahh the oracle of Delphi...if they do that, everyone will change to caddy or apache and that's exactly why they don't do it.

Amazon/Google etc can give a shit about nginx, if they change the licenses they will just hurt themself.

Re: Why CockroachDB and PostgreSQL Are Compatible

#48
This may be the wrong place to ask this but something about Databases and Pebble DB has been making me curious, and I’ve been loving reading what CDB puts out.

For a single node, strictly K/V workload, does CDB offer any advantages over Pebble? Does pebble have similar concurrent write issues like an SQLite? I wouldn’t think so because it’s split into multiple files.

Then one step further, again for a purely KV workload, if all I need to do is add/delete/update/find a key, would a solution like Couchbase be useful compared to Pebble?

If you even linked an article I would love a starting point.

Re: Why CockroachDB and PostgreSQL Are Compatible

#49
post #40
post #7

Earlier quoted context omitted.

(From the FAQs) How does the change to the BSL affect me as a CockroachDB user? It likely does not. As a CockroachDB user, you can freely use CockroachDB or embed it in your applications (irrespective of whether you ship those applications to customers or run them as a service). The only thing you cannot do is offer CockroachDB as a service without buying a license. - - - - - Cockroach is asking not to take open sour…

So if I write OfftopAPI as a service which basically deploys Cockroach for clients , but adds a thin Node JS API on top , is that ok ? Feels like you could play a game of chicken with them. I know many big companies would probably stick to postgres with this in mind. And also makes it feel like they might just change the license later

Welcome to the "no free software world", now your are in the same position as if you give your customers a Oracle-db access.

Re: Why CockroachDB and PostgreSQL Are Compatible

#50
post #38

Earlier quoted context omitted.

I know how their license negatively impacts me, I don't need some company to tell me that "all is well". I know that thier license means that if my requirements and Coackroach Labs business model diverge, I will be unable to fork the code and build a proper open source community around it. I know that I will (likely) never be able to buy a managed coackroach DB service from any vendor other than CoakroachLabs, no mat…

I don't think your points are totally wrong. I especially think that your points hold water if you were to feel the need to set out to build your community fork or competing hosted offering in the next couple of years. Secondarily, I think that if your company had the resources to staff developers to build out a whole hosted offering, I can tell you that CRL would love to be a partner and understand what's going wron…

I appreciate your thoughts.

A company doesn't have to have the resources to run a managed service in order to benefit from the guaranteed possibility for such an alternative to exist. I don't need to fork a project to benefit from the guarantee that I can fork it and do whatever I like with it.

There is a concept in many open source communities of a "benevolent dictator" project leader. It doesn't matter if the project leader is an individual, or a company. Many open source projects are lead by a single company that dictates how it is ran.

The thing that keeps such dictators benevolent is the Freedom To Fork. Without the Freedom To Fork, how do we guarantee benevolence? The current CRL folks could be the nicest, most wonderful people in the world, but there is no guarantee the company won't change hands, the current folks won't retire or move on, or their motivations don't change and they begin to lose their benevolence.

Sure, CRL may be interested in partnering and playing nice- now. But they hold the keys to the kingdom, and can lock the door anytime they want to.

I simply want the possibility, that if things don't work out, I have options.

But you are right- I do have ideals about how projects like this should get funded and built. And you are right, there are a wide range of reasonable answers. I disagree with them being a fantasy though.

I think Postgres is a great example! There is a long list of companies that are "significant" contributors to Postgres. https://www.postgresql.org/about/sponsors/

This list included consultants, hosting providers (Even the much maligned AWS is a sponsor), and companies that use Postgres.

WordPress/Automatic is another successful example, one with a strong business as community leader. They do well with their consulting and hosting business.

The Linux Foundation umbrella also has a variety of supporters and manage a lot of open source projects.

There are a variety of open source projects that are developed by companies that use them, much of the Apache Foundation projects fall into this category.

Another model that works well for many (I'm not a huge fan of this model) is the Open Core model. If as a user I stick to relying only upon the open source editions of projects like GitLab, I get all the benefits of using open source. (This does not prevent me from buying a commercial license from the company to gain support- if they are willing to support my use of their open source edition in an acceptable manner).

RedHat is pretty successful at selling support and consulting.

Other open source developers do well selling a hosted managed service of their product.

There are a lot of different ways to fund open source projects.

Post reply on HN