I cannot help but being saddened by this. It is really hard to understand how not knowing how to interface directly to the part of the system that holds the ultimate reason we write a program (handling data), and probably the performance bottleneck of that system when it scales, is beneficial to a professional developer.
Why CockroachDB and PostgreSQL Are Compatible
51–60 of 62 posts
Re: Why CockroachDB and PostgreSQL Are Compatible
#52Earlier 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.
CREATE TABLE kv (key STRING PRIMARY KEY, value STRING);
But calling that a "key-value" store is disingenuous at best.
Re: Why CockroachDB and PostgreSQL Are Compatible
#53Earlier quoted context omitted.
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 proje…
While I agree that that can work for maintaining existing and valuable projects, I have some doubts that that can work to fund projects getting to that point. Postgres, additionally, grew out of a proprietary commercial enterprise in Ingress and then became usable with a sizable payroll from the University of California (as far as I understand it). I do think that public investment like large grants to fund teams to work on open source software would be a great thing.
I think another factor here is the timing and the context of the moment. There is a turning tide in the data systems world whereby just having something you can run isn't good enough because the overhead to figure out the operations just isn't in the budget when there are hosted solutions out there.
> 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.
This is only somewhat true. The BSL license cockroach uses converts all code to Apache after 3 years. While in the short term this likely means that CRL holds the keys, if this investment builds the quality of product we hope and believe it will, that corpus of code will be available for decades to come. I do appreciate the quality product that is postgres, but I can also say that I've built services that have worked quite well on Postgres 9 which was released over 10 years ago. I'm not saying that good stuff hasn't happened, but that if cockroach is able to fund its way to a somewhat finished project that proves its worth in enterprise deployments, it will have to have been successful and valuable for more than 3 years.
Open core can be okay. CRL engages in some of that too. It's hard to know where to draw the line. I much prefer a 3 year, permissive BSL to the open core enterprise code. Maybe that's just me.
> RedHat is pretty successful at selling support and consulting.
Was pretty successful at it. It's an IBM brand now. Also, it grew up and thrived in the era when you needed a lot of investment and expertise to build, run, and manage datacenters. That world is ending.
Another thing I'll note is that Postgres is fundamentally simpler than crdb, or at least than cockroach would like to ultimately be. WordPress is way way simpler than both of them. Hundreds of engineer years is a pretty steep cost price to get something to that bar of really being valuable. The opportunity cost landscape for software developers alone has shifted what it might take to make a postgres-scale database happen again: my guess is that if the same calliber programmers from the 90s at Berkeley were tinkering on systems getting paid public university wages today, they'd end up in jobs elsewhere pretty quickly.
So yeah, I'd love for it to make sense for everything every company did to be at least big O Open Source, if not even big F Free Software. That'd be a cool world. Imagine the world where everything running Google, Amazon, Microsoft were building blocks we could all learn from and shape to our needs. That'd be sweet. In that world, crdb and crl might not need to exist, and that'd be totally cool too.
Note also that Google and Amazon not just have hosted versions of Postgres, they also have adapted them into new products and they make a heck of a lot of money from those products without sharing any of the tech.
It's not fair to draw direct comparisons from what has worked to what might work today. A 3 year delay for fully permissive licensing is something that lets me sleep pretty well while still leaving me way way more privileged than sometimes feels reasonable.
Re: Why CockroachDB and PostgreSQL Are Compatible
#54Earlier quoted context omitted.
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.
While that's technically true, it isn't in any practical way. What K/V API does CockroachDB offer you as a user? The closest you can get is: CREATE TABLE kv (key STRING PRIMARY KEY, value STRING); But calling that a "key-value" store is disingenuous at best.
Re: Why CockroachDB and PostgreSQL Are Compatible
#55Earlier quoted context omitted.
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.
While that's technically true, it isn't in any practical way. What K/V API does CockroachDB offer you as a user? The closest you can get is: CREATE TABLE kv (key STRING PRIMARY KEY, value STRING); But calling that a "key-value" store is disingenuous at best.
What are the salient differences in your mind? Under the hood, CockroachDB executes writes to and reads from such a table in the same way that you would against a key-value store. You can explore this for yourself with the "kv trace" functionality of CockroachDB's SQL shell, which logs of all of the KV API calls that a SQL query emits:
$ ./cockroach demo
# Welcome to the CockroachDB demo database!
#
# You are connected to a temporary, in-memory CockroachDB cluster of 1 node.
# ...
#
demo@127.0.0.1:26257/test> CREATE TABLE kv (k STRING PRIMARY KEY, v STRING);
CREATE TABLE
Time: 5ms total (execution 5ms / network 0ms)
demo@127.0.0.1:26257/test> \set auto_trace=on,kv
demo@127.0.0.1:26257/test> INSERT INTO kv VALUES('a', 'b');
INSERT 1
Time: 2ms total (execution 2ms / network 0ms)
timestamp | age | message | tag | location | operation | span
--------------------------------------+-----------------+--------------------------------------------------+------------------------------------------------------------+-----------------------------------------+------------------+-------
2020-12-17 23:17:46.626696+00:00:00 | 00:00:00.001123 | CPut /Table/53/1/"a"/0 -> /TUPLE/2:2:Bytes/b | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/row/writer.go:207 | flow | 6
2020-12-17 23:17:46.626754+00:00:00 | 00:00:00.001181 | querying next range at /Table/53/1/"a"/0 | [n1,client=127.0.0.1:49216,hostssl,user=demo,txn=dcce3954] | kv/kvclient/kvcoord/range_iter.go:159 | dist sender send | 8
2020-12-17 23:17:46.626792+00:00:00 | 00:00:00.001219 | r36: sending batch 1 CPut, 1 EndTxn to (n1,s1):1 | [n1,client=127.0.0.1:49216,hostssl,user=demo,txn=dcce3954] | kv/kvclient/kvcoord/dist_sender.go:1851 | dist sender send | 8
2020-12-17 23:17:46.627281+00:00:00 | 00:00:00.001708 | fast path completed | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/plan_node_to_row_source.go:145 | flow | 6
2020-12-17 23:17:46.627322+00:00:00 | 00:00:00.001749 | rows affected: 1 | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/conn_executor_exec.go:622 | exec stmt | 4
(5 rows)
Time: 1ms total (execution 1ms / network 0ms)
demo@127.0.0.1:26257/test> SELECT * FROM kv WHERE k = 'a';
k | v
----+----
a | b
(1 row)
Time: 6ms total (execution 6ms / network 0ms)
timestamp | age | message | tag | location | operation | span
--------------------------------------+-----------------+----------------------------------------+------------------------------------------------------------+-----------------------------------------+------------------+-------
2020-12-17 23:17:54.402735+00:00:00 | 00:00:00.003116 | Scan /Table/53/1/"a"{-/#} | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/row/kv_batch_fetcher.go:337 | materializer | 7
2020-12-17 23:17:54.402763+00:00:00 | 00:00:00.003144 | querying next range at /Table/53/1/"a" | [n1,client=127.0.0.1:49216,hostssl,user=demo,txn=d30bcbc9] | kv/kvclient/kvcoord/range_iter.go:159 | dist sender send | 9
2020-12-17 23:17:54.404565+00:00:00 | 00:00:00.004946 | r36: sending batch 1 Scan to (n1,s1):1 | [n1,client=127.0.0.1:49216,hostssl,user=demo,txn=d30bcbc9] | kv/kvclient/kvcoord/dist_sender.go:1851 | dist sender send | 9
2020-12-17 23:17:54.405091+00:00:00 | 00:00:00.005472 | fetched: /kv/primary/'a'/v -> /'b' | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/colfetcher/cfetcher.go:888 | materializer | 7
2020-12-17 23:17:54.405895+00:00:00 | 00:00:00.006276 | rows affected: 1 | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/conn_executor_exec.go:622 | exec stmt | 4
(5 rows)
Time: 1ms total (execution 1ms / network 0ms)
demo@127.0.0.1:26257/test>
I'll draw your attention to two lines in particular. Here's the put: 2020-12-17 23:17:46.626696+00:00:00 | 00:00:00.001123 | CPut /Table/53/1/"a"/0 -> /TUPLE/2:2:Bytes/b | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/row/writer.go:207 | flow | 6
And here's the get: 2020-12-17 23:17:54.402735+00:00:00 | 00:00:00.003116 | Scan /Table/53/1/"a"{-/#} | [n1,client=127.0.0.1:49216,hostssl,user=demo] | sql/row/kv_batch_fetcher.go:337 | materializer | 7
These operations (`CPut` and `Scan`) are KV operations that you'd be able to run yourself against any key-value store. CockroachDB doesn't give you access to those operations directly, but crafting your queries in this way is really not significantly different.Re: Why CockroachDB and PostgreSQL Are Compatible
#56Earlier quoted context omitted.
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 proje…
> There is a long list of companies that are "significant" contributors to Postgres. https://www.postgresql.org/about/sponsors/ While I agree that that can work for maintaining existing and valuable projects, I have some doubts that that can work to fund projects getting to that point. Postgres, additionally, grew out of a proprietary commercial enterprise in Ingress and then became usable with a sizable payroll from…
I don't think they should be stating that their license decision (versus the open source license they used before) doesn't have any impact on most users, because I don't believe that is a truthful statement. It has pros and cons, like the the various open source licenses themselves have.
I don't think it is fair to wave away the countless examples of profitable open source companies. Sure CRL and CRDB are unique.
I hope CRL is successful! Perhaps one day they will figure out how to make their CRDB open source from day one again. Perhaps one day I will be able to run a large, successful venture using open source software (and supporting it!).
No doubt business and software development are both challenging, regardless of what license or business strategy you choose! I think that is part of what makes them fun!
Re: Why CockroachDB and PostgreSQL Are Compatible
#57Earlier quoted context omitted.
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
#58Earlier 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…
I'd love to know why you decided to make the move if you have the energy to summarise it.
When we ran PostgreSQL, I was using barman for PITR and that was fine. But getting PostgreSQL in HA? My confidence in relation to how critical that piece is? Nope. Even just trying to handle upgrades with no downtime scared me. If I had to do it, I'd look at repmgr.
The story is completely different with CockroachDB. We have 3 instances and taking down an instance (or the server it's on) for maintenance is no problem. The setup also probably couldn't be easier. Most importantly, if an instance goes down in the middle of the night: our app keeps working.
Re: Why CockroachDB and PostgreSQL Are Compatible
#59Earlier quoted context omitted.
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.
Getting your boss to buy into a new tech is hard enough
Re: Why CockroachDB and PostgreSQL Are Compatible
#60Earlier quoted context omitted.
While that's technically true, it isn't in any practical way. What K/V API does CockroachDB offer you as a user? The closest you can get is: CREATE TABLE kv (key STRING PRIMARY KEY, value STRING); But calling that a "key-value" store is disingenuous at best.
Hi Taylor! What are the salient differences in your mind? Under the hood, CockroachDB executes writes to and reads from such a table in the same way that you would against a key-value store. You can explore this for yourself with the "kv trace" functionality of CockroachDB's SQL shell, which logs of all of the KV API calls that a SQL query emits: $ ./cockroach demo # Welcome to the CockroachDB demo database! # # You…