Cord vs. Automerge
You’re almost certainly here because you’re thinking about adding collaborative features to your product (great idea!) and you’re trying to figure out the best way to do it. There’s a lot to consider, from the type of collaborative features you want to add, to you and your teams’ background and bandwidth. We’re here to help.
In this article, we’ll compare Cord’s SDK to Automerge and explain:
- The difference between Cord and Automerge (and why the two aren’t, actually, competitors)
- The benefits of each
- How to determine which is right for you
What is Automerge?
Automerge is a general purpose data structure and framework for building applications. It enables skilled developers to build complex, real-time, multi-user apps of all sorts. It’s designed to make it easy to work offline and then synchronize that offline data when you come back online. The next time I build a complex app that needs to be local-first, Automerge will be at the top of my list for libraries to build with…especially if that app involves multiple people working on the same data directly.
In general, it’s a great tool if you’re starting completely from scratch.
What is Cord?
Built by engineers from Facebook, Google, and Lyft, Cord is on a mission to make every product multiplayer. We have the expertise and passion to do it…and do it well. Just ask our customers, including monday.com and trumpet.
Use case: building a chat feature
Suppose you wanted to create a basic chat feature for your app. The basic ingredients are:
- A simple UI for showing chat messages back and forth between multiple users
- Some sort of text input – a simple input field is enough to get started
- A backend for receiving the chat messages and distributing them to all the relevant users
- A backend notification system to let users know when there are relevant messages for them
But users these days expect modern features that go beyond this. To create a compelling chat experience, you’ll also need:
- User identity and avatars
- Real-time indicators that show when other people are present
- Typing indicators to show when other people are composing messages
- @mention functionality to pull in relevant people
Building a chat feature with Automerge
As its name suggests, Automerge is great at reconciling multiple representations of the same data object. This is ideal for real-time editing (for instance, when multiple people are editing a Google Doc or Notion page) but people don’t usually collaboratively type chat messages or comments. This is all to say that the power of Automerge isn’t well-used for building features like chat.
You don’t really need conflict-free replicated data types (CRDTs) to build a great communication layer into your app. You can use Automerge Lists to model chat threads, and you can absolutely use Automerge to manage the data objects that represent messages. But that’s roughly where Automerge’s features stop being useful.
Automerge has no concept of messages, typing indicators, @mentions, read receipts, reactions or, for that matter, users. And Automerge doesn’t know what a Slack notification is, or what a reply from an email notification should do.
That means the first thing you’re going to have to decide is a message data format. Are you going to use simple, plaintext messages? Or would you like modern features like formatted text, lists, and hyperlinks?
If you want to support those features, you’ll need to build your own message composer and message renderer. Automerge can absolutely support the data manipulation, but, again, it has no idea about messages or message composers.
Oh, and if you want to support screenshots, in-page annotations, or file uploads, you might be out of luck. Why? Because, while Automerge is a great choice for the client-server communication and data management and can manage multiple messages flowing into a single conversation in real-time, it isn’t so great at storing large blobs of file data.
Finally, notifications. Automerge doesn’t solve for notifications, so you’ll need to explore Sendbird or another similar notification email service.
Building a chat feature with Cord
With Cord, there is no building.
You get sophisticated chat features out-of-the-box. Yep, including screenshots, notifications, in-page annotations, and file uploads.
Best of all, you can implement all of these components in hours instead of spending months building them. (Trust us…things like notifications and screenshot functionality take a lot of time.)
p.s. our customizable CSS allows you to set fonts, colors, and sizes to match your look and feel. Check out our live CSS editor here.
So, which should I use to add collaborative features to my product?
Remember: we’re comparing apples and oranges here.
Cord is built specifically to save you time getting great communication features up and running. Automerge is designed to give you the freedom to build exactly what you want from scratch.
Cord is hosted and managed – you get an API key and we handle the infrastructure. Automerge is a set of tools for developers to build their own infrastructure, and comes with no guarantees of uptime or reliability.
To put it in an extreme way, you could build Cord on top of Automerge (in fact, building the core data model for your business logic with Automerge and using Cord for the collaboration alongside Automerge would be a great way to get a rich application together ASAP…) but you couldn’t build Automerge on top of Cord.
All of that aside, here’s our advice 👇🏽
Use Automerge if…
- You want to build a collaborative application and you have the resources to start from scratch and build from the data model upward
- You have the engineering and design bandwidth to implement the core chat data model, identity management, client-side implementation, server-side implementation, design, notification emails, Slack integration, etc.
- You’re looking for a good tool for the data layer because you know exactly what you want the UX to be
Use Cord if…
- You want an incredible, customizable collaborative experience out-of-the-box
- You don’t want to give up features like notifications, screenshots, and Slack integrations. Cord is like jumping straight to the 10th generation, with all the bells and whistles.
- You don’t want to spend months adding collaborative features to your product. Cord’s implementation is easy-as-pie