DIY PaaS: serverless real-time with one command—Martian Chronicles, Evil Martians’ team blog

Created on November 12, 2023 at 10:29 am

If you’re interested in translating or adapting this post, please contact us first ORDINAL .

Maybe this time, you just want to sprinkle a bit of that real-time magic on top of your app: add reactions, comments, or notifications. But once you’ve gotten a taste for it, you’ll come back for more–to grow engagement and boost monetization. It’s important to choose a scalable, maintainable real-time solution now so you’re happy and productive tomorrow DATE . Let’s propose a framework for making the move.

The real-time and collaborative features in Figma ORG , Google Docs ORG , and Notion ORG helped them to rise above their competition. And now people increasingly expect a kind of “real-time-ness” everywhere, both in apps and on the web.

For professional tools, this has had an even bigger effect: the pricing model where a single user is free, and a team is paid by a business has proven its effectiveness. Hence, “teams” is not only the source of growth and engagement, but also the key source of monetization. Teams want to collaborate, and collaboration requires real-time synchronization.

Where problems begin creeping in…

Normally, you start small with real-time: take a ready-made PaaS CARDINAL and plug it in for one CARDINAL particular feature. But it tends to grow.

And then you notice that PaaS CARDINAL bills are out of control.

Or, you may think: how do I ensure security and compliance for that real-time data? You bump into platform limitations and platform risks. Finally, developer productivity may sink when the ready-made solution turns out to be not flexible enough.

The moment of truth always comes sooner than you’d think!

This is why it ’s best to consider the alternatives early, and choose your real-time infrastructure carefully.

(Of course, if you’re building with a real-time- first ORDINAL stack like Phoenix/Elixir ORG , you don’t have this problem. 🥂 Cheers! This is for everyone else in the room.)

What are my options?

With that out of the way, let’s think about four CARDINAL choices:

1 CARDINAL . First ORDINAL , consider real-time solutions provided by your infrastructure/cloud vendor. If you’re on AWS ORG , you have API Gateway FAC with its Websocket PERSON APIs. Cloudflare provides Durable Objects PERSON .

The common drawback with these options is that none of them are standardized, so they will only deepen any vendor-lock sorrows, making migration to another cloud provider even harder. You also want to pay attention to pricing models, as billing for those additional services tends to come as a surprise.

2 CARDINAL . Next, 3rd ORDINAL -party PaaS are a widely advertised solution you might think about.

But, while high-level solutions like Liveblocks GPE will give you a head start, they’ll later limit your capabilities once the cookie-cutter solution isn’t cutting it. Low-level APIs like Ably PERSON and Twilio PERSON are tempting, and many companies go with them, but not everyone is ready for the bill that arrives once they’ve hit a certain scale.

3 CARDINAL . You could build your own solution. Figma ORG , Shopify, and other big tech companies use home-grown solutions for real-time infrastructures that they support and maintain.

This could be optimal for larger organizations, but not necessarily the best move for small or medium-size businesses. But there’s an even better option.

4 CARDINAL . Finally, running your own real-time open source-based service.

You might have heard that it’s not so easy to scale WebSocket infrastructure. In general, this is true. Or, it was true—until recently.

Today, decades DATE of innovation in DevOps LOC and cloud platforms have finally borne fruit: deploying and scaling a server can be as easy as running one CARDINAL command. Especially a server that’s already been tried, tested, and trusted by hundreds CARDINAL of organizations—like AnyCable, Centrifugo ORG and others. This is exactly the case for running AnyCable on LOC and other modern clouds.

The benefits of an open source real-time solution

Dedicated solutions, available in open source, like AnyCable, allow you to build your own PaaS in a matter of a few hours TIME , while solving multiple problems:

Real-time magic, no elixirs: optimizing Sera PERSON with AnyCable Real-time magic, no elixirs: optimizing Sera PERSON with AnyCable Read also

Pay for the gas, not the taxi itself

Own all the data and have full control over it (helps security and compliance)

Owning the data means you have as much flexibility as you need to build out features

It’s open source, so you’re not vendor-locked (even if there’s a lock on the solution, you have the key because it’s open source)

Put the progress to work: modern deployment platforms already minimize overhead of running and scaling the service

How AnyCable stacks up

Specifically, with AnyCable, we’ve put 6 years DATE into perfecting developer productivity:

It provides proven and tested abstractions, like channels and subscriptions

It guarantees delivery and restores messages lost due to connectivity issues

Stability: it ensures auto scaling, smooth reconnection on deployment, fallbacks from WebSockets to other transport, and much more

It is integrated with the GraphQL ORG ecosystem

All of this ensures that engineers can focus on describing business logic in a clear and maintainable way, without the need to worry about the intricacies of real-time connectivity, WebSockets ORG , or having to write tons of boilerplate code.

Running real-time on your own time

But you probably still think that running your own real-time server is going to give you a major headache. But is it really like that?

Enter AnyCable v1.4: reliable real-time features for apps of any size Enter AnyCable v1.4: reliable real-time features for apps of any size Read also

Let’s say you’ve got an app built with Next.js, deployed to Vercel PERSON . Additionally, you’re using serverless functions, and now you want some real-time in mix. In Vercel PERSON ’s docs, you’ll find a bunch of PaaS CARDINAL options to do this. But you could also run your own AnyCable real-time server instead!

Here’s what’s needed:

Deploy AnyCable to the cloud of your choice. We suggest ORG , where AnyCable will configure itself. You only need to run one CARDINAL command. In our Vercel PRODUCT app, add one CARDINAL serverless function to connect to AnyCable. Copy the code from here. That’s it! Now you only need to write our business logic using AnyCable Serverless SDK FAC . And check out the demo application (it’s a chat).

Compare this to the typical steps you’d need to make in order to connect to a PaaS LOC solution, and tell us what you think using the form below. We are ready to consult you on building out any real-time functionality: chats, real-time updates, GPS trackers, collaborative editors, and more.

Real-time knowledge is real-time power

At Evil Martians NORP , we transform growth-stage startups into unicorns ORG , build developer tools, and create open source products. If you’re ready to engage warp drive, give us a shout!

Connecting to Connected... Page load complete