Any Cables Monthly #21
June, 2024: AnyCable module for Caddy to embed AnyCable into your application server. Mocking WebSockets. To self-host or not to?
Year 2024 just passed its equator (it’s 182 days ‘till 2025!)—have you noticed that? Well, now you know. In other news…
News
AnyCable is on awesome-selfhosted!
Videos
Mock Service Worker is a popular tool to fake APIs for JavaScript applications. Since the next version (available in beta), it supports mocking WebSockets, too! So, you can mock your WebSocket server in integration tests instead of running it (which is especially problematic with PaaS-es).
Releases
Say hello to the official AnyCable module for Caddy! Now you can embed AnyCable into your application server and reduce the number of infrastructure components. (Read more about Caddy in our previous issue).
AnyCable Rails now automatically detects Devise and activates the Warden middleware for RPC requests (so your authentication must work without any additional configuration).
This release introduces Rack 3.1 compatibility.
Frame of curiosity: be your self-hosted
Have you ever wondered how many third-party infrastructure* services your application depends on? Okay, don’t start counting now (it could take time), bear with me for a minute. (*By “infrastructure“ we mean those not responsible for your application business logic.)
In the old days of bare metal servers and HTML 4.0 web applications, we hardly had any third parties involved in the process of deploying and maintaining our code. Cannot believe this? Let’s compare my very first production setup (circa 2010) with what we typically have nowadays (in the old vs. new format):
SVN/FTP vs. Git (hence, we didn't even use GitHub)
make test && cap deploy
vs. CI/CDsendmail
vs. Mandrill/SES/Resend/etctail error.log | grep
vs. Honeybadger/SentryMonit / cron + curl vs. monitoring/uptime services
Erlang/OPT vs. Pusher/Ably (yeah, we were early WebSockets adopters)
No, I’m not going to say that the grass was greener—there was no grass, that was a scorched desert. And it turned out to be very fertile soil—today we rely on many services while operating our applications. Sometimes they go down (and we—for another cup of coffee/tea); the more services you have, the more likely you’re affected by their health — a micro-(third-party)-services problem. (And I’m not even talking about $.)
Thus, although SaaS solutions proved to be helpful, even essential for web applications engineering and operations, it never hurts to consider self-hosted alternatives. Today, self-hosting is very different from 10-15 years ago; it’s not about dealing with tons of scripts and configuration tuning or writing custom code; usually, it’s just about running a single command to spin up a server and configuring it via a web UI—not more complicated than providing your billing information to a third party. The benefits are still the same: cost, privacy, and customizability.
For example, we at AnyCable self-host uptime monitoring via Uptime Kuma and are considering switching to a self-hosted telemetry solution. What about you? (Check out awesome-selfhosted for some inspiration.)