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

[YSQL] Support Listen/Notify #1872

Open
m-iancu opened this issue Jul 23, 2019 · 21 comments
Open

[YSQL] Support Listen/Notify #1872

m-iancu opened this issue Jul 23, 2019 · 21 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) integration/graphql/hasura Features related to running Hasura GraphQL on YugabyteDB kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Milestone

Comments

@m-iancu
Copy link
Contributor

m-iancu commented Jul 23, 2019

Jira Link: DB-1793

@m-iancu m-iancu added area/ysql Yugabyte SQL (YSQL) integration/graphql/hasura Features related to running Hasura GraphQL on YugabyteDB labels Jul 23, 2019
@m-iancu m-iancu added this to the v2.0 milestone Jul 23, 2019
@m-iancu m-iancu added this to To do in YSQL via automation Jul 23, 2019
@adamfeldman
Copy link

adamfeldman commented Aug 2, 2019

Thrilled to see YugaByte is exploring Hasura support!

@adamfeldman
Copy link

It looks like Hasura (and Prisma) is now supported: https://docs.yugabyte.com/latest/develop/graphql/hasura.

Was Listen/Notify implemented in YugaByte to support Hasura?

Or did Hasura change something to support YugaByte? About a month ago I checked-out Hasura's codebase and found that their main use of Listen/Notify is to watch for schema changes: https://discordapp.com/channels/407792526867693568/428469959530643466/611662653630316548

My apologies if this discussion is off-topic for this Listen/Notify Issue.

@schoudhury
Copy link
Contributor

schoudhury commented Sep 17, 2019

@adamfeldman thanks for the question. YugabyteDB does not yet support Listen/Notify so Hasura features that depend on such support won't work for now. We are in design discussions with the Hasura team on how best to implement this. We will update this issue as the design gets finalized.

@frink
Copy link

frink commented Nov 13, 2019

Since YEDIS PUBSUB is already well supported, in theory this should be able to use the same plumbing. Ideally, it would be fairly magical if channels could be shared by the two front ends so that messages could be sent and received by either API.

@frink
Copy link

frink commented Nov 21, 2019

@schoudhury Any particular reason why this was moved out of v2.0? Just curious...

@schoudhury
Copy link
Contributor

The solution is non-trivial in a distributed database like YugabyteDB. One approach that we would like to explore is to use YugabyteDB's Change Data Capture (CDC) stream. But CDC is itself is active dev (currently in Beta and moving towards GA in 2.1) so would like to pick this up after the 2.1 release.

@frink
Copy link

frink commented Nov 22, 2019

Thanks for the explanation.

Brokering messages in a cluster is definitely painfully complex. Good idea to reuse optimized components. But I still don't understand why not reuse the existing Yedis PUBSUB. It seems on the surface like a simpler option. After all, Postgres LISTEN / NOTIFY is functionally equivalent to Redis PUBLISH / SUBSCRIBE... Is Yedis PUBSUB going to CDC stream as well?

@ddorian
Copy link
Contributor

ddorian commented Nov 22, 2019

@frink

After all, Postgres LISTEN / NOTIFY is functionally equivalent to Redis PUBLISH / SUBSCRIBE...

LISTEN/NOTIFY is transactional , there are probably more differences compared to redis.
Postgresql has process-per-connection, which is inefficient compared to redis (async polling)

Is Yedis PUBSUB going to CDC stream as well?

YEDIS layer is currently on maintenance. No new features are planned. See: https://docs.yugabyte.com/latest/yedis/ (@m-iancu can explain)

@frink
Copy link

frink commented Nov 27, 2019

Okay. That makes a lot more sense...

If you've got to include all the transaction overhead then it's going to be a huge mess to do. Never going to be as performant as Yedis PUBSUB. This probably also means that there cannot be cross talk between the two. (Which is sad, but I get it...)

Thanks for the commentary.

@jcmoore0
Copy link

Awesome. Any update on this one?
I am very interested to begin testing a migration.

@ddorian
Copy link
Contributor

ddorian commented Dec 17, 2019

@jcmoore0 listen/notify is not in the near term roadmap
maybe we can find a workaround for your application
you can find me on slack

@FranckPachot
Copy link
Contributor

To add in the list of software that require LISTEN/NOTIFY to get notified of schema changes

@xvaara
Copy link

xvaara commented Jun 2, 2022

PostGraphile also uses LISTEN/NOTIFY for realtime subscriptions. https://www.graphile.org/postgraphile/subscriptions/

@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 8, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed kind/bug This issue is a bug labels Aug 24, 2022
@apatrida
Copy link

see also #12714

@St4NNi
Copy link

St4NNi commented Feb 12, 2024

We would also love to have this feature, currently we are working around this via a separate notification system but keeping this in perfect sync with yugabyte is not an easy task.

@jhg03a
Copy link

jhg03a commented Feb 16, 2024

The Graphile Worker job queue system is dependent on LISTEN/NOTIFY

@ammirator-administrator
Copy link

Is Hasura compatible with Yugabyte?
I have a yugabyte db started using the official Helm chart
And hasura successfully connects to it, but when running the migrations for some reason hasura tries twice to run these and then fails because tables already exists

So my understanding is that is not yet compatimble, at least the OSS version

Has that something to do with this issue?

@Bessonov
Copy link

Bessonov commented May 5, 2024

@ammirator-administrator, one year ago, I used Hasura with Yugabyte, and it worked very well on its own. I discontinued this setup because Yugabyte's DDL operations were too slow and not transactional. I believe it's best to create a small, reproducible example and open an issue on Hasura side.

@ammirator-administrator
Copy link

ammirator-administrator commented May 5, 2024

Yes I come to the same conclusion,
I was able to connect these and run the migrations finally)
But why is it that slowww ~ "My first impression"
Yes I guess I'll have to investigate other solutions for now, and move from Yugabyte to something else
Running a query fro minutes) is just inacceptable for every type of application

@FranckPachot
Copy link
Contributor

FranckPachot commented May 5, 2024

But why is it that slowww ~ "My first impression"

@ammirator-administrator are you talking about DDL or regular application queries?
For DDL, PostgreSQL approach (transactional) is nice on empty schema but locks the catalog for the whole duration. That doesn't scale in a distributed database as the catalog is shared.
For regular queries, the defaults may not fit your application. Do you have some example of slow queries?

@ammirator-administrator
Copy link

I'm trying to use with hasura
And I'm talking about the default query Hasura does to retrieve the tables schema
This or takes forever or returns timeout errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) integration/graphql/hasura Features related to running Hasura GraphQL on YugabyteDB kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Status: No status
YSQL
  
Backlog
Development

No branches or pull requests