Building backends can feel overwhelming with so many options out there.
With the right mix of tools and approaches, you can speed up the development process and create robust apps much faster.
Today, we will explore seven practical ways to build backends, each with some powerful combination of frameworks, tools and libraries.
This list will surprise you.
1. Using Encore as a backend framework.
Building scalable apps with cloud services often comes with a poor Developer Experience where Developers end up managing complex infrastructure and doing repetitive tasks, slowing them down.
Encore helps to solve that problem by offering an open source backend framework (for TypeScript and Go) that lets you define infrastructure as type-safe objects in your app, unifying your infra with your application code.
Encore can then automate the infrastructure provisioning and DevOps, by parsing the application code. This allows developers to create production-ready backends quickly, using tools like microservices, Postgres, and Pub/Sub, all without the usual complexity and DevOps hassle. You also get:
✅ Tracing & Logging with local dashboard.
✅ Automatic architecture diagrams give you a real-time overview.
✅ An API Explorer for testing your API endpoints.
As per benchmark code on GitHub, Encore.ts in terms of cold startup times, is over 5x faster than Express and 17x faster than NestJS.
You can watch this intro video to understand most of the things about Encore.
If you're confused about what to build, then you can check the tutorials and the starter apps by the Encore team.
🎯 One solid reason, why Encore?
Encore takes care of cloud infrastructure and DevOps for you. This means you can focus on coding your app instead of dealing with complex setups. It’s perfect for developers who want to get started without all the side hustle of building complex scalable apps.
Encore has 8k stars on GitHub and they also run their discord community with 1k+ members.
2. Backend as a service with ORM.
One of the most underrated ways is to use Backend as a service which removes the complexity of managing server infrastructure and increases the speed of the development process.
🎯 What is Backend as a service?
Backend as a Service (BaaS) is a cloud computing model that provides developers with pre-built backend services such as user authentication, database management, cloud storage, API SDKs, real-time notifications and more.
It helps developers to build the frontend without the headache of managing server infrastructure. Some popular options include Appwrite and Supabase.
🎯 What is ORM?
An Object-Relational Mapper (ORM) is a programming technique that helps developers interact with relational databases using object-oriented programming languages. It acts as a bridge, allowing developers to work with data in the form of objects instead of writing complex SQL queries.
Basically, developers can define their data models in their preferred programming language and the ORM handles the underlying database interactions automatically. This speeds up the development process and reduces the chances of errors, as they work with objects rather than dealing directly with SQL or the intricacies of the database structure.
Prisma ORM is designed to make database interactions easier for Node.js and TypeScript applications. It provides type-safe queries, an intuitive API, automated migrations and uses declarative schema definition to separate database from application logic.
Let's explore the combination of Prisma with both options.
-→ Supabase + Prisma.
⚡ Prisma offers a type-safe query builder for PostgreSQL, reducing runtime errors by making sure queries are checked at compile time.
⚡ The combination of Supabase and Prisma provides a modern development experience with tools like Prisma Studio for data management and real-time capabilities from Supabase, making it easier to build responsive apps.
⚡ The blend of Supabase's real-time features and Prisma's powerful querying builds a strong foundation for complex use cases.
This option is ideal for developers who want a robust PostgreSQL backend with real-time capabilities and type-safe database interactions.
You can read the official guide by Supabase on how to use Prisma with Supabase.
-→ Appwrite + Prisma.
As per GitHub issue 3005, it's still not integrated with the appwrite ecosystem. In that case, you can use the previous option.
⚡ Integrating Prisma will allow developers to manage complex database interactions alongside services like authentication and storage.
⚡ There are SDKs for various frameworks and developers can also implement custom server-side logic.
🎯 One solid reason, why this option?
You get instant APIs and easy database management with almost minimal setup. This is perfect for solo developers or small teams starting quickly with a modern stack.
3. NestJS with TypeORM.
NestJS is a framework for building efficient and scalable server-side applications using Node.js and TypeScript. It provides a structured way of promoting modular architecture (inspired by Angular), dependency injection, middleware, WebSocket communication and the use of decorators.
It uses TypeScript by default and is compatible with various libraries and frameworks such as Express or Fastify. It is also used for building RESTful APIs, GraphQL servers and microservices.
You might have noticed I am recommending TypeORM with Nestjs while it was Prisma in the previous option.
It's because TypeORM uses decorators (such as @Entity
, @Column
) applied directly to TypeScript classes to define the database schema while Prisma uses a dedicated schema file (schema.prisma
) written in its own declarative syntax.
⚡ Both NestJS and TypeORM are built with TypeScript, which provides strong type checking.
⚡ NestJS promotes a modular structure, making it easier to organize code into distinct modules and TypeORM is perfect for this.
⚡ With TypeORM, developers can easily manage relationships between entities, perform migrations and handle transactions, all of which contribute to building a scalable app.
You can read more on the Nestjs official docs on how to get started with TypeORM using Nextjs.
🎯 One solid reason, why this option?
Highly modular and scalable, making it great for developers familiar with Node.js who want to build well-structured backends. You get robust modular architecture with strong community support.
4. Hasura with GraphQL Code Generator.
Hasura is an open source GraphQL engine that connects to your databases and microservices, instantly providing a production-ready GraphQL API.
It instantly generates GraphQL APIs from your database schema, so developers can query and manipulate data without writing extensive backend code.
GraphQL Code Generator is a tool that generates code based on your GraphQL schema and operations, such as queries, mutations and subscriptions. It automates the creation of typed output for different programming languages and frameworks.
How GraphQL Code Generator is a good combination with Hasura?
⚡ The GraphQL Code Generator complements Hasura by automating the creation of TypeScript types and hooks based on the GraphQL schema.
⚡ It eliminates the need for developers to manually define types and interfaces, which saves time and minimizes the risk of typos or inconsistencies between the client and server.
⚡ The generated types serve as a form of documentation for the API, making it easier for developers to understand what data is available and how to interact with it.
⚡ With auto-generated queries, mutations, and subscriptions, developers can quickly implement features without worrying about keeping type definitions in sync with the GraphQL schema.
🎯 One solid reason, why this option?
Instant GraphQL APIs and autogenerated frontend code save time. Great for developers building modern, API-driven apps.
5. Go with Gin.
Go is a statically typed, compiled programming language designed by Google which is known for its simplicity and is a top choice for building high-performance, scalable backends. It’s perfect for developers who need speed and control in their applications.
Gin is an HTTP web framework written in Go (Golang). It provides tools to quickly build RESTful APIs, with features like zero allocation router, middleware support, built-in rendering, JSON validation and much more. It features a Martini-like API with approximately up to 40 times faster in terms of performance.
Why Go with Gin is a great combination?
⚡ Go's speed and simplicity, combined with Gin's minimalistic design and fast HTTP router, make it one of the fastest combinations for building web servers and APIs.
⚡ Go's built-in concurrency model with goroutines enables your backend to scale effortlessly, especially useful for handling high traffic.
⚡ With Gin, you get routing, middleware and request handling out of the box without extra configuration, which lets you focus on building features rather than managing boilerplate code.
You can read the tutorial on how to develop a RESTful API with Go and Gin.
🎯 One solid reason, why this option?
Go with Gin offers blazing-fast performance with minimal overhead, making it ideal for building scalable and high-performance backends. Perfect for developers comfortable in Go and those who want complete control without sacrificing speed.
6. Django with Django REST Framework.
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. It's known for its batteries-included
philosophy and comes with many built-in tools (such as admin panel) that save a lot of effort.
Django REST Framework (DRF) is a powerful toolkit for building Web APIs in Django. It simplifies the process of creating RESTful APIs with features like serialization, authentication, and view handling, all while integrating seamlessly with Django.
Why Django with Django REST Framework is a great combination?
⚡ Django comes with everything you need, including an admin panel, authentication system, and database ORM, so you can build a backend quickly without requiring extra configuration.
⚡ DRF makes it easy to create RESTful APIs by providing built-in features like serializers, viewsets and authentication mechanisms. This reduces the amount of code developers need to write while maintaining functionality. Plus, they also provide a web browsable API interface, making it easier for anyone to test endpoints and interact with the API during development.
⚡ Django’s robust architecture, combined with DRF, offers scalability and strong security features like protection against SQL injection, XSS and CSRF attacks.
🎯 One solid reason, why this option?
A fast, secure and scalable solution for building powerful APIs with minimal setup with Python. Strong community support and built-in tools make it ideal for solo developers looking for reliability.
7. Nextjs with Payload as a nextjs native headless CMS.
Next.js is a popular React framework known for its flexibility in building modern, server-side rendered or static web apps. It makes it easy to create fast, SEO-friendly websites with a lot of useful features like automatic code splitting, dynamic HTML streaming, react server components, automatic optimizations (image, font, scripts), route handlers and much more.
I currently use Nextjs for almost all of my projects.
Payload is a headless CMS built for next.js developers. With the v3 release, it became Next.js native
which means integrating Next route handlers, app routers, and other related concepts smoothly.
I actually used it while it was in beta to test things out and wrote about it in How to get CMS in any Next app with one line.
Why Next.js and Payload is a Great Combination?
⚡ Payload installs directly into your next.js app folder, providing both the admin panel and backend without relying on third-party services. This integration makes the development process smoother by keeping both the frontend and backend in one place.
⚡ Payload offers a nice admin interface for managing content, making it easy to create and organize data models while benefiting from next.js dynamic rendering capabilities.
⚡ With Payload's local API, developers can query and mutate data directly from server components and functions, allowing for fast data management without the overhead of external APIs.
⚡ Developers can deploy Payload anywhere, including serverless environments like Vercel or in containers, giving them the freedom to choose their preferred hosting solution.
It is on a stable version and you can read more on the official blog on how Payload 3.0 is the first CMS that installs directly into any Next.js app.
🎯 One solid reason, why this option?
It's the best way to build modern, content-driven applications by integrating powerful content management directly into the app structure without the complexities of managing separate backend services.
I have tried to cover some less common ways but there are many other great options, such as:
Django + Celery - Excellent for handling task queues and background jobs, especially in projects requiring asynchronous processing. But Celery might introduce complexity if background tasks aren't a core need.
Firebase Functions + Express.js - Firebase Functions, combined with Express.js, offer a serverless architecture that's suitable for dynamic, lightweight apps. They simplify infrastructure management but can become costly as usage scales.
Spring Boot + Hibernate - Strong for enterprise-grade apps but overkill for smaller, individual projects. Good to go if Java is your preferred language.
Ruby on Rails + ActiveRecord - Great for rapid prototyping with its convention-over-configuration approach and extensive automation. While Rails can feel heavy for smaller projects, it’s a great choice for developers experienced in Ruby.
Node.js + Express.js - Popular, lightweight choice for building APIs in JavaScript. Its flexibility can be advantageous but might require more decisions and customizations compared to opinionated frameworks.
Flask + SQLAlchemy - Minimalistic and flexible, making it decent for small projects (to avoid heavier frameworks). SQLAlchemy fits perfectly for database management, without unnecessary bulk. A great choice for Python developers.
FastAPI + Pydantic - Fast and easy for Python developers. It’s lightweight, intuitive and ensures data validation, making it perfect for quick projects.
Laravel + Eloquent - Laravel improves PHP development with its built-in tools and a developer-friendly framework. Combined with Eloquent for ORM, it's ideal for quickly building modern backends, especially for PHP enthusiasts.
And I'm sure there are even more options out there, especially with how fast tech is evolving.
The important thing is to pick ones with a good community so you don't get stuck.
To be honest, this was very hard to write because I was confused about which tech stack to combine to get the maximum output.
These are just the starting points of some of the best ways for developers to build complex backend stuff.
Let me know if you think there are more useful combinations.
Have a great day! Until next time :)
I also run my community for developers and technical writers (200+ members) where I share everything I learn. You can join at dub.sh/opensouls.
If you loved this, please follow for more :) Thank you for reading, Anmol 🥰 |
---|
Top comments (6)
Really cool 😎
Cool!
Nice! Love Encore 👏
👏👏
Awesome list 😃
Indeed!