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

Test Super Graph with Cockroach DB #25

Closed
dosco opened this issue Dec 11, 2019 · 10 comments
Closed

Test Super Graph with Cockroach DB #25

dosco opened this issue Dec 11, 2019 · 10 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dosco
Copy link
Owner

dosco commented Dec 11, 2019

What would you like to be added:

Document what it would take to get Super Graph working with Cockroach DB a distributed database that is designed to be compatible with Postgres. Super Graph makes use of a bunch of Postgres specific features like querying for database tables and columns, lateral joins, json functions etc. I have never tried using Super Graph with Cockroach if someone can take the time to do this and document what worked and what did not. And maybe what it would take to get this working.

Why is this needed:

Since Cockroach DB is Postgres compatible this would help Super Graph work with a massively scalable distributed database and possibly help the Cockroach DB team see what gaps can be filled in their compatibility layer.

@dosco dosco added enhancement New feature or request good first issue Good for newcomers labels Dec 11, 2019
@howesteve
Copy link

howesteve commented Dec 12, 2019

Hello,

Would be a nice feature but several features are lacking:

https://www.cockroachlabs.com/docs/v19.2/postgresql-compatibility.html#unsupported-features

The authorization generator supergraph already implemented could cover the lack of RLS, and lateral joins appear to have recently been implemented.

What bothers me the most is lack of stored procedures, triggers and events. Will be very hard to implement subscriptions, requiring polling, what could overload the server...

@dosco
Copy link
Owner Author

dosco commented Dec 12, 2019

I don't expect a distributed DB to match Postgres feature for feature mostly since implementing these features on a distributed system is much harder than a monolith like Postgres. I'm mostly looking to test if the SQL generated by Super Graph works on Cockroach DB. Lack of RLS, Triggers etc does not affect Super Graph. In almost all distributed DB's those features are implemented app side or using a separate service like Kafka.

@jinxmcg
Copy link

jinxmcg commented Jan 2, 2020

how about yugabyte it has stored Procedures and Triggers

I did not test it though so I don't know if it fits.

@dosco
Copy link
Owner Author

dosco commented Jan 3, 2020

Sure sounds like a great idea. I did some digging and it seems Yugabyte is Postgres compatible and quite feature rich too. I created a separate ticket to track this. #29

@dosco
Copy link
Owner Author

dosco commented Feb 23, 2020

@jinxmcg FYI Yugabyte works with Super Graph https://supergraph.dev/guide.html#yugabytedb

@paulm17
Copy link

paulm17 commented Apr 27, 2022

How is Cockroach DB compatibility going? Thanks

@dosco
Copy link
Owner Author

dosco commented Apr 27, 2022

I have a test in place but haven't gotten around to playing with it more.
https://github.com/dosco/graphjin/blob/00c26bab4c922073ebe09a5b2845fdb466d9832d/core/core_test.go

cd core
go test -v -db cockroach ./...

@dosco
Copy link
Owner Author

dosco commented Apr 27, 2022

Thanks for bringing this up. I got curious seems like it's not too bad most tests pass (fake fail) the tests mostly all pass the failures are because cockcoach seems to randomly sort json key-values. Probably cause they use Go maps internally which has this behaviour. In short the result is correct the test fails to compare the values correctly.

subs_test.go:201: expected '{"users": {"id": 42, "email": "user42@test.com"}}' got '{"users": {"email": "user42@test.com", "id": 42}}'

@paulm17
Copy link

paulm17 commented Apr 27, 2022

Sounds good. Right now I'm developing against Postgres. I'll take a look with CDB when I get some free time next week and will follow up.

@dosco
Copy link
Owner Author

dosco commented Oct 1, 2022

this exists.

@dosco dosco closed this as completed Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants