0Pricing
SaaS Architecture & Startup Engineering · บทเรียน

อีเวนต์สตอร์มมิงสำหรับไมโครเซอร์วิส

ใช้ Event Storming เป็นเทคนิคการทำงานร่วมกันเพื่อค้นหาเหตุการณ์ในโดเมนและสร้างแบบจำลองกระบวนการทางธุรกิจที่ซับซ้อนสำหรับ SaaS

อีเวนต์สตอร์มมิงสำหรับไมโครเซอร์วิส เป็นบทเรียน SaaS Architecture & Startup Engineering ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน SaaS Architecture & Startup Engineering และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส SaaS Architecture & Startup Engineering มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

What is Event Storming?

Event Storming is a fun, collaborative workshop technique to understand complex business domains. It helps teams visualize how things happen in a system.

Imagine a room full of sticky notes! Teams map out a business process by focusing on the "events" that occur, making it easier to see the big picture.

Why Event Storm for Microservices?

For SaaS, especially with microservices, understanding domain boundaries is key. Event Storming helps:

  • Break down monoliths: Clearly identifies areas to split.
  • Define service boundaries: Groups related events and actions into potential services.
  • Improve communication: Gets everyone on the same page, from business to tech.

The Event Storming Canvas

Event Storming uses different colored sticky notes to represent various elements of your domain:

  • Orange: Domain Events (what happened?)
  • Blue: Commands (what triggers an event?)
  • Yellow: Aggregates (who performs a command?)
  • Green: Read Models (how users view data?)
  • Purple: Policies (rules reacting to events)

Step 1: Discovering Domain Events

This is the starting point! Think about "what happened?" in your business process. Events are facts from the past, always written in past tense.

Examples:

  • OrderPlaced
  • PaymentReceived
  • UserRegistered
  • SubscriptionCancelled

These are the core truths of your system.

Coding a Simple Event

While Event Storming is visual, the events we discover often translate into code. Here's how a simple OrderPlaced event might look in a Java application:

Try running this example to see how an event could be represented and "published" (here, just printed).

public class OrderPlacedEvent {
  private String orderId;
  private double amount;
  private String customerId;

  public OrderPlacedEvent(String orderId, double amount, String customerId) {
    this.orderId = orderId;
    this.amount = amount;
    this.customerId = customerId;
  }

  public String toString() {
    return "OrderPlacedEvent {id='" + orderId + "', amount=" + amount + ", customerId='" + customerId + "'}";
  }

  public static void main(String[] args) {
    OrderPlacedEvent event = new OrderPlacedEvent("ORD123", 99.99, "CUST456");
    System.out.println("New event generated: " + event.toString());
  }
}

Step 2: Identifying Commands

After events, we look for commands. A command is an explicit request to do something, which usually leads to an event (or multiple events).

Ask: "What action caused this event to happen?" Commands are usually imperative verbs.

  • PlaceOrder (leads to OrderPlaced)
  • ProcessPayment (leads to PaymentReceived)
  • RegisterUser (leads to UserRegistered)

Step 3: Pinpointing Aggregates

Aggregates are the "who" or "what" that receives a command and produces an event. They are transactional consistency boundaries – meaning everything within an aggregate changes together.

Think of them as the "model" or "entity" in your code that holds state and enforces business rules.

  • Order aggregate handles PlaceOrder.
  • PaymentProcessor handles ProcessPayment.

Step 4: Read Models & Policies

Read Models (Green): These are how users or other systems query information. They are optimized for reading, often denormalized views built from events.

Policies (Purple): These are business rules that react to events. For example, "when an OrderPlaced event occurs, then send a confirmation email."

From Storm to Bounded Contexts

As you map out your domain, you'll see natural clusters of events, commands, and aggregates. These clusters often define your Bounded Contexts.

A Bounded Context is a logical boundary within which a specific domain model is defined and applicable. This is crucial for designing independent microservices!

Benefits Beyond Design

Event Storming doesn't just help with technical design; it fosters a shared understanding across the entire team.

  • Shared Language: Everyone uses the same terms.
  • Knowledge Transfer: New team members quickly grasp complex flows.
  • Problem Identification: Uncovers hidden assumptions and issues early.

Quick Check

Event Storming uses different colored sticky notes to represent various domain elements. Match the sticky note color to its correct description.

Recap: Event Storming Toolkit

You've learned that Event Storming is a powerful, visual technique to understand complex domains. By focusing on Domain Events, you can identify Commands, Aggregates, Read Models, and Policies.

This collaborative approach helps in defining clear Bounded Contexts, making it an invaluable tool for designing robust and scalable microservices in your SaaS architecture.

คำถามที่พบบ่อย

บทเรียน “อีเวนต์สตอร์มมิงสำหรับไมโครเซอร์วิส” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “อีเวนต์สตอร์มมิงสำหรับไมโครเซอร์วิส” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส SaaS Architecture & Startup Engineering ให้อัปเกรดเป็น CoddyKit PRO คอร์ส SaaS Architecture & Startup Engineering มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “อีเวนต์สตอร์มมิงสำหรับไมโครเซอร์วิส”

ใช้ Event Storming เป็นเทคนิคการทำงานร่วมกันเพื่อค้นหาเหตุการณ์ในโดเมนและสร้างแบบจำลองกระบวนการทางธุรกิจที่ซับซ้อนสำหรับ SaaS คุณปฏิบัติ SaaS Architecture & Startup Engineering ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน SaaS Architecture & Startup Engineering หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน SaaS Architecture & Startup Engineering บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “อีเวนต์สตอร์มมิงสำหรับไมโครเซอร์วิส” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน SaaS Architecture & Startup Engineering นี้ได้ไหม

ได้ บทเรียน SaaS Architecture & Startup Engineering ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. ขอบเขตจำกัดและแอกกริเกต
  2. อีเวนต์สตอร์มมิงสำหรับไมโครเซอร์วิส
  3. การออกแบบเชิงกลยุทธ์และการทำแผนผังบริบท
  4. ภาษาร่วมและแบบจำลองโดเมน
← กลับไปที่ SaaS Architecture & Startup Engineering