Skip to content

Commit

Permalink
Add note about the default PubSub implementation
Browse files Browse the repository at this point in the history
Based on [this StackOverflow answer](https://stackoverflow.com/a/43790449/2115623) by @helfer I've added a pretty important note to the README that the default `PubSub` implementation should not be used in production.

I did not realise this and have been running it in production across multiple instances for months now. We've had memory leak warnings and all that, but couldn't pinpoint the source until I randomly stumbled upon that StackOverflow answer. In hindsight it's obvious, but when you're in the middle of a huge codebase with complex real-time requirements it's not obvious at all.
  • Loading branch information
mxstbr authored and NeoPhi committed Oct 5, 2017
1 parent 8e37ab1 commit 1995496
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ Now, GraphQL engine knows that `somethingChanged` is a subscription, and every t
pubsub.publish(SOMETHING_CHANGED_TOPIC, { somethingChanged: { id: "123" }});
```

> Note that the default PubSub implementation is intended for demo purposes. It only works if you have a single instance of your server and doesn't scale beyond a couple of connections.
> For production usage you'll want to use one of the [PubSub implementations](#pubsub-implementations) backed by an external store. (e.g. Redis)
### Filters

When publishing data to subscribers, we need to make sure that each subscribers get only the data it need.
Expand Down

0 comments on commit 1995496

Please sign in to comment.