Scale out through [StackExchange](https://godoc.org/github.com/kataras/neffos#StackExchange) interface and its completors is a feature that was implemented at neffos v0.0.6. Made after a user feature request[*](https://github.com/kataras/neffos/issues/3) with the five following commits: 1. [New feature: Scale-out using Redis built-in StackExchange implementation](https://github.com/kataras/neffos/commit/4de9b6608fc914beceeb7eedbd2ab1680635b094) 2. [Add the ability to register and use more than one StackExchange](https://github.com/kataras/neffos/commit/860a59d280a8e5cf08530ba24b8be6c1d7da0f39) 3. [Add nats StackExchange and scale-out example](https://github.com/kataras/neffos/commit/71e5a09d0259bb81a596689aa6b465e377311c26) 4. [Add nats support for the new Server.Ask method](https://github.com/kataras/neffos/commit/8a180aaefd6fc330389781e1f015be63e6ea43f7) 5. [Add redis support for the new Server.Ask method](https://github.com/kataras/neffos/commit/9cdddc462c27cdbd6477c3763765755d43587968) 6. [Export nats subject prefix](https://github.com/kataras/neffos/commit/6b65bc4914fe654a648e8081fedc3ac4518be635) Scaling out a neffos app can be achieved by adding just three extra lines of code(!) 1. Import `github.com/kataras/neffos/stackexchange/redis` or `nats` 2. Initialize the StackExchange, e.g. `exc := redis.NewStackExchange(...)` 3. Right after the server := neffos.New add `server.UseStackExchange(exc)`. Each StackExchange contains its own configuration. **How it works** 1. Each client connected to a neffos namespace is subscribed a channel/subject and unsubscribes itself on namespace disconnection. 2. Each time a neffos [Broadcast](https://godoc.org/github.com/kataras/neffos#Server.Broadcast) is called the message directly goes to the registered [StackExchange.Publish](https://github.com/kataras/neffos/blob/9cdddc462c27cdbd6477c3763765755d43587968/stackexchange.go#L26-L28) method, which takes care to publish the message to the correct channel/subject, so subscribers can be notified about this message. 3. Each time a subscriber notified for a new message its [Conn.Write](https://godoc.org/github.com/kataras/neffos#Conn.Write) is responsible to dispatch that message to the client side. 4. The same pattern is used for one to one messaging and [Server.Ask](https://godoc.org/github.com/kataras/neffos#Server.Ask). Use this feature when you have multiple neffos servers hosted independently for a particular neffos app of yours and you want your app to be able to communicate with all of those neffos servers as one. **Next steps** * [[Scale out using Redis]] * [[Scale out using Nats]]