Live data from Hacker News

Why CockroachDB and PostgreSQL Are Compatible

cockroachlabs.com

11–20 of 62 posts

Re: Why CockroachDB and PostgreSQL Are Compatible

#11
post #2

How compatible? Can I just expect things like full text search to work? https://www.postgresql.org/docs/13/textsearch.html What about additional but supplied modules like ltree? https://www.postgresql.org/docs/current/ltree.html I ask as I saw a related article https://www.cockroachlabs.com/blog/full-text-indexing-search... recently and damn it looks close... has anyone migrated a prod system that uses the above? Wha…

> How compatible?

That is literally explained in more than 40% of the article.

Re: Why CockroachDB and PostgreSQL Are Compatible

#12
post #2

How compatible? Can I just expect things like full text search to work? https://www.postgresql.org/docs/13/textsearch.html What about additional but supplied modules like ltree? https://www.postgresql.org/docs/current/ltree.html I ask as I saw a related article https://www.cockroachlabs.com/blog/full-text-indexing-search... recently and damn it looks close... has anyone migrated a prod system that uses the above? Wha…

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 work with your pg driver (1))

Things that are still an issue for us (all can be worked around):

1 - Can't defer foreign key checks

2 - No pg_trgm

3 - Can't tell if an upsert was an insert or an update

4 - No triggers (this is pretty huge)

(1) https://github.com/cockroachdb/cockroach/issues/57348

Re: Why CockroachDB and PostgreSQL Are Compatible

#13
post #7
post #4

If you want to use the CockroachDB be aware of the license: https://www.cockroachlabs.com/docs/stable/licensing-faqs.htm...

(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…

Cockroach is asking not to take open source and start offering it as a service. Which sounds like completely reasonable thing to do!

the BSL is not an open source license, but I can see where they are coming from, and I don't have a problem with it. With the one exception than I bet it will slow adoption, which is really just selfish on my part, because I want to use it and it will be an easier sell the more people are aware of it. Honestly I'm hoping that postgres just adopts the best parts of cockroach and i won't need to keep bringing it up to grossed out managers.

Re: Why CockroachDB and PostgreSQL Are Compatible

#14
post #10
post #9

Earlier quoted context omitted.

BSL is "delayed free software". Take the code, wait 3 years, then it's entirely free software.

>wait X years It's three years, not X.

I wasn't sure. Thanks for checking. three years is a negligible amount of time.

Re: Why CockroachDB and PostgreSQL Are Compatible

#15
post #12
post #2

How compatible? Can I just expect things like full text search to work? https://www.postgresql.org/docs/13/textsearch.html What about additional but supplied modules like ltree? https://www.postgresql.org/docs/current/ltree.html I ask as I saw a related article https://www.cockroachlabs.com/blog/full-text-indexing-search... recently and damn it looks close... has anyone migrated a prod system that uses the above? Wha…

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…

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 information/metadata support.

Re: Why CockroachDB and PostgreSQL Are Compatible

#16
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…

Cockroach is asking not to take open source and start offering it as a service. Which sounds like completely reasonable thing to do! the BSL is not an open source license, but I can see where they are coming from, and I don't have a problem with it. With the one exception than I bet it will slow adoption, which is really just selfish on my part, because I want to use it and it will be an easier sell the more people a…

>> the BSL is not an open source license, but I can see where they are coming from

I wish more people could pause and appreciate this.

I understand little on how an open source license gets approved by OSI body etc. But Im sure there is a need to mitigate threats from AWS and likes.

We can't be far from today from where AWS takes a github URL as input and starts offering it as its own service!

Re: Why CockroachDB and PostgreSQL Are Compatible

#17
post #7
post #4

If you want to use the CockroachDB be aware of the license: https://www.cockroachlabs.com/docs/stable/licensing-faqs.htm...

(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…

There was a different licensing issue around backups, where only the paid version had a reasonable way to back up and restore your data. Has that improved?

Re: Why CockroachDB and PostgreSQL Are Compatible

#18
post #17
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…

There was a different licensing issue around backups, where only the paid version had a reasonable way to back up and restore your data. Has that improved?

Incremental backups are a feature of the Enterprise version. Full data backups are supported with the free version.

Re: Why CockroachDB and PostgreSQL Are Compatible

#19
post #15
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…

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.

Re: Why CockroachDB and PostgreSQL Are Compatible

#20
TL;DR: Because the Postgres folks have outstanding taste, even better documentation, a good community, and a compatible license.

Which are all the same reasons that it's my goto database.

I don't build software anymore, but the last project I worked on for money was a query engine, and the project founders were pretty open about the fact that whenever they were unclear about the behavior required by the SQL spec, they looked at the PostgreSQL docs and behavior to get pointed in the right direction.

Post reply on HN