4 ms·
Show HN: AnyCable – real-time for Next.js, open source alternative to PaaS
You might have heard that scaling WebSocket infrastructure is not an easy task. It was true–until recently.
We built the open source real-time server, AnyCable, that deploys to Fly.io in one command (and configures itself), and the SDK for serverless JS/TS that allows you to build real-time features without any 3d-party PaaS. We call it a real-time server, because it has WebSockets and more, and it’s easy to run and scale.
Here’s all you need to add real-time to your Next.js/Vercel app:
– Deploy AnyCable to Fly.io with one command (see the docs)
– In your Vercel app add one serverless function (copy from docs)
– That’s it! Now you can write our business logic using AnyCable Serverless SDK :https://github.com/anycable/anycable-serverless-js https://github.com/anycable/anycable-serverless-js
Benefits:
– Pay for the gas, not the taxi (unlike the PaaS)
– Own and control data
– Get as much flexibility to build out features as possible
– No vendor lock because it's open source
– Proven and tested abstractions–channels and subscriptions
– Guaranteed delivery and restoration of any messages lost due to connectivity issues
– Stability: we ensure auto scaling, smooth reconnection on deployment, fallbacks from WebSockets to other transport, and many more
– Integration with GraphQL ecosystem
Demo Next.js+Vercel+AnyCable chat app:
- live app: https://vercel-anycable-demo.vercel.app https://vercel-anycable-demo.vercel.app
- source code: https://github.com/anycable/vercel-anycable-demo https://github.com/anycable/vercel-anycable-demo
AnyCable: https://github.com/anycable/anycable https://github.com/anycable/anycable
We hope you will give it a try and tell us what you think!
- quickthrower2 3y agoThis looks interesting. So if I understand right I build a server that talks http to your nodes and you present that to the end user browsers as web-sockets?
- palkan 3y agoYeah, kind of. Client-server commands sent over WebSockets are translated into JS function calls (using HTTP as a transport); the functions could be used to send some data back, set up a subscription, or whatever. Similarly, you can broadcast messages to connected clients via HTTP.