Bablu Kumar Singh
Back to Blog
DevOps
7 min read
June 9, 2026

AWS for Backend Developers: Essential Services and Architecture Patterns

AWS for Backend Developers: Essential Services and Architecture Patterns

AWS offers over 200 services, but as a backend developer you need to master about a dozen to deploy, scale, and operate production applications confidently. This guide cuts through the noise and focuses on the services that matter most for backend engineering — written by Bablu Kumar Singh from hands-on production experience.

The Core Architecture

A production-ready AWS architecture for a Node.js API looks like this:

javascript Code Block
Internet
   │
   ▼
Route 53 (DNS)
   │
   ▼
CloudFront (CDN)
   │
   ▼
ALB (Application Load Balancer)
   │
   ├──▶ EC2 Instance 1 (Node.js API)
   ├──▶ EC2 Instance 2 (Node.js API)
   └──▶ EC2 Instance 3 (Node.js API)
          │
          ├──▶ RDS (PostgreSQL / MongoDB Atlas)
          ├──▶ ElastiCache (Redis)
          └──▶ S3 (File Storage)

EC2: Your Application Server

EC2 (Elastic Compute Cloud) provides virtual machines. For a Node.js API:

  • Instance type: t3.medium (2 vCPUs, 4 GB RAM) is a solid starting point.
  • AMI: Amazon Linux 2023 or Ubuntu 22.04.
  • Security Group: Allow inbound on port 3000 from the ALB only, SSH on port 22 from your IP only.

Basic setup script (User Data):

bash Code Block
#!/bin/bash
# Install Node.js 20
curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
yum install -y nodejs git

# Clone and start application
cd /home/ec2-user
git clone https://github.com/your-org/your-api.git
cd your-api
npm ci --only=production
npm run build

# Use PM2 for process management
npm install -g pm2
pm2 start dist/index.js --name api -i max
pm2 save
pm2 startup

Application Load Balancer (ALB)

The ALB distributes traffic across EC2 instances and provides:

  • Health checks — automatically removes unhealthy instances.
  • SSL termination — handles HTTPS so your Node.js app only deals with HTTP.
  • Path-based routing — route /api/* to backend, /* to frontend.

Key configuration:

javascript Code Block
Listener: HTTPS :443
  Rule 1: Path /api/* → Target Group: backend-tg
  Rule 2: Default    → Target Group: frontend-tg

Target Group: backend-tg
  Health Check Path: /api/health
  Health Check Interval: 30s
  Healthy Threshold: 2
  Unhealthy Threshold: 3

Auto Scaling Group (ASG)

Auto Scaling automatically adjusts the number of EC2 instances based on demand:

javascript Code Block
Auto Scaling Group:
  Min Instances: 2
  Max Instances: 10
  Desired Capacity: 3

Scaling Policy (Target Tracking):
  Metric: Average CPU Utilization
  Target: 60%
  Scale Out Cooldown: 300s
  Scale In Cooldown: 300s

When CPU utilization exceeds 60 %, ASG launches new instances. When it drops, instances are terminated. You pay only for what you use.

RDS: Managed Databases

Amazon RDS handles database administration — backups, patching, replication, and failover. For PostgreSQL:

javascript Code Block
Instance: db.t3.medium
Storage: 100 GB gp3
Multi-AZ: Enabled (automatic failover)
Automated Backups: 7-day retention

Connection from Node.js:

typescript Code Block
import { Pool } from 'pg';

const pool = new Pool({
  connectionString: process.env.DATABASE_URL,
  max: 20,
  idleTimeoutMillis: 30000,
  connectionTimeoutMillis: 5000,
  ssl: { rejectUnauthorized: false },
});

S3: Object Storage

S3 stores files (user uploads, backups, static assets) with 99.999999999 % durability:

typescript Code Block
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';

const s3 = new S3Client({ region: 'ap-south-1' });

async function uploadFile(key: string, body: Buffer, contentType: string) {
  await s3.send(
    new PutObjectCommand({
      Bucket: process.env.S3_BUCKET!,
      Key: key,
      Body: body,
      ContentType: contentType,
    })
  );
  return `https://${process.env.S3_BUCKET}.s3.amazonaws.com/${key}`;
}

Combine S3 with CloudFront for global CDN delivery of uploaded images and files.

SQS: Message Queues

Amazon SQS is a fully managed message queue. Use it for background job processing:

typescript Code Block
import { SQSClient, SendMessageCommand, ReceiveMessageCommand } from '@aws-sdk/client-sqs';

const sqs = new SQSClient({ region: 'ap-south-1' });
const QUEUE_URL = process.env.SQS_QUEUE_URL!;

// Producer
async function enqueueJob(payload: object) {
  await sqs.send(
    new SendMessageCommand({
      QueueUrl: QUEUE_URL,
      MessageBody: JSON.stringify(payload),
    })
  );
}

// Consumer (runs on a separate worker instance)
async function pollJobs() {
  const response = await sqs.send(
    new ReceiveMessageCommand({
      QueueUrl: QUEUE_URL,
      MaxNumberOfMessages: 10,
      WaitTimeSeconds: 20, // long polling
    })
  );
  return response.Messages || [];
}

ElastiCache: Managed Redis

ElastiCache provides managed Redis or Memcached. For session caching and API response caching:

javascript Code Block
Node Type: cache.t3.medium
Cluster Mode: Disabled (single-shard is enough for most APIs)
Multi-AZ: Enabled
Automatic Failover: Enabled

Your application connects to ElastiCache the same way it connects to local Redis — just update the REDIS_URL environment variable.

Cost Optimization Tips

  • Use Reserved Instances for predictable workloads (save up to 60 %).
  • Use Spot Instances for batch processing and non-critical workers.
  • Enable S3 lifecycle policies to transition old objects to Glacier.
  • Set up CloudWatch billing alarms to avoid surprise bills.
  • Use t3 instances with burstable performance for development environments.

Key Takeaways

  • Master the core seven: EC2, ALB, ASG, RDS, S3, SQS, and ElastiCache.
  • Design for Multi-AZ from the start — availability is non-negotiable.
  • Use Auto Scaling so infrastructure matches demand automatically.
  • Separate compute from storage — stateless servers + managed databases.
  • Watch your costs — cloud bills grow silently without alarms and reviews.

AWS is a force multiplier for backend developers. These services handle the undifferentiated heavy lifting so you can focus on building features that matter.

#AWS#EC2#Cloud#DevOps
Bablu Kumar Singh
Written by

Bablu Kumar Singh

Backend-Focused Full Stack Developer

Backend-Focused Full Stack Developer specializing in Node.js, MongoDB, PostgreSQL, Redis, RabbitMQ, AWS, Docker, System Design, and React Native.

You May Also Like

Docker Deployment for Node.js Applications: A Production Guide
DevOps
7 min read

Docker Deployment for Node.js Applications: A Production Guide

Learn how to containerize Node.js applications with multi-stage Docker builds, optimize image sizes, handle environment variables, and deploy with Docker Compose for development and production.

Jun 6, 2026Read
Building a Multi-Tenant SaaS: Database Architecture Strategies
System Design
8 min read

Building a Multi-Tenant SaaS: Database Architecture Strategies

An evaluation of pool database systems vs. schema-based and table-level tenant isolation patterns for microservices.

Jun 1, 2026Read
RabbitMQ Event Processing Patterns for Scalable Systems
System Design
8 min read

RabbitMQ Event Processing Patterns for Scalable Systems

A deep dive into event-driven architecture with RabbitMQ — covering exchanges, queues, dead-letter handling, retry strategies, and real-world patterns for Node.js microservices.

May 14, 2026Read