Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CockroachDB #678

Closed
orefalo opened this issue Oct 8, 2018 · 47 comments
Closed

Add support for CockroachDB #678

orefalo opened this issue Oct 8, 2018 · 47 comments
Assignees
Labels
a/data c/other-dbs Related to other DBs for Hasura to support c/server Related to server k/enhancement New feature or improve an existing feature p/longterm Low priority issues that will be picked up based on user feedback or bandwidth triage/1-product-candidate This is a good candidate

Comments

@orefalo
Copy link

orefalo commented Oct 8, 2018

Or any distributed/replicated SQL db alike...

@shahidhk shahidhk added the c/server Related to server label Oct 9, 2018
@stanxii
Copy link

stanxii commented Jan 22, 2019

It is really cool!

@shahidhk shahidhk added k/enhancement New feature or improve an existing feature p/longterm Low priority issues that will be picked up based on user feedback or bandwidth labels Jan 24, 2019
@karibertils
Copy link

would be interesting

@vroad
Copy link

vroad commented May 21, 2019

CockroachDB doesn't support triggers at this moment.
Could Hasura implement event triggers without built-in DB support?

Even if that's possible, events won't be fired if you modify the DB directly.

cockroachdb/cockroach#28296

@vroad
Copy link

vroad commented May 22, 2019

Latest version of CockroachDB now offers support for experiential change feed.
https://www.cockroachlabs.com/docs/v19.1/changefeed-for.html

Could this be used instead of SQL triggers?
I'm not sure if current Hasura implementation assume that trigger is always available regardless of the database you use, though.

@hiralsp
Copy link

hiralsp commented Aug 12, 2019

Is the only thing that's broken is webhooks for db change events? Does everything else work with CockroachDB ?

@marionschleifer
Copy link
Contributor

Hi everyone 👋 this is to let you know that we are aware of the community's request for support for CockroachDB. We will take this up in a few weeks 🙂

@hiralsp
Copy link

hiralsp commented Nov 18, 2019

Any update here?

@marionschleifer marionschleifer added the support/needs-action support ticket that requires action by team label Nov 19, 2019
@coco98 coco98 added the triage/1-product-candidate This is a good candidate label Dec 19, 2019
@gnanakeethan
Copy link

any updates here?

@0x777 0x777 assigned 0x777 and unassigned tirumaraiselvan Dec 24, 2019
@tirumaraiselvan
Copy link
Contributor

Hey everyone, so we did an initial investigation and Hasura doesn't start on CockroachDB out-of-the-box because of Cockroach's different implementation of internal schema and lack of few json operators.

Although now we have more insights into what will go into supporting CockroachDB and we will update this issue when we have a technical spec ready.

@tirumaraiselvan tirumaraiselvan removed the support/needs-action support ticket that requires action by team label Dec 27, 2019
@guru2228
Copy link

guru2228 commented Jan 2, 2020

any updates on this

@hiralsp
Copy link

hiralsp commented Feb 22, 2020

please update, thank you!

@nvcnvn
Copy link

nvcnvn commented Mar 12, 2020

@tirumaraiselvan sorry for the noise.
Do you have a draft technical spec somewhere already? Me and my team are willing to work on this (ofc with guidance, none of us know Haskell).

@rikinsk rikinsk added the c/other-dbs Related to other DBs for Hasura to support label Mar 20, 2020
@madasebrof
Copy link

Plus one for support for CockroachDB! 😄

@nmabhinandan
Copy link

Any updates?

@fritzblue
Copy link

Or any distributed/replicated SQL db alike...

@orefalo Hasura does support YugabyteDB, which is a distributed SQL database with a Postgres-compliant API.

Here is a tutorial on using Hasura and YugabyteDB together.

Yugabyte has a hosted cloud offering that starts with 5GB of storage and 3 nodes on the free tier.

@ChristianHohlfeld
Copy link

Hi everyone 👋 this is to let you know that we are aware of the community's request for support for CockroachDB. We will take this up in a few weeks 🙂

any updates on this? Thank's!

@egorsmkv
Copy link

Also a vote for CockroachDB.

@gerwim
Copy link

gerwim commented May 27, 2021

And another vote!

@fkmatsuda
Copy link

Vote for CockroachDB!

@samiujan
Copy link

any update on this?

Voting for CockroachDB!

1 similar comment
@bamne123
Copy link

bamne123 commented Aug 7, 2021

any update on this?

Voting for CockroachDB!

@orefalo
Copy link
Author

orefalo commented Aug 8, 2021

Closing this issue - I opened it more than 3 years ago yet support has not been implemented.
I believe the enablement is more political than technical. Besides, in the last 3 years, the landscape for distributed sql db that can speak Postgres or MySQL has grown significantly: TiDB, ClickHouse and even the core Postgres platform have made significant steps forward. Using other libraries, you can achieve the desired outcome.

Hope this helps,
Sincerely,
Olivier

@orefalo orefalo closed this as completed Aug 8, 2021
@Bessonov
Copy link

Bessonov commented Aug 8, 2021

I believe the enablement is more political than technical.

Strongly disagree with this statement. Beside that due to linked issue on CRDB side it's technically impossible, it doesn't make much sense. I use now both products (but not together) and both products are great. But without deep support of postgres features like triggers you don't get much power from hasura side and you go right into a dead end. How do you want validate your incoming data? How do you want react on data changes? All that isn't possible with hasura + crdb. Of course you can limit you to some select queries with permissions and handle all stuff with custom backend code... but why? It is a good trade-off to introduce additional component like hasura?

I had great success with hasura + YugaByteDB. But slow migrations make development a little bit uncomfortable. BTW, migrations in crdb aren't faster.

@vy-ton
Copy link

vy-ton commented Aug 9, 2021

Hi, PM from Cockroach Labs here.

But without deep support of postgres features like triggers you don't get much power from hasura side and you go right into a dead end.

We're collecting use cases for triggers, so I would love to learn more about the specific trigger functionality Hasura requires and how you're using them.

@Bessonov
Copy link

Bessonov commented Aug 9, 2021

