medium.com 17 min read Original Source

Stop Following Tutorials: Build These 5 Backend Projects Instead

Most developers can follow a tutorial and build a backend that works. They can create REST APIs, connect a database, implement authentication, and return JSON responses without much difficulty. The real challenge begins when the application needs to handle duplicate requests, expired tokens, slow database queries, unexpected failures, and users doing things the developer never anticipated.

That is where the difference between knowing a technology and understanding backend development becomes clear. A tutorial usually guides you toward a working result, while a real project forces you to make decisions when there is no single correct answer. You must decide where business logic belongs, how data should be stored, what happens when a request fails halfway through, and how to prevent one user’s actions from affecting another user’s information.

If you are not a medium member? Read it here

The best way to develop these skills is not necessarily to build something enormous. It is to build projects that expose you to the problems backend engineers solve every day. A carefully designed URL shortener can teach you about caching and database indexing. A notification system can introduce you to asynchronous processing, retries, and message queues. An e-commerce backend can reveal why transactions and inventory consistency matter.

Here are five projects worth building if you want to move beyond copying code and start thinking like a backend engineer. Each project has a manageable starting point, a set of increasingly difficult challenges, and lessons that transfer directly to production applications and technical interviews.

1. Build a URL Shortener Like Bitly

A URL shortener looks deceptively simple. A user submits a long URL, the server generates a short code, and anyone visiting that code gets redirected to the original destination. You can build a basic version with a single endpoint and a database collection, but the interesting engineering decisions appear when you consider collisions, malicious links, repeated requests, analytics, and traffic patterns.

This is an excellent first project because it starts with a small feature and gradually introduces several fundamental backend concepts. Instead of building dozens of unrelated CRUD endpoints, you can focus on understanding how one request travels through your application, how the database supports that request, and what changes when the same endpoint receives significantly more traffic.

What should you build first?

Start with two endpoints: one to create a short URL and another to redirect visitors to the original destination. Store each mapping with a unique short code, the original URL, the creation timestamp, and an optional expiration date. You can use Node.js and Express with MongoDB or Java with Spring Boot and PostgreSQL; the underlying design principles remain largely the same.

The short code should be generated in a way that makes collisions manageable. One option is to generate a sufficiently random token and enforce a unique database constraint, retrying if a collision occurs. Another is to allocate a unique numeric identifier and encode it using Base62, which represents numbers using 62 characters. The second approach produces compact identifiers, but sequential identifiers can be easier to enumerate, and distributed ID allocation requires additional consideration.

Here is a simplified Express example for the redirection endpoint:

{
try {
const link = await Url.findOne({
shortCode: req.params.code
});
if (!link) {
return res.status(404).send("Link not found");
}
if (link.expiresAt && link.expiresAt

app.get("/:code", async (req, res, next) => {
  try {
    const link = await Url.findOne({
      shortCode: req.params.code
    });
    if (!link) {
      return res.status(404).send("Link not found");
    }
    if (link.expiresAt && link.expiresAt <= new Date()) {
      return res.status(410).send("Link expired");
    }
    return res.redirect(302, link.originalUrl);
  } catch (error) {
    next(error);
  }
});
app.get("/:code", async (req, res, next) => {
  try {
    const link = await Url.findOne({
      shortCode: req.params.code
    });
    if (!link) {
      return res.status(404).send("Link not found");
    }
    if (link.expiresAt && link.expiresAt <= new Date()) {
      return res.status(410).send("Link expired");
    }
    return res.redirect(302, link.originalUrl);
  } catch (error) {
    next(error);
  }
});

This example demonstrates the basic flow, but it deliberately leaves out several production concerns. The application should validate URLs during creation, restrict unsupported protocols where appropriate, enforce uniqueness at the database level, and apply suitable rate limits. A permanent redirect such as HTTP 301 may be cached by clients, which can complicate destination changes and click analytics, so a temporary redirect is often more convenient during early development.

What will this project teach you?

The first major lesson is that database design affects application behavior, not just storage. A unique index on shortCode prevents two records from claiming the same identifier, even when concurrent requests attempt to create one. An index also helps the database locate a mapping efficiently instead of scanning every document as the collection grows.

The second lesson is caching. Popular links may be requested repeatedly, so you can introduce Redis to store recently accessed mappings. When a request arrives, the application checks the cache first and queries the database on a cache miss. However, caching introduces expiration policies, invalidation problems, and the possibility of serving stale information. It is useful when access patterns justify it, not simply because Redis appears in popular backend architectures.

You can then add click analytics without slowing down every redirect. Rather than performing expensive analytics work before sending the response, the application can record an event for asynchronous processing. This introduces a new question: what happens if the event is lost, processed twice, or delayed?

Finally, protect the service against abuse. Public URL shorteners can be exploited for spam, phishing, and automated traffic. Rate limiting, destination validation, monitoring, and abuse-reporting mechanisms become part of the backend’s responsibilities rather than optional extras.

What makes this project valuable: it teaches request handling, data modeling, indexing, caching, HTTP redirects, input validation, and performance tradeoffs through a single feature that is easy to understand but difficult to perfect.
Practice Here

15 Minutes to Understand URL Shortener System Design
Design a scalable URL shortener system with efficient redirects, unique IDs, caching, and high availability.

2. Build an E-Commerce Backend With Inventory Management

An e-commerce application is one of the best ways to learn why backend development involves much more than creating APIs. A product listing endpoint is straightforward, and creating an order may initially look like another database insert. But what happens when two customers attempt to purchase the last available item at exactly the same time? What if payment succeeds but the application crashes before updating the order? What if a customer clicks the checkout button several times because the page appears frozen?

These scenarios introduce some of the most important backend engineering concepts: transactions, concurrency control, idempotency, state management, and reliable integration with external services. They also demonstrate why a collection of individually functional endpoints does not automatically form a correct application.

Start with the business workflow

Build a backend that supports users, products, shopping carts, orders, inventory, and payments. Keep the initial workflow simple: a customer adds products to a cart, submits an order, and receives a confirmation after payment processing. Each entity should have a clear purpose, and the relationships between them should reflect the business rules.

For this project, PostgreSQL is a particularly useful choice because relational constraints and transactions provide strong tools for maintaining consistency across related records. For example, an order should retain the price and quantity agreed upon at checkout rather than depending on the current product price. Otherwise, changing a product’s price tomorrow could unintentionally change the historical value of yesterday’s order.

A simplified inventory update might look like this:

0
RETURNING id, stock;” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>

UPDATE products
SET stock = stock - 1
WHERE id = $1
  AND stock > 0
RETURNING id, stock;
UPDATE products
SET stock = stock - 1
WHERE id = $1
  AND stock > 0
RETURNING id, stock;

The application should check whether the query returned a row. If it did, the inventory reservation succeeded; if not, the item was unavailable or the product did not exist. Because the condition and update execute as one database statement, concurrent requests cannot both successfully decrement the same final unit from a stock value of one.

This is more reliable than reading the stock into application memory, checking whether it is positive, and then issuing a separate update. Two requests can read the same value before either updates it, resulting in an overselling bug.

Learn to manage transactions and payment failures

A database transaction allows related database operations to succeed or fail together. Suppose an order requires creating an order record, adding its line items, and reserving inventory. If one operation fails, you may need to roll back the other changes to avoid leaving the system in an inconsistent state.

However, database transactions cannot automatically roll back an external payment provider’s successful charge. Payment processing crosses a system boundary, which means your design needs to account for partial failure. A more realistic workflow creates an order in a pending state, reserves inventory, requests payment, and updates the order based on the verified payment result. If payment fails, the application can release the reservation according to its inventory policy.

This is also where idempotency becomes essential. An idempotent operation can be repeated without producing an unintended additional effect. If a customer retries a checkout request because the first response never arrived, the backend should not create multiple orders or charge the customer twice. You can implement this using an idempotency key associated with the customer and checkout attempt, backed by a database constraint and stored operation result.

Extend it into a production-style project

Once the basic checkout works, add order status transitions, payment webhooks, cancellation rules, inventory reservations with expiration times, and a background job that reconciles orders stuck in pending states. Validate webhook signatures and design handlers to tolerate duplicate deliveries, because external services may retry notifications.

Avoid treating order status as an unrestricted string that any endpoint can change. Define valid transitions such as PENDING_PAYMENT, CONFIRMED, CANCELLED, and REFUNDED, and enforce the rules in your business layer. An order that has already been refunded should not casually transition back to confirmed because an old webhook arrived late.

What makes this project valuable: you learn that correctness matters as much as successful responses. Transactions, concurrency control, idempotency, and explicit business rules are useful far beyond e-commerce, including booking platforms, subscription systems, financial workflows, and ticket reservations.
Practice Here

3. Build a Notification System Using Background Jobs

Consider what happens when a user publishes a post and the platform needs to notify hundreds of followers. The backend must save the post, determine who should be notified, create notification records, and potentially send emails or push notifications. Performing every task inside the original HTTP request can make the response slow and unreliable, especially when external services take time to respond.

A notification system teaches you to separate work that must happen immediately from work that can happen asynchronously. This is a natural introduction to queues, worker processes, retries, failure handling, and eventual consistency. These concepts are especially useful in applications involving user activity, scheduled reports, media processing, and large-scale email delivery.

Separate the request from the work

Start by creating an endpoint that accepts an event, such as a new post or a completed order. The API validates the request and stores the necessary business data. It then arranges for notification processing to happen separately, allowing the user-facing request to finish without waiting for every notification to be delivered.

For a small project, a Redis-backed queue such as BullMQ can help you implement this pattern in Node.js. The API enqueues jobs, while a separate worker process consumes them and performs the actual notification work. For larger systems or different operational requirements, a message broker such as RabbitMQ or Kafka may be appropriate, although these technologies have different delivery models and should not be treated as interchangeable.

A simplified example using BullMQ looks like this:

{
if (job.name === "send-email") {
await sendWelcomeEmail(job.data.userId);
}
},
{
connection: {
host: "127.0.0.1",
port: 6379
}
}
);” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>

import { Queue, Worker } from "bullmq";
const notificationQueue = new Queue("notifications", {
  connection: {
    host: "127.0.0.1",
    port: 6379
  }
});
// Called after the relevant business event is recorded.
await notificationQueue.add("send-email", {
  userId: "user-123",
  template: "welcome"
});
const worker = new Worker(
  "notifications",
  async (job) => {
    if (job.name === "send-email") {
      await sendWelcomeEmail(job.data.userId);
    }
  },
  {
    connection: {
      host: "127.0.0.1",
      port: 6379
    }
  }
);
import { Queue, Worker } from "bullmq";
const notificationQueue = new Queue("notifications", {
  connection: {
    host: "127.0.0.1",
    port: 6379
  }
});
// Called after the relevant business event is recorded.
await notificationQueue.add("send-email", {
  userId: "user-123",
  template: "welcome"
});
const worker = new Worker(
  "notifications",
  async (job) => {
    if (job.name === "send-email") {
      await sendWelcomeEmail(job.data.userId);
    }
  },
  {
    connection: {
      host: "127.0.0.1",
      port: 6379
    }
  }
);

The code illustrates the separation between producing a job and processing it. A real implementation would also configure connection security, sensible retry and backoff policies, job retention, error monitoring, and appropriate concurrency. The email function should resolve only when delivery has been accepted by the relevant provider, not merely when a request has been constructed.

Understand retries, duplicates, and failure recovery

Background processing does not eliminate failures; it changes how you handle them. A worker might successfully send an email and crash before acknowledging the job. Depending on the queue’s behavior, the job could run again, resulting in a duplicate email. A temporary provider outage could also cause repeated failures, while an invalid recipient might never become deliverable.

This is why retry policies should distinguish transient failures from permanent ones. A network timeout might justify another attempt after a delay, whereas a malformed email address usually requires intervention or correction. Exponential backoff can spread retries over increasing intervals instead of repeatedly hitting a failing service. After a configured number of attempts, a job may be moved to a failed-job collection or dead-letter queue for investigation.

Another important concept is idempotent processing. You might create a unique notification record for a specific combination of recipient, event, and notification type, preventing duplicate records when an event is processed more than once. For email delivery, complete exactly-once behavior is difficult to guarantee across independent systems; design around duplicate tolerance rather than assuming a job executes precisely once.

There is also a subtle failure window between saving business data and publishing a message. If an order is committed to the database but the application crashes before the corresponding job is enqueued, the order exists without a notification. The transactional outbox pattern addresses this by storing an event in the same database transaction as the business change. A separate publisher reads the outbox and sends events to the queue, with duplicate-safe processing for events that are published more than once.

What should you add next?

Build notification preferences, email and in-app delivery channels, scheduled reminders, retry dashboards, and a worker that processes multiple jobs concurrently. Track job states and measure queue delay, processing duration, and failure rates. These metrics tell you whether notifications are simply slow or whether the entire worker pipeline is falling behind.

Be careful not to create a separate microservice for every small feature just to make the architecture look sophisticated. A queue and worker can run alongside a monolithic backend and still provide meaningful isolation. Additional services are useful when deployment independence, scaling requirements, or team boundaries justify the operational cost.

What makes this project valuable: it teaches asynchronous architecture, queue semantics, idempotency, retries, observability, and recovery from partial failures. These are the problems that distinguish a background task that works locally from one that can be trusted in a deployed application.
Practice Here

4. Build a Multi-User Project Management API

A project management API may seem less technically challenging than an e-commerce platform, but it exposes a problem that developers frequently underestimate: authorization. Creating users, projects, tasks, and comments is relatively easy. Ensuring that every user can access only the resources they are allowed to see is much harder, especially when the same application supports personal workspaces, shared projects, administrators, and invited collaborators.

This project is particularly valuable because it forces you to think beyond authentication. Authentication establishes who a user is; authorization determines what that user is allowed to do. A valid JWT does not mean its owner can update every project in the database, and hiding a button in the frontend does not prevent a malicious client from calling the corresponding API directly.

Design permissions before writing endpoints

Create users, workspaces, memberships, projects, tasks, and comments. Each workspace can contain multiple projects, and each project belongs to a workspace. Membership records can define roles such as owner, administrator, member, or viewer, with clearly documented permissions for each role.

For example, a viewer may read tasks but cannot edit them, while a member can update assigned work. An administrator might invite collaborators, and an owner could manage workspace-wide settings. The important part is to define these rules in the backend rather than scattering ad hoc role checks throughout route handlers.

A dangerous implementation might retrieve a task solely by its ID and immediately return it. An attacker who learns or guesses another task’s identifier could access data belonging to a different workspace. This is a form of broken object-level authorization, a common API security risk.

A safer query scopes the requested resource to the authenticated user’s access:

const task = await Task.findOne({
  _id: req.params.taskId,
  workspaceId: { $in: authorizedWorkspaceIds }
});
if (!task) {
  return res.status(404).json({
    message: "Task not found"
  });
}
const task = await Task.findOne({
  _id: req.params.taskId,
  workspaceId: { $in: authorizedWorkspaceIds }
});
if (!task) {
  return res.status(404).json({
    message: "Task not found"
  });
}

Here, authorizedWorkspaceIds must be derived from trusted server-side membership checks, not supplied by the client. This query is an illustrative MongoDB pattern; the correct implementation depends on your data model and authorization policy. In more complex systems, the server should also verify that the user has permission to perform the specific requested action, not just permission to access the workspace.

Learn clean architecture through real requirements

As the project grows, route handlers can become crowded with validation, permission checks, database queries, and business rules. You can improve maintainability by separating responsibilities into layers: controllers handle HTTP input and output, services implement business rules, and repositories or data-access modules encapsulate database operations where that abstraction is useful.

For example, a TaskService might verify membership, check whether the requested status transition is valid, and record the change. The controller should not independently implement these rules for every endpoint. Centralizing business logic makes it easier to test and reduces the risk that one route accidentally allows an operation that another route correctly rejects.

Do not turn this into an exercise in creating dozens of interfaces and folders. The goal is to make changes safer, not to maximize architectural complexity. A straightforward service layer is often sufficient for a portfolio project, and additional abstractions should solve a problem you can explain.

Add features that expose deeper backend concepts

Implement pagination, filtering, search, audit logs, and optimistic concurrency control. Pagination teaches you to avoid returning an entire workspace’s task history in one response. Audit logs teach you to distinguish the current state of a task from the sequence of actions that produced it. Optimistic concurrency control can prevent one collaborator from silently overwriting another person’s recent changes.

You can also introduce refresh-token rotation, session revocation, request validation, and rate limiting. Write integration tests that deliberately attempt cross-workspace access, edit resources using insufficient permissions, and reuse expired credentials. These tests are more valuable than simply checking that the happy path returns HTTP 200.

What makes this project valuable: it develops your understanding of API security, authorization, maintainable architecture, testing, and multi-tenant data isolation. Those skills are directly relevant to collaboration tools, SaaS products, internal business platforms, and many full-stack applications.
Practice Here

10 REST API Design Principles Every Backend Developer Should Follow
From clean endpoints and HTTP semantics to pagination, idempotency, versioning, and rate limiting — the practical rules…

5. Build a File Upload and Media Processing Service

File uploads are common in social networks, learning platforms, document management systems, and collaboration tools. A basic upload endpoint might accept an image and save it to disk, but that implementation quickly becomes limiting when files are large, users upload multiple files simultaneously, or the application needs thumbnails, previews, and download permissions.

This project introduces a different set of backend challenges: streaming, object storage, asynchronous processing, resource limits, access control, and secure handling of untrusted files. It is particularly useful if you want to build applications that support profile pictures, posts, documents, or other user-generated content.

Design the upload pipeline

Start with an endpoint that accepts an uploaded file, validates its size and permitted format, and stores it in object storage such as Amazon S3 or a compatible service. Store the file’s metadata in your database, including its owner, storage key, size, detected content type, creation timestamp, and processing status.

For larger files, consider uploading directly from the client to object storage using a short-lived presigned URL. Your backend authorizes the operation and generates the URL, while the client transfers the file without routing every byte through the application server. This can reduce pressure on the API server, although the backend must still enforce ownership, size limits, allowed content types, and appropriate storage permissions.

Avoid treating the filename or MIME type provided by the client as proof that a file is safe. Validate the file’s actual contents where possible, generate your own storage keys, restrict accepted formats, and consider malware scanning when the application handles potentially dangerous files. Publicly accessible uploads can also expose sensitive information, so private objects and controlled download access are often the safer defaults.

Process files outside the request

Suppose a user uploads a high-resolution image for a social media post. The application might need to generate a thumbnail, resize the image for different screen sizes, and extract metadata. Performing all these operations before returning the upload response can consume CPU and memory, making the API less responsive under concurrent uploads.

Instead, save the original file and enqueue a processing job. A worker retrieves the object, validates or decodes it using an appropriate library, generates the required variants, and updates the database when processing completes. The client can poll a status endpoint or receive a notification when the asset becomes available.

A simple state model might include UPLOADED, PROCESSING, READY, and FAILED. These states help the frontend communicate progress without pretending the file is immediately usable. They also make failures easier to investigate because you can distinguish an upload that never completed from one that was stored successfully but failed during thumbnail generation.

Handle operational problems deliberately

Large files can exhaust memory if your application buffers every upload entirely before processing it. Streaming data where appropriate, enforcing upload limits, and applying backpressure can reduce this risk. You should also configure timeouts and resource limits for image decoders and other processing tools, because untrusted files may be malformed or deliberately designed to consume excessive resources.

Design cleanup jobs for incomplete uploads and abandoned objects. If the database records a file that does not exist in storage, the application needs a recovery strategy; similarly, objects left behind after failed database operations can accumulate storage costs. Since object storage and a relational database generally do not share one transaction, reliable cleanup and reconciliation are important parts of the design.

What makes this project valuable: you learn how to handle large payloads, integrate external storage, manage asynchronous processing, protect untrusted input, and recover from failures across multiple systems. These lessons apply to media platforms, document applications, reporting systems, and any backend that accepts user-generated files.
Practice Here

How to Turn These Projects Into Real Learning

Building all five projects is useful, but the quality of your implementation matters more than the number of repositories on your GitHub profile. A project that contains ten endpoints and no meaningful error handling may teach you less than one carefully designed endpoint that handles concurrency, validation, retries, and failure recovery correctly.

The most effective approach is to build each project in stages. First, implement the smallest complete workflow. Then identify the assumptions that could fail when multiple users, unreliable networks, invalid inputs, or external services enter the picture. Finally, add the design improvements needed to address those specific problems.

Use the following checklist as you work through each project.

  • Build the core workflow: Make the primary feature work from request to database and back.
  • Validate inputs: Reject malformed data, enforce constraints, and return meaningful errors.
  • Handle concurrent requests: Identify where simultaneous operations could corrupt data or produce duplicate results.
  • Test failure scenarios: Simulate database errors, external service timeouts, duplicate requests, and interrupted jobs.
  • Measure performance: Inspect slow queries, add indexes where justified, and avoid unnecessary database calls.
  • Add observability: Use structured logs and track meaningful metrics instead of relying only on console output.
  • Deploy the application: Configure environment variables, secure credentials, run migrations where applicable, and document deployment steps.
  • Explain your decisions: Record the tradeoffs you made and describe what you would change if traffic or business requirements increased.

Testing deserves particular attention. Unit tests are useful for business rules, while integration tests can verify how the application behaves with its database and other dependencies. For concurrency-sensitive operations, write tests that run competing requests rather than assuming a sequence of isolated requests represents real usage.

Deployment is equally important because it exposes configuration and operational problems that local development may conceal. Learn to manage secrets outside source control, configure production logging, handle database connection limits, and investigate failed deployments. You do not need a complex Kubernetes cluster for every project; a simple deployment with a reliable database and clear documentation can demonstrate sound engineering judgment.

Conclusion: Build Systems That Can Fail, Not Just Features That Work

The biggest improvement in backend development happens when you stop asking whether an endpoint works and start asking what could make it fail. A successful response proves that one request completed under one set of conditions. It does not prove that the system handles concurrent requests correctly, recovers from external service failures, protects user data, or remains maintainable as requirements change.

These five projects offer different ways to develop that mindset. The URL shortener introduces caching and data access patterns, the e-commerce backend explores transactions and consistency, the notification system teaches asynchronous processing, the project management API strengthens authorization and architecture, and the media service reveals the challenges of handling files and external infrastructure. Together, they cover a substantial portion of the problems that backend developers encounter in real applications.

You do not need to implement every advanced feature immediately, and you certainly do not need to turn every project into a distributed system. Start small, understand the behavior of your application, introduce complexity only when a real requirement justifies it, and document the reasoning behind your decisions.

The goal is not to build five impressive projects. It is to become the developer who understands why a system works, where it might break, and how to make it more reliable. That understanding is what tutorials can introduce but hands-on engineering teaches.

Below is the complete collection of this kind of stories

List: Complete Backend Engineer List | Curated by Gopi C K | Medium
Complete Backend Engineer List · 12 stories on Medium