Today's Deep-Dive: AnyCable
Ep. 318

Today's Deep-Dive: AnyCable

Episode description

This episode explores the complexities of real-time communication and introduces AnyCable, a dedicated real-time server designed to simplify and enhance reliability. It highlights that while WebSockets are common for real-time features like instant chat, they often lack delivery guarantees, leading to lost messages during connection drops. AnyCable addresses this by buffering messages and using sequence identifiers to ensure guaranteed delivery, even after significant outages. The system offers flexibility with open-source, managed SaaS, and on-premise Pro versions, integrating with various backend systems. Security is a key benefit, especially for on-premise deployments, allowing for complete data sovereignty and compliance with regulations like HIPAA. AnyCable provides developers with pre-built abstractions like channels and presence tracking, promoting cleaner code. It utilizes a fast messaging system called NATS, which can be configured to work with existing infrastructure. Use cases range from secure health tech chats and streaming AI responses to scaling web development tools like Hotwire and managing IoT applications. For getting started, users can choose between a free managed SaaS option, a paid on-premise Pro version with advanced features and support, or a free open-source version. The document emphasizes the flexibility to switch between these options without code changes. Finally, it poses a thought-provoking question about the cost-effectiveness of a fixed on-premise license versus usage-based managed services for rapidly growing products. The episode concludes with a thank you to their sponsor, Safe Server.

Gain digital sovereignty now and save costs

Let’s have a look at your digital challenges together. What tools are you currently using? Are your processes optimal? How is the state of backups and security updates?

Digital Souvereignty is easily achived with Open Source software (which usually cost way less, too). Our division Safeserver offers hosting, operation and maintenance for countless Free and Open Source tools.

Try it now!

Download transcript (.srt)
0:00

Welcome back to the Deep Dive. Today, we're tackling something that sounds maybe a

0:04

bit complex on the surface, real time communication.

0:07

Right. Think instant chat, live document editing, those stock tickers that just

0:12

move.

0:13

Exactly. Stuff that feels essential now, but when it breaks, the whole experience

0:18

just crumbles.

0:19

Yeah, it really does.

0:20

So we've got some great source material here focused on any cable, which is a

0:24

dedicated real time server. And this dive is really for you, the learner.

0:29

We want to give you a shortcut.

0:30

A shortcut to understanding why reliable real time is actually quite hard to build

0:35

yourself.

0:35

And more importantly, how a system like AnyCable makes it, well, dramatically

0:40

easier and crucially more reliable.

0:42

It's dot on.

0:43

Before we get into the weeds, though, a quick shout out to the supporter making

0:47

this deep dive possible. Safe Server.

0:49

Yeah, huge thanks to them. They help with hosting exactly this kind of powerful

0:53

software.

0:54

And they support digital transformation efforts generally help to get those

0:57

ambitious projects running smoothly.

0:59

Definitely check them out. You can learn more about their hosting and digital

1:02

support at www.safeserver.de.

1:05

That's www.safeserver.de.

1:09

All right, let's dive in.

1:11

Okay, so our mission today, absolute clarity for you.

1:13

The source material zeros in on how AnyCable delivers guaranteed reliable two way

1:19

communication.

1:20

So the goal isn't just knowing it's reliable.

1:22

No, it's understanding the how the mechanism behind it and how that tackles the big

1:27

headaches like, you know, dropped

1:28

messages and scaling up.

1:30

Got it. And looking at the sources, what jumps out is flexibility.

1:35

AnyCable isn't locked into one way of doing things.

1:38

Not at all. There's an open source version, a managed source option software as a

1:42

service and an on-premise pro

1:44

version.

1:44

And it works well with the big players like Rails, JavaScript, TypeScript.

1:47

But honestly, the sources say it integrates with pretty much any backend system you

1:52

might have.

1:52

Okay, let's establish the baseline then.

1:54

What do we mean by real time?

1:56

We're talking low latency interaction.

1:58

Things happening ideally within milliseconds.

2:00

The usual tool developers reach for is WebSockets.

2:02

Right. Those persistent connections between the browser and the server.

2:05

Exactly. But the fundamental issue with many basic WebSockets setups is, well, they're

2:12

fragile.

2:12

They often lack delivery guarantees.

2:14

Meaning, if your internet connection hiccups for even a second.

2:18

And let's be honest, that happens all the time, especially on mobile.

2:21

Oh, yeah. All the time.

2:22

Those messages sent during the blip, usually they're just lost, gone forever.

2:27

And that's the core pain point.

2:28

Any cable is built to solve, right?

2:30

That reliability gap.

2:31

Precisely. It's engineered to automatically recover messages missed during those

2:37

tiny

2:37

connection drops, the ones you barely notice on Wi-Fi even.

2:40

And also the longer ones, like if you go into a tunnel or an elevator.

2:43

Yeah, those two. It handles both micro interruptions and more significant outages.

2:48

OK, but how does it do that?

2:49

What's the mechanism the source has mentioned?

2:51

So instead of just letting the connection die and hoping for the best when it comes

2:55

back, any

2:56

cable buffers messages on the server side.

2:58

Buffers them, like hold on to them.

3:00

Exactly. And it uses unique sequence identifiers for every message.

3:04

Think of them like numbered packages being sent.

3:06

OK, package number one, package number two.

3:08

Right. So when your connection comes back online, maybe after that elevator ride,

3:12

the

3:12

client says, hey, the last package I got was number 10.

3:15

Then the server knows.

3:16

The server knows to send packages 11, 12, 13 and so on in the correct order.

3:20

Everything you missed is restored.

3:22

Ah, OK. So it effectively guarantees delivery without me, the developer, having to

3:28

write

3:28

tons of complex code to handle disconnections and retries.

3:32

That's the core value proposition.

3:34

It solves that specific real time problem so you don't have to.

3:37

The sources even mention an emulation showing how it handles failures and restores

3:41

messages.

3:42

That sounds incredibly useful.

3:43

But I have to ask, is there a trade off?

3:45

Does adding this layer of guaranteed delivery and buffering impact performance or

3:51

add

3:51

complexity compared to just using a basic, maybe less reliable WebSocket library?

3:56

That's a fair question.

3:57

The sources indicate that, yes, compared to a completely raw, no guarantees WebSocket

4:02

connection, there's a slight overhead.

4:04

But any cable is built in Go.

4:06

Which is known for being pretty fast and efficient.

4:08

Extremely efficient, especially with memory.

4:11

The pro version is even more optimized in that regard.

4:14

So the trade off is really quite small.

4:16

You accept a tiny bit more system complexity upfront.

4:20

In exchange for not having to build and maintain that complex reliability logic

4:25

yourself.

4:26

Exactly.

4:26

And you gain reliability that's been battle tested in large scale apps for over

4:31

seven

4:31

years, according to the sources.

4:33

That kind of track record speaks volumes.

4:35

Okay, that makes sense.

4:37

Let's shift gears a bit.

4:38

Security and structure.

4:40

Security is obviously critical, especially with data flying back and forth

4:43

constantly.

4:44

Absolutely paramount.

4:45

The sources mentioned that for the on-premise versions, that's the pro and the open

4:49

source

4:49

one. Right. The ones you host yourself.

4:51

All the real time data, maybe sensitive chat messages, stays entirely on your

4:55

servers.

4:55

Correct. It never has to be sent to a third party service provider.

4:59

And the significance of that is?

5:00

It's huge. It means you maintain complete data sovereignty.

5:04

This makes the setup inherently more secure.

5:07

And crucially, it helps meet strict compliance requirements like IPA in health care.

5:12

Ah, IPC.

5:13

Right. So if you're handling patient information, you can't just route it through

5:18

some

5:18

random cloud service.

5:19

Precisely. Keeping it on-premise under your control is often non-negotiable for

5:25

that kind

5:25

of sensitive data.

5:26

Makes sense. OK, from security to code structure.

5:30

The system provides time-tested abstractions.

5:33

What does that mean for a developer?

5:35

It means you get building blocks that guide you towards cleaner code.

5:39

Things like channels, which are like isolated communication lines for specific

5:43

features.

5:43

So maybe one channel for chat, another for notifications.

5:46

Exactly. And things like handling subscriptions automatically and presence tracking,

5:51

basically, knowing who's online right now.

5:54

These aren't novel ideas, but having them built in and robust helps you write

5:57

maintainable code from day one.

5:59

And the sources mentioned higher level stuff like collaboration features are coming

6:03

soon. Yeah, seems like they're building on that solid foundation.

6:05

What about the infrastructure needed?

6:07

Does this require a whole bunch of extra complex servers?

6:10

Surprisingly, no. The sources emphasize simplicity here.

6:15