Hi @vy-ton! I think general trigger usage is well explored. AFAIK hasura on it's own doesn't require triggers at all. But for me the whole point of hasura is to avoid custom backend logic beside hasura and database. This works very well, especially with declarative permission model, API and triggers I can avoid a lot of (boilerplate) code. In fact, currently I don't have any custom backend code at all and ATM less than 1000 LOC of sql/plpgsql code, even it's very verbose (but well I see some features coming, like payment, which are impossible without backend. Not related to your question directly, but to hasura usage: #7012, #7159).

My use cases for triggers are:

  1. Auditing

I've very similar construct to Auditing actions on tables in Postgres, see also linked audit.sql. But there are some differences, which makes usage of hasura very powerful to me. I create not only auditing events with additional information, but also collect users who are interested in this information. For example, if a team name is changed, then all team members are interested in this event. I have a more structured view updates to this information and subscribe to the changes with hasura and websocket. It's very similar to this blogpost, but instead of watch for multiple entities and do expensive permission checks I watch only on this view, which feels very efficient for short polling used by hasura.

  1. Validation

There are multiple relevant use cases, which can't be implemented as check constraints. For example, if a car entity can be connected to not more than four wheel entities. And if there less than 4 wheels, then the car can't be set to available. Probably, not the best example, but I think that makes use case clear. This makes the database more robust against unintended manual/migrations changes.

  1. Synchronize updatedat column

I think this is clear. I course there are other ways to implement that, for example with on duplicate or I think hasura offers some functionality for this. But I go with triggers to have it built-in.

  1. Fill related data

For example, if a user creates a team, then a trigger adds manager permission to the user for that team. (And related to 2.: it's impossible to remove all managers from a team). There are another use cases related to user insertion and data filling, but they are similar.

@andreasgangso
Copy link

andreasgangso commented Oct 20, 2021

Cockroach just launched a serverless offering we are considering to use. I want to bump this as it would be interesting to use that service along with hasura. (excluding features cockroach doesn't support; triggers etc)
Note: Haven't tried it yet, just assuming from above that they don't play well together.

@otan
Copy link
Contributor

otan commented Nov 17, 2021

CockroachDB dev here -- I have a limited subset of Hasura working on a local branch (cockroachdb/cockroach#72407) but requires changes on both Hasura and CockroachDB to make it possible.

We'd like to partner on Hasura on the next steps to get this "to production" and hope to get this up and running soon.

@sethgw
Copy link

sethgw commented Dec 11, 2021

+1 We're looking for this support

@c-nv-s
Copy link

c-nv-s commented Feb 7, 2022

considering that we have had a response from both a project manager and developer from cockroach labs give input on this ticket saying they are interested in making this a reality ( and there is progress ), is it not possible to either reopen the ticket or create a new one to track this to fruition?

@KempWatson
Copy link

Why is this closed? The Hasura website even points to this page as active!

https://hasura.io/docs/latest/graphql/core/databases/postgres/index/

@adamfeldman
Copy link

As an outsider, it appears that Yugabyte and Hasura partnered in some way around June 2021 (Yugabyte blog, Hasura blog). CockroachDB and Yugabyte are fairly direct competitors.

As a user of both projects, it's unfortunate that Hasura won't engage with the Cockroach team here in the open-source workflow on GitHub.

@c-nv-s
Copy link

c-nv-s commented May 6, 2022

well it would be nice if someone from the hasura team could explicity declare that they are no longer open to pursuing this effort. Or if anyone from the cockroachdb team could mention if they no longer have an interest in the effort.

@jannehietamaki
Copy link

I really wanted to use Cockroach in my project, but ended up using Yugabyte because of some kind of Hasura compatibility. Life is not perfect with Yugabyte either, but I'm pretty sure Cockroach Postgres compatibility is so far from being at required level this is not going to happen in the near future.

Also with Yugabyte there are some nasty issues where both Hasura and Yugabyte have tickets but they can't co-operate to get the problem fixed. For example #3549

@otan
Copy link
Contributor

otan commented May 16, 2022

Hi everyone! CockroachDB dev again - sorry for the slow follow up here.

Last I've heard, Hasura is currently working towards making integrations with other databases easier. As soon as we get updates on that, we (on the CockroachDB side and in partnership with Hasura) can look to get the ball moving on this again.

(as always, we're looking at bridging the PG-CRDB gap which will also help)

@otan
Copy link
Contributor

otan commented May 16, 2022

I've filed #8491 as a re-opened version of this ticket in the meantime :)

@DaxGoon
Copy link

DaxGoon commented Jul 29, 2022

I am following this as this is something I want as well.
Add CockroachDB support.

@thewillhuang
Copy link

yes please

@dameleney
Copy link
Contributor

In case you didn’t hear at Roachfest today!!!

Hasura is pleased to announce work is in progress to release CockroachDB as a supported database for the community. We are planning to support queries, mutations, relations, and subscriptions. Now you can have instant GraphQL with one of the most cutting edge distributed SQL databases in the marketplace.

🚀 Sign me up for the beta!!

@dameleney
Copy link
Contributor

dameleney commented Oct 28, 2022

We are pleased to announce the beta release for CockroachDB datasource on the Hasura GraphQL Engine for Hasura CE, Cloud, and EE in v2.15. 🚀 🚀 🚀 Beta release for v2.15 is expected to take place Monday 10/31.

In this beta release Hasura supports Queries and Mutations with plans to add support for subscription before the GA release, which will coincide with the release of CockroachDB v22.2 (tentatively scheduled for early December).

CockroachDB is a distributed SQL database built on a transactional and strongly-consistent key-value store. It scales horizontally; survives disk, machine, rack, and even datacenter failures with minimal latency disruption and no manual intervention; supports strongly-consistent ACID transactions; and provides a familiar SQL API for structuring, manipulating, and querying data.

Together with Hasura, CockroachDB now supports: Instant GraphQL & REST APIs, Declarative Role Based Authorization, Advanced Security and Performance with rate limiting, allow lists, and caching.

@dameleney
Copy link
Contributor

🎉💥 Excited to officially announce the beta release of CockroachDB on Hasura v2.15.0 currently available on cloud and oss versions of Hasura. Support for CockroachDB will be considered GA when the minimum required CockroachDB version, v22.2, which is currently in beta is released as GA and pushed to CockroachDB's managed solutions.

Find out more in this blog post or follow the instructions in the CockroachDB docs to get started building with Hasura and CockroachDB today.

Coming soon!!! We are hoping to release support for subscriptions for CockroachDB in the coming weeks.

hasura-bot pushed a commit that referenced this issue Jun 6, 2024
<!-- Thank you for submitting this PR! :) -->

## Description

Very occasionally these tests fail with the wrong duplicated graphql
name. Not sure why, I assume some unpredictable HashMap ordering
somewhere. In lieu of changing all HashMaps to BTreeMaps in engine
(which isn't immediately possible because of missing `Ord` instances for
`serde_json::Value`), let's make only one set of failing items in these
tests so the same one goes wrong each time.

Functional no-op.

V3_GIT_ORIGIN_REV_ID: 6dff998ae66aedbcca05dd05dc6fcb12e6d704c3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a/data c/other-dbs Related to other DBs for Hasura to support c/server Related to server k/enhancement New feature or improve an existing feature p/longterm Low priority issues that will be picked up based on user feedback or bandwidth triage/1-product-candidate This is a good candidate
Projects
None yet
Development

No branches or pull requests