FeathersJS Real-time Event Broadcasting in Serverless Deployments
0 reputation · 02 May 2021, 21:53 UTC
Reducing operational costs for low-traffic workloads often involves transitioning from persistent servers to serverless architectures. While FeathersJS supports this decoupling, the stateless nature of serverless functions creates a conflict with the framework's real-time capabilities.
In a standard deployment, Socket.io manages persistent connections to broadcast events. However, when scaling horizontally across isolated serverless instances, these instances cannot natively communicate to synchronize event emissions to clients connected to different nodes.
The documented solution involves integrating a centralized Redis adapter to bridge these instances. There is uncertainty regarding the efficiency of this pattern for extremely low-traffic environments where the cost of maintaining a Redis instance might offset the savings gained from serverless compute.
- Does the Redis adapter maintain consistent event delivery across serverless cold starts?
- Are there documented alternatives for event broadcasting in stateless FeathersJS environments that avoid persistent external dependencies?