I’ve really been enjoying Prisma for my app’s CRUD operations. However, subscriptions are a little bit fuzzy for me.
A requirement for my client is horizontal scalability. I’m planning on using Kubernetes to achieve this, and, as I understand, we simply need to host a RabbitMQ server and point Prisma to its url. I’ve read that more docs are coming soon for that topic, so that’s all great!
Now, my next question is more general. If I have a public facing Yoga instance, and we need to be able to scale that horizontally as well, how do I ensure subscriptions will work properly? It seems like this opens up a can of worms, as users would need to be routed through not only the same Yoga instance but also the same Prisma instance in order for the websocket subscriptions to work. Am I correct in this assumption?
Is there any recommended way to deal with this problem? I could spin up a separate service for the real-time functionality and have those containers be backed by redis or rabbitMQ, then simply talk to it with basic websockets from the client, but we’d rather keep everything in one place, and - more importantly - using GraphQL.
What do you guys recommend?