At its core, AnyCable uses a standard HTTP API,

6:20

which every developer understands, and an embedded NATS PubSub server.

6:24

Okay, NATS. Can you explain that briefly for the learner?

6:27

Sure. NATS is a high-performance messaging system.

6:30

Think of it like a super fast, reliable switchboard for data.

6:34

It makes sure messages published by one part of the system get delivered quickly

6:38

to all the interested subscribers. AnyCable bundles it in.

6:41

But what if I already use something like Redis or even a standalone NATS cluster?

6:46

Then you can just configure any cable to use those instead. It's flexible.

6:49

It adapts to your existing setup rather than forcing a whole new stack on you.

6:53

Okay. That's good to know. Let's make this more concrete.

6:55

Where do these features, the reliability, the on-premise security really shine?

6:59

Let's talk use cases. Right. Real world examples.

7:02

The highest stakes one seems to be secure chats for health tech. You mentioned IPA.

7:06

Yeah, because the pro version can be entirely self-hosted.

7:09

It meets that strict IPA compliance standard.

7:11

This is a huge deal for real time communication in health care.

7:15

And the sources say it's actually used by some large patient doctor communication

7:20

platforms. That's right. And in that context, reliability isn't just nice to have.

7:25

Missed messages could have serious consequences.

7:28

We're talking about software potentially involved in monitoring patients or

7:32

delivering urgent updates. Wow. Okay.

7:35

So reliability down to the second really matters there. Absolutely.

7:38

What about something less critical, maybe more UX focused?

7:43

Well, there's the streaming AI responses example.

7:46

Think about interacting with chat GPT or similar models.

7:49

You don't want that long pause while it thinks. Exactly.

7:52

Applications are using any cable to stream the response back as it's being

7:56

generated. Sometimes literally syllable by syllable, but feels instantaneous.

8:00

Precisely. It dramatically reduces the perceived waiting time, better user

8:04

experience, which often leads to better user retention.

8:07

That's a direct business benefit.

8:08

Makes sense. And for web developers, there's Hotwire at scale.

8:12

Can you explain Hotwire quickly?

8:13

Sure. Hotwire is an approach popular in the Rails ones, but usable elsewhere,

8:18

where you send fully formed HTML snippets from the server over the web socket

8:23

connection, instead of just raw data like JSON.

8:25

The server does the rendering, the browser just slots it in.

8:28

Kind of, yeah. Any cable acts like a performance booster for this,

8:32

making sure those HTML updates arrive instantly, keeping the UI feeling snappy.

8:36

And the pro version adds binary compression.

8:38

Yep. Making those HTML snippets even smaller and faster to send,

8:42

especially useful when you're pushing updates to lots of users simultaneously.

8:46

So health tech, AI, web dev, any other interesting areas?

8:51

The sources mentioned quite a variety, scalable chat apps, obviously,

8:54

live updates for online events, but also more specialized things,

8:58

like processing real time voice streams from APIs, like Twilio media streams,

9:03

often using Go on the back end, and also internet of things, IoT applications.

9:07

Oh, what kind of IoT data?

9:09

Things like streaming GPS coordinates from vehicles or handling data

9:13

from electric vehicle charging stations using a specific standard called OCPP.

9:17

Yeah, open charge point protocol.

9:19

It's the standard for communication between EV chargers

9:22

and central management systems.

9:24

So any cable is handling that real time flow, too.

9:27

Wow. OK, so it really spans from critical health care

9:30

chat to managing EV infrastructure.

9:33

That's quite a range.

9:35

It definitely highlights the versatility of a robust real time layer.

9:39

All right. So for our learner listener, if they're thinking,

9:42

OK, this sounds useful, how do they get started?

9:45

What are the options?

9:46

The sources mentioned three main paths.

9:48

Yeah, which is great for different needs and budgets.

9:51

First up, there's the managed sauce option software as a service. Right.

9:55

This is where the AnyCable team runs and manages AnyCable Pro for you.

9:59

The sources say it's currently free for early users.

10:02

So lowest friction way to try it out, basically. Absolutely.

10:05

Perfect for validating an idea without worrying about server setup.

10:08

Then there's the Pro version.

10:09

This is the one you pay for and run yourself on premise. Correct.

10:13

It's fourteen hundred and ninety dollars per year.

10:15

And that gives you unlimited instances.

10:17

So you can scale it out as much as you need within your own infrastructure.

10:20

And this is the version with the extra benefits.

10:23

Yeah. The sources highlight it's about twice as memory efficient

10:26

as the open source one has features like adaptive scaling based on load,

10:30

that binary compression we mentioned.

10:32

And you get dedicated support from the team. OK.

10:34

And finally, the open source version, which is completely free.

10:38

You can grab the code, deploy it using standard tools like Docker

10:41

or Kubernetes on any cloud provider, Heroku, AWS, wherever.

10:46

And it still has the core features. Oh, yeah.

10:48

Hotwire support, the crucial consistency guarantees

10:51

and built in authentication using JWT. JWT. Remind us.

10:55

JSON Web Token. It's a secure way for the server

10:58

to verify who the user is for each real time message

11:01

without constantly sending passwords back and forth.

11:03

Very standard, very secure.

11:05

What seems really interesting here, looking at the sources,

11:08

is the flexibility to move between these options.

11:10

That's a key point.

11:12

You could start with the free manage SAAS to test things out.

11:14

Then maybe as your app grows and SAAS costs start climbing,

11:18

you might switch to the fixed cost pro license for predictable budgeting at scale.

11:23

Or if you have the team and resources,

11:25

you could move to the free open source version and manage everything yourself.

11:29

And the really critical detail.

11:31

The sources state very clearly,

11:33

no changes are needed in your actual application code

11:36

to switch between SAAS, pro or open source.

11:39

The core API is the same.

11:41

That's huge.

11:42

Avoids a massive rewrite just because your hosting model changes.

11:46

Invaluable flexibility, especially for a growing product.

11:49

And if you do need help, say setting up the pro version

11:53

or preparing for a huge launch.

11:55

Consulting is available.

11:57

The sources mentioned $200 per hour for help with setup,

12:00

deployment strategies, even preparing for load tests

12:03

to make sure you can handle the scale you expect.

12:05

Good to have that safety net. Definitely.

12:07

OK, let's try to wrap this up.

12:09

Synthesizing everything from this deep dive.

12:11

It really shows that reliable real time isn't just about opening a basic connection.

12:15

It's about tackling the inherent flakiness of the Internet.

12:19

Right. The dropped packets, the spotty connections.

12:22

Yeah. A dedicated server like AnyCable anticipates that fragility and compensates

12:27

for it,

12:27

turning those potential loss messages into guaranteed delivery.

12:31

And that removes a massive headache for developers.

12:33

A huge one. Whether you're building a simple chat or a life critical health care

12:38

app,

12:38

you don't have to become an expert in low level network resilience.

12:42

So what does this all mean for you, the listener, when making choices?

12:45

It means you can have both reliable, low latency communication

12:50

and full control over your sensitive data, especially with the on-premise options.

12:54

Which opens the door for those critical applications in health tech, finance, etc.

12:58

But it also just makes for a better user experience in any app.

13:01

That instant feedback from AI, the smooth collaboration,

13:05

the immediate updates that drives engagement and retention, real business value.

13:10

OK, time for our final provocative thought for you to consider.

13:13

We saw that AnyCable Pro has a fixed annual cost $1,490, no matter how many users

13:18

you have.

13:18

Right, flat fee for the license.

13:20

But a typical managed sauce service.

13:22

The cost usually scales with usage.

13:24

More users, more messages, higher bill, often exponentially.

13:27

Pay as you go.

13:30

So here's the question.

13:31

For a product that you expect to grow very quickly, at what point does that upfront,

13:36

fixed investment in an on-premise license like Pro become more cost-effective,

13:41

purely mathematically, than the inevitably rising recurring costs of a usage-based

13:46

managed service?

13:48

When does the math flip?

13:49

That's a great calculation to think about when planning for scale.

13:52

Something to mull over.

13:53

Before we sign off, one more huge thank you to our supporter for this deep dive,

13:57

Safe Server.

13:58

Yes, thank you, Safe Server.

14:00

Remember to visit www.safe-server.de.

14:04

They can help with your hosting, digital transformation,

14:06

and getting platforms like AnyCable running strong.

14:09

That's www.safe-server.de.

14:11

Check them out.

14:12

All right, that's all the time we have for this deep dive

14:14

into the world of guaranteed real-time communication with AnyCable.

14:17

Thanks for learning with us.

14:18

We'll see you next time on the Deep Dive.

14:18

We'll see you next time on the Deep Dive.