Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)48k · #3867

aws-serverless-eda

Skill này làm gì

Hướng dẫn này giúp bạn xây dựng các ứng dụng hướng sự kiện, có khả năng mở rộng trên Amazon Web Services (AWS). Nó dạy cách tạo các hàm nhỏ, tập trung, dùng sự kiện để kết nối các dịch vụ và đảm bảo mọi thứ vẫn hoạt động khi xảy ra lỗi.

Khi nào nên dùng

  • ✓Khi bạn xây dựng ứng dụng chạy mà không cần máy chủ riêng (dùng Lambda).
  • ✓Khi bạn thiết kế hệ thống phản ứng với sự kiện, như khi có tệp được tải lên.
  • ✓Khi bạn tạo các dịch vụ nhỏ giao tiếp với nhau (microservices).

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/aws-serverless-eda/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/aws-serverless-eda/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để đảm bảo hàm Lambda của tôi không xử lý hai lần cùng một việc nếu nhận được cùng một sự kiện?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Nó dùng các nguyên tắc trong “Well-Architected Framework” của AWS để đưa ra lời khuyên. Điều này nghĩa là tuân theo các thực hành tốt nhất để xây dựng ứng dụng đám mây bền bỉ, an toàn và hiệu quả.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

AWS Serverless & Event-Driven Architecture

This skill provides comprehensive guidance for building serverless applications and event-driven architectures on AWS based on Well-Architected Framework principles.

AWS Documentation Requirement

Always verify AWS facts using MCP tools (mcp__aws-mcp__* or mcp__*awsdocs*__*) before answering. The aws-mcp-setup dependency is auto-loaded — if MCP tools are unavailable, guide the user through that skill's setup flow.

Serverless MCP Servers

This skill leverages the CDK MCP server (provided via aws-cdk-development dependency) and AWS Documentation MCP for serverless guidance.

Note: The following AWS MCP servers are available separately via the Full AWS MCP Server (see aws-mcp-setup skill) and are not bundled with this plugin:

  • AWS Serverless MCP — SAM CLI lifecycle (init, deploy, local test)
  • AWS Lambda Tool MCP — Direct Lambda invocation
  • AWS Step Functions MCP — Workflow orchestration
  • Amazon SNS/SQS MCP — Messaging and queue management

When to Use This Skill

Use this skill when:

  • Building serverless applications with Lambda
  • Designing event-driven architectures
  • Implementing microservices patterns
  • Creating asynchronous processing workflows
  • Orchestrating multi-service transactions
  • Building real-time data processing pipelines
  • Implementing saga patterns for distributed transactions
  • Designing for scale and resilience

AWS Well-Architected Serverless Design Principles

1. Speedy, Simple, Singular

Functions should be concise and single-purpose

// ✅ GOOD - Single purpose, focused function
export const processOrder = async (event: OrderEvent) => {
  // Only handles order processing
  const order = await validateOrder(event);
  await saveOrder(order);
  await publishOrderCreatedEvent(order);
  return { statusCode: 200, body: JSON.stringify({ orderId: order.id }) };
};

// ❌ BAD - Function does too much
export const handleEverything = async (event: any) => {
  // Handles orders, inventory, payments, shipping...
  // Too many responsibilities
};

Keep functions environmentally efficient and cost-aware:

  • Minimize cold start times
  • Optimize memory allocation
  • Use provisioned concurrency only when needed
  • Leverage connection reuse

2. Think Concurrent Requests, Not Total Requests

Design for concurrency, not volume

Lambda scales horizontally - design considerations should focus on:

  • Concurrent execution limits
  • Downstream service throttling
  • Shared resource contention
  • Connection pool sizing
// Consider concurrent Lambda executions accessing DynamoDB
const table = new dynamodb.Table(this, 'Table', {
  billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, // Auto-scales with load
});

// Or with provisioned capacity + auto-scaling
const table = new dynamodb.Table(this, 'Table', {
  billingMode: dynamodb.BillingMode.PROVISIONED,
  readCapacity: 5,
  writeCapacity: 5,
});

// Enable auto-scaling for concurrent load
table.autoScaleReadCapacity({ minCapacity: 5, maxCapacity: 100 });
table.autoScaleWriteCapacity({ minCapacity: 5, maxCapacity: 100 });

3. Share Nothing

Function runtime environments are short-lived

// ❌ BAD - Relying on local file system
export const handler = async (event: any) => {
  fs.writeFileSync('/tmp/data.json', JSON.stringify(data)); // Lost after execution
};

// ✅ GOOD - Use persistent storage
export const handler = async (event: any) => {
  await s3.putObject({
    Bucket: process.env.BUCKET_NAME,
    Key: 'data.json',
    Body: JSON.stringify(data),
  });
};

State management:

  • Use DynamoDB for persistent state
  • Use Step Functions for workflow state
  • Use ElastiCache for session state
  • Use S3 for file storage

4. Assume No Hardware Affinity

Applications must be hardware-agnostic

Infrastructure can change without notice:

  • Lambda functions can run on different hardware
  • Container instances can be replaced
  • No assumption about underlying infrastructure

Design for portability:

  • Use environment variables for configuration
  • Avoid hardware-specific optimizations
  • Test across different environments

5. Orchestrate with State Machines, Not Function Chaining

Use Step Functions for orchestration

// ❌ BAD - Lambda function chaining
export const handler1 = async (event: any) => {
  const result = await processStep1(event);
  await lambda.invoke({
    FunctionName: 'handler2',

…
Câu hỏi thường gặp

“Microservices” là gì?

Đó là các ứng dụng nhỏ, độc lập, cùng làm việc với nhau để tạo thành một hệ thống lớn. Mỗi cái thực hiện một nhiệm vụ cụ thể.

“Event-driven architecture” là gì?

Đó là cách xây dựng hệ thống trong đó các hành động (sự kiện) kích hoạt các hành động khác, thay vì một chương trình trực tiếp yêu cầu chương trình khác làm việc.

“Lambda” là gì?

Đó là dịch vụ AWS cho phép bạn chạy mã mà không cần quản lý máy chủ. Bạn chỉ trả tiền cho thời gian mã thực sự chạy.

Chi tiết

Mô tả gốc của tác giả

AWS serverless and event-driven architecture expert based on Well-Architected Framework. Use when building serverless APIs, Lambda functions, REST APIs, microservices, or async workflows.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3867
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự