Software Development / Technology / Tools

Encore Models, Builds the Backend Designed in Your Head

10 May 2022 4:00am, by

When Encore founder André Eriksson became a developer at Spotify, he found the work of building backends for cloud applications mundane and repetitive, far from the rush he felt while collaborating with World of Warcraft maker Blizzard as a teenager.

The Swedish backend maker on its website refers to those repetitive backend tasks, for the developer at least, like being a hamster on a wheel. His idea behind Encore is to make it easier and faster to get to the fun part of software development.

“I personally was spending the vast majority of my time as an engineer, just doing the same type of work over and over again, managing the infrastructure, configuring things, you know, all that sort of repetitive and undifferentiated tasks that are just the daily life of building backends for the cloud these days,” he said. “And then looking around, I noticed every single team was doing that. And then looking outside of the company, every other company was also doing the same thing.”

The company was exploring available tools, but not finding they provided that much benefit, he said. After thinking long and hard about the problem, he decided that the core issue is that engineers spend so much time building systems that have no idea what they’re trying to do.

So he set out to build a system that, in effect, could read your mind. Sort of.

“In order to help developers do their job more effectively, we need tools that actually understand what developers are trying to do,” he said. “We’re all used to all these tools that really have absolutely no idea what you’re trying to do; they don’t understand that you’re building a backend at all.

“Even the ones that are backend-specific, they don’t understand what your backend is about; they don’t understand how it fits together. And when you don’t have that understanding, you’re very limited in your ability to actually aid developers in getting their job done. And that’s where Encore is different.”

Rules-Based Engine

Written it Go, Encore is designed to match the design in the engineer’s head, an approach it calls the Encore Application Model.

With any programming language, you have a compiler and a parser that analyzes your code, then builds a binary that you then run on a server.

“Encore is essentially another layer on top of that, where we add additional rules to how you’re expressing backend concepts like, ‘This is how you define an API. This is how you query a database, this is how you define that you need a queue for a cache or whatever.’ So you have all of these really important concepts in building distributed systems that come up over and over again, and we’re taking them and turning them into native concepts that you express in a certain way,” he explained.

Essentially, Encore runs a set of opinionated rules atop your cloud account and its Backend Development Engine requires they be followed.

“We have a parser, which works just like a regular compiler for programming language, that is then parsing the code and enforcing those rules: ‘Oh, you’re trying to query a database, but you’re not following Encore’s rules.’ So in a way, it’s a programming language built on top of Go that instead of compiling it into a binary, it’s compiling it into a description of a distributed system … which is like, here are all the services, here are all of the different endpoints, here are the requests and the response schemas, here is where you’re doing an API call between this service and that service. Here’s where you’re defining a database or a key-value store. Here’s where you’re querying the database.

“So it becomes this really, really rich description of how your whole system fits together. And it very much models the mental model of the engineers that are building that system, because that’s how they think about this,” he said.

Using static analysis of the metadata, it creates a graph of your system, much like if you were drawing this out on a whiteboard, with boxes and arrows representing systems and services and how they communicate and connect to the infrastructure.

It provides the ability to:

  • Provision and configure cloud infrastructure and the ability to port between providers
  • Automatically generate routine boilerplate
  • Instrument your application with distributed tracing
  • Generate interactive API documentation and keep it updated
  • Implement an idiomatic approach to secrets management.

Hosted on Your Cloud Accounts

Encore doesn’t want to host your software. While it does offer hosting to help startups and hobbyists get up and running quickly, for production it runs atop your cloud accounts on Amazon Web Services, Azure or the Google Cloud Platform.

It makes much of its open source roots and your control of your cloud accounts, stressing that if, for whatever reason, you want to leave Encore, you still own the data and access to those accounts.

It’s a full-fledged programming tool, just at a slightly higher abstraction level that’s dedicated for building cloud-based backends, Eriksson said.

“Most of the engineers that are using Encore are actually very experienced. They come from a world where they know how to do all of this stuff with cloud infrastructure and scalable distributed systems. They’re just fed up with it. They actually want to build products, not mess around with all of that toil. And they really like that Encore enables them to do that,” he said.

Going Forward

Eriksson launched Encore along with Marcus Kohlberg, also a Spotify alum, in 2021. It touts an engineering team with experience at Google and the UK-based online bank Monzo. The company open sourced the Encore Go Framework last year under Mozilla Public License 2.0. It’s the basis for the Backend Development Engine, announced recently along with a $3 million seed round led by Crane Venture Partners.

“Encore is dramatically changing the developer experience for building distributed systems in the cloud,” said Krishna Visvanathan, cofounder of Crane Venture Partners. “It stands apart because of its ability to deeply understand source code and automate what would otherwise slow development and business to a halt, while giving developers the freedom to develop for any application or cloud environment. Encore is a clear leader and first mover in this space.”

With its experience with large-scale distributed systems, it’s looking to solve those problems, but provide a compelling product for startups as well.

“I think this approach, which is very opinionated, and really focuses on a very integrated approach, where we can actually make investments into solving problems that large engineering organizations never have the time to get to. I think there’s substantial value there on the enterprise side of really sophisticated analysis about how your systems fit together and work,” Eriksson said.

He noted that if you’re into game development you use a game engine like Unity or Unreal Engine. But to build a backend, traditionally, you just open a file and start typing.

“So there’s this real massive difference in experience and integration between the game industry and the backend industry. And that’s kind of where we want to take this, providing a really powerful and integrated experience that improves on not just for individual developers, but how you collaborate, and how you’re working in teams, and how whole organizations work.

“And then going beyond developers into insights and analytics and machine learning and data,” he said, of the long-term vision.

“On the more immediate horizon, it’s much more about how do we take this experience …and making it more accessible to larger companies that want to integrate it with already existing systems and backends, being able to seamlessly integrate it with existing infrastructure, and that sort of thing.

“And then just adding more cloud primitives, as we call it, the building blocks of distributed systems, like caches, and queues and object storage, and all these sorts of things that you’re building back inside of these.”

Brian Ketelsen, cloud developer advocate at Microsoft, is a fan. He gushed in email:

“I have used Encore for a few projects now, and I’m completely in love. The first project was an ambitious conference management platform undertaken with a few volunteers in the Go community. In just a few weeks we were able to put together a complete conference management system that included everything a conference needs: ticketing, program scheduling, call for papers, room management and more. It was really easy to onboard new volunteers to help with the code and everyone was impressed with the speed at which we were able to develop. This project was just over a year ago, so it was built using an older version of Encore’s platform.

“More recently I was invited to do a keynote for DevWeek Mexico. I knew Encore was planning a 1.0 launch around the same time and they had just released Azure support. I work for Microsoft as an Azure cloud developer advocate. So I decided to build a Life API as a demo app for the keynote.

“My goal was to create an API that covered all of the things I would manually do as a developer advocate. I have a new baby at home with some severe medical issues, and we ended up spending much of the time I had planned to write my talk and app in the ICU with the little one. We got home on Friday – my keynote was Monday. I was able to build out the entire API and build a new website that consumes it in just a few hours over the weekend.

“To say that I’m impressed with Encore would be a gross understatement. From a functional perspective, Encore is built for developers. The development experience is well crafted with almost zero friction after installing the encore command-line app and creating an account. The Encore platform allowed me to write only the business logic for my application instead of spending countless hours setting up hosting, continuous integration, automated deployments and the rest of the operational things that drag a new project down in the beginning. For a smaller project like mine, that probably saved me a total of 15-20 hours of time.

“Operationally, Encore really shines. Because Encore’s tools analyze the code I’ve written, they are able to inject all the boring boilerplate that I hate writing. Yes, I want distributed tracing; No, I don’t want to annotate every function with dozens of lines of repetitive code to make it happen. Once my code was deployed, I could go to the Encore dashboard and view distributed traces and detailed logs. That “single pane” approach to ops is such a wonderful simplification from the usual suite of 5-8 different tools a team might use to manage a deployed application.

“Treating RPC calls as local function calls in code is another delightful time-saver. Instead of writing my API as a big monolith, I decided to break each functional area into separate microservices to explore how well Encore worked in an environment where there are many services exposed with public and private (internal) endpoints. Everything about the process was smooth and boring in the best possible way. Encore manages database connections, secrets, database migration, logs and infrastructure. That’s SO MUCH code I didn’t write.

“Every tool like Encore that is designed to speed up development comes with tradeoffs. As a developer, it is your responsibility to understand the tradeoffs that come with the decisions made on your behalf by the tools.

Encore was clearly built by people who understand both the needs of the developer and the needs of the ops crowd. There aren’t any decisions in their platform that I couldn’t accept and embrace. The icing on the proverbial cake is the ability to host the application on my own Azure subscription so I’m not dependent on someone else’s cloud.”