Giter Club home page Giter Club logo

aws-samples / designing-cloud-native-microservices-on-aws Goto Github PK

View Code? Open in Web Editor NEW
284.0 10.0 76.0 45.87 MB

Introduce a fluent way to design cloud native microservices via EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.

License: Other

JavaScript 0.65% TypeScript 12.63% Shell 3.58% Java 82.14% Gherkin 0.27% Dockerfile 0.73%
aws ecr ecs fargate serverless lambda dynamodb eventbridge microservices cloudnative

designing-cloud-native-microservices-on-aws's Introduction

Designing Cloud Native Microservices on AWS (via DDD/EventStormingWorkshop)

Picture license-free from Pexels

Building software is hard. Understanding the business needs of the software is even harder. In almost every software development project, there will always be some form of gap between the requirements of the business users and the actual implementation.

As a developer, knowing how to narrow this gap can help you go a long way to building applications that are relevant for the users. Using a Domain Driven Design approach, delivered via Event Storming, it can help to reduce the time it takes for everyone in the project team to understand a business domain model.

Theory and Practice: Learning in the Real world cases

Go through all of the learning journey, develop-->build-->deploy artifacts on AWS

Table of Contents

Event Storming

image

What is Event Storming?

Event Storming is a rapid, lightweight, and often under-appreciated group modeling technique invented by Alberto Brandolini, that is intense, fun, and useful to accelerate project teams. It is typically offered as an interactive workshop and it is a synthesis of facilitated group learning practices from Gamestorming, leveraging on the principles of Domain Driven Design (DDD).

You can apply it practically on any technical or business domain, especially those that are large, complex, or both.

Whom is it for?

Event Storming isn't limited to just for the software development team. In fact, it is recommend to invite all the stakeholders, such as developers, domain experts, business decision makers etc to join the Event Storming workshop to collect viewpoints from each participants.

Event Storming Terms

Event Storming

Reference from Kenny Bass - https://storage.googleapis.com/xebia-blog/1/2018/10/From-EventStorming-to-CoDDDing-New-frame-3.jpg

Take a look on this diagram, there are a few colored sticky notes with different intention:

  • Domain Events (Orange sticky note) - Describes what happened. Represent facts that happened in a specific business context, written in past tense
  • Actions aka Command (Blue sticky note) - Describes an action that caused the domain event. It is a request or intention, raised by a role or time or external system
  • Information (Green sticky note) - Describes the supporting information required to help make a decision to raise a command
  • Consistent Business Rules aka Aggregate (Yellow sticky note)
    • Groups of Events or Actions that represent a specific business capability
    • Has the responsibility to accept or fulfill the intention of command
    • Should be in small scope
    • And communicated by eventual consistency
  • Eventual Consistent Business rules aka Policy (Lilac sticky note)
    • Represents a process or business rules. Can come from external regulation and restrictions e.g. account login success/fail process logic.

Event Storming Benefits

Business requirements can be very complex. It is often hard to find a fluent way to help the Product Owner and Development teams to collaborate effectively. Event storming is designed to be efficient and fun. By bringing key stakeholder into the same room, the process becomes:

  • Efficient: Everyone coming together in the same room can make decisions and sort out differences quickly. To create a comprehensive business domain model, what used to take many weeks of email, phone call or meeting exchanges can be reduced to a single workshop.

  • Simple: Event Storming encourages the use of "Ubiquitous language" that both the technical and non-technical stakeholders can understand.

  • Fun: Domain modeling is fun! Stakeholders get hands-on experience to domain modeling which everyone can participate and interact with each other. It also provides more opportunities to exchange ideas and improve mindsharing, from various perspective across multiple roles.

  • Effective: Stakeholders are encouraged not to think about the data model, but about the business domain. This puts customers first and working backwards from there, achieves an outcome that is more relevant.

  • Insightful: Event Storming generate conversations. This helps stakeholders to understand the entire business process better and help to have a more holistic view from various perspective.

Event Storming Applications

There are many useful applications of Event Storming. The most obvious time to use event storming is at a project's inception, so the team can start with a common understanding of the domain model. Some other reasons include:

  • Discovering complexity early on, finding missing concepts, understanding the business process;
  • Modelling or solving a specific problem in detail;
  • Learning how to model and think about modelling.

Event Storming can also help to identify key views for your user interface, which can jump start Site Mapping or Wireframing.

Let's get started with a quick example to demonstrate how to run a simple Event Storming.

Next: 01 Hands-on Events Exploring >

License

This library is licensed under the MIT-0 License. See the LICENSE file.

designing-cloud-native-microservices-on-aws's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

designing-cloud-native-microservices-on-aws's Issues

Fix file content in module 05-deploy-applications-by-cdk/README.md

  • Deploy Instruction mentions changing github owner but repo also needs changing from EventStormingWorkshop to designing-cloud-native-microservices-on-aws.
  • Create build project screenshot UI has since changed
  • Connect with GitHub screenshot shows old repository name and old AWS CodeBuild icon branding.

FIX: change the role to the new AWSLambda_FullAccess managed policy

Initial deployment via cdk deploy will fail. ROOT CAUSE: aws:policy/AWSLambdaFullAccess managed policy has since been depreciated, resulting in Policy arn:aws:iam::aws:policy/AWSLambdaFullAccess does not exist or is not attachable. (Service:

AmazonIdentityManagement; Status Code: 404; Error Code: NoSuchEntity error message by CDK.

FIX: change the role to the new AWSLambda_FullAccess managed policy, deployment then succeeds.

Fix the content reference link to current repo.

All files make reference to an EventStormingWorkshop repository name, rather than its current designing-cloud-native-microservices-on-aws repository name. A potential confusion for readers.

Fix the test ALB endpoint

Run Test - updating curl command to point to my deployed API endpoint, execution fails with 502 Bad Gateway status.

curl --header "Content-Type: application/json" --request POST --data '{"items":[{"productId":"5678","qty":2,"price":200}]}' http://Coffe-AlbSv-S03YRO6K0UPD-1527471424.ap-southeast-2.elb.amazonaws.com/order

The ALB load balancer deployed is failing health status, draining connections as target deregistration is in progress.
On inspecting CloudWatch Logs, Java NullPointerException is reported in the handler code

java.lang.NullPointerException: java.lang.NullPointerException
java.lang.NullPointerException
  at solid.humank.coffeeshop.cofee.sls.orders.OrderCreatedHandler.handleRequest(OrderCreatedHandler.java:46)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  at java.base/java.lang.reflect.Method.invoke(Unknown Source)

Fix configuration for lambda functions

This step uses AWS CLI to reference an coffee-sls-OrderCreatedHandler function that has not been deployed previously, and obviously fails.

Instructions do not clearly mention the need for the user to commit changes and git push -u origin master is required. This then triggers the CodeBuild project, thereby deploying the Lambda function. This could be an error prone step for many users.

CodeBuild build will fail during POST_BUILD stage, with below output:

[Container] 2021/09/27 05:16:41 Running command sam deploy --template-file ./packaged.yaml --stack-name coffee-sls --capabilities CAPABILITY_IAM

    Deploying with following values
    ===============================
    Stack name                 : coffee-sls
    Region                     : None
    Confirm changeset          : False
    Deployment s3 bucket       : None
    Capabilities               : ["CAPABILITY_IAM"]
    Parameter overrides        : {}

Initiating deployment
=====================
AcceptOrderFunction may not have authorization defined.

Waiting for changeset to be created..
Error: Failed to create changeset for the stack: coffee-sls, ex: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Template error: instance of Fn::GetAtt references undefined resource AcceptOrder

[Container] 2021/09/27 05:16:48 Command did not exit successfully sam deploy --template-file ./packaged.yaml --stack-name coffee-sls --capabilities CAPABILITY_IAM exit status 1
[Container] 2021/09/27 05:16:48 Phase complete: POST_BUILD State: FAILED
[Container] 2021/09/27 05:16:48 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: sam deploy --template-file ./packaged.yaml --stack-name coffee-sls --capabilities CAPABILITY_IAM. Reason: exit status 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.