0Pricing
AWS for Backend Developers (EC2, S3, RDS, Lambda) · 강의

ELB를 활용한 로드 밸런싱

Elastic Load Balancer(ELB)를 사용해 여러 EC2 인스턴스에 애플리케이션의 인바운드 트래픽을 분산하고 가용성과 확장성을 높입니다.

ELB를 활용한 로드 밸런싱은(는) CoddyKit의 무료 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의입니다. 이것은 4개 중 3번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 AWS for Backend Developers (EC2, S3, RDS, Lambda) 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

What is Load Balancing?

Imagine a popular website. If millions of users try to access it at once, a single server can get overwhelmed. Load balancing helps distribute this traffic.

It's like a traffic cop for your servers, directing incoming requests to different servers to prevent any one server from becoming a bottleneck.

This improves performance, reliability, and availability of your applications.

Meet AWS Elastic Load Balancing

AWS offers a managed service called Elastic Load Balancing (ELB). It automatically distributes incoming application traffic across multiple targets, such as EC2 instances.

ELB handles the heavy lifting of scaling and managing the load balancer itself.

Key benefits include:

  • High Availability: Distributes traffic across instances in different Availability Zones.
  • Scalability: Automatically scales its own capacity to handle traffic spikes.
  • Fault Tolerance: Detects unhealthy instances and routes traffic only to healthy ones.

Choosing Your ELB Type

AWS offers different types of Elastic Load Balancers, each suited for specific use cases and traffic patterns.

The main types you'll encounter today are:

  • Application Load Balancer (ALB): Best for HTTP/HTTPS traffic.
  • Network Load Balancer (NLB): Ideal for extreme performance, static IP, and TCP/UDP traffic.
  • Gateway Load Balancer (GLB): Used for deploying and managing virtual appliances.

(Classic Load Balancer (CLB) is an older generation and generally not recommended for new applications.)

Routing with ALB

The Application Load Balancer (ALB) operates at the application layer (Layer 7) of the OSI model. This means it can inspect the content of requests.

ALBs are great for microservices and container-based applications. They support advanced routing features like:

  • Path-based routing: Directs traffic based on the URL path (e.g., /users to one service, /products to another).
  • Host-based routing: Routes based on the hostname in the request.
  • Target groups: Groups of instances or IP addresses that receive traffic from the load balancer.

ALB Components: Listeners & Target Groups

An ALB uses two main components to direct traffic:

  • Listeners: These check for connection requests using a protocol and port you configure (e.g., HTTP on port 80, HTTPS on port 443).
  • Target Groups: Each listener forwards requests to one or more target groups. A target group routes requests to registered targets (like EC2 instances) using the protocol and port you specify.

You can have multiple target groups, each with different health check settings, allowing you to manage various services behind a single ALB.

High Performance with NLB

The Network Load Balancer (NLB) operates at the connection layer (Layer 4) of the OSI model. It's designed for extreme performance and ultra-low latency.

NLBs can handle millions of requests per second and maintain very low latency.

Key characteristics:

  • Static IP addresses: Provides a static IP per Availability Zone.
  • Preserves source IP: Your backend applications see the client's original IP address.
  • TCP/UDP traffic: Ideal for non-HTTP/HTTPS applications.

Use NLB when you need high throughput, low latency, and a static IP address.

Ensuring Healthy Instances

Load balancers continuously monitor the health of their registered targets (e.g., EC2 instances). This is crucial for maintaining application availability.

If an instance fails its health checks, the load balancer stops sending new requests to it. Once the instance becomes healthy again, the load balancer resumes routing traffic to it.

Health checks can be configured with:

  • Protocol: HTTP, HTTPS, TCP, SSL, or UDP.
  • Port: The port on the target instance to check.
  • Thresholds: Number of consecutive successful/unsuccessful checks.
  • Interval: How often to perform checks.

Launching an Application Load Balancer

While creating an ELB involves several steps in the AWS console or CLI, here's a simplified look at the core idea. You'd define your load balancer, listeners, and target groups.

This example shows how you might conceptually define an ALB, though actual creation is more involved.

aws elbv2 create-load-balancer \
    --name my-web-alb \
    --subnets subnet-01 subnet-02 \
    --security-groups sg-01 \
    --type application

Dynamic Scaling with ELB & ASG

Elastic Load Balancing and Auto Scaling Groups (ASG) work hand-in-hand to create highly available and scalable applications.

When you integrate an ASG with an ELB:

  • The ASG automatically registers new instances with the load balancer as they launch.
  • It also deregisters and terminates instances from the load balancer when they are scaled down or become unhealthy.

This ensures that your application always has enough capacity and that traffic is only sent to healthy instances.

ELB Knowledge Check

Which type of Elastic Load Balancer (ELB) is best suited for routing HTTP/HTTPS traffic to microservices, supporting path-based routing?

ELB: Your Traffic Controller

Great job! You've learned about Elastic Load Balancing (ELB), AWS's service for distributing application traffic.

We covered:

  • The benefits of load balancing for availability and scalability.
  • The main types: Application Load Balancer (ALB) for HTTP/HTTPS with advanced routing, and Network Load Balancer (NLB) for high-performance TCP/UDP traffic.
  • How health checks keep your application resilient.
  • The synergy between ELB and Auto Scaling Groups for dynamic infrastructure.

ELB is a cornerstone of building robust, scalable applications on AWS!

자주 묻는 질문

“ELB를 활용한 로드 밸런싱” 강의는 무료인가요?

네 — “ELB를 활용한 로드 밸런싱” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의 전체를 잠금 해제할 수 있습니다. AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에는 총 4개의 강의가 포함되어 있습니다.

“ELB를 활용한 로드 밸런싱”에서 뭘 배우나요?

Elastic Load Balancer(ELB)를 사용해 여러 EC2 인스턴스에 애플리케이션의 인바운드 트래픽을 분산하고 가용성과 확장성을 높입니다. 브라우저에서 직접 실행하는 실습 코드로 AWS for Backend Developers (EC2, S3, RDS, Lambda)을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

AWS for Backend Developers (EC2, S3, RDS, Lambda)을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 AWS for Backend Developers (EC2, S3, RDS, Lambda)은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 3번째 강의입니다.

“ELB를 활용한 로드 밸런싱” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 AWS for Backend Developers (EC2, S3, RDS, Lambda) 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. EC2 인스턴스 유형과 AMI
  2. Auto Scaling 그룹 구현
  3. ELB를 활용한 로드 밸런싱
  4. 스팟 인스턴스 및 비용 효율적인 컴퓨팅
← AWS for Backend Developers (EC2, S3, RDS, Lambda)(으)로 돌아가기