Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Microservice architecture in practice on AWS: DDD with Java Spring, React and many more

Microservice architecture in practice on AWS: DDD with Java Spring, React and many more

Everyone talks and writes about Microservices, but few show off their actual implementation. We want to change this by opening up our architecture and giving you a peek into how we run. This means we will take you on a ride that dives into the whole development cycle starting at the split of our system into microservices (bounded contexts), how they look from the inside up to the point of how we deploy and manage our infrastructure and system on AWS (ECS) with Infrastructure as Code. All of this is a real system with real challenges and real pain points that we haven't solved yet, but want to show to you.

Steve Behrendt

June 05, 2019
Tweet

Other Decks in Programming

Transcript

  1. Electric Car Charging ‣ Find stations ‣ Manage charging sessions

    ‣ Billing ‣ Accounting ‣ Control physical charging station
  2. Chargepoint Customer Energy Management Chargepoint Operator Operations for every charging

    station Analysis, predication and purchase of energy Customer, driver and contract management Operations of physical and directly connected chargepoints
  3. Physical station Physical station Physical station Physical station Physical station

    Physical station Apps OAuth 3rd Party Backends Aggregators
  4. ACL as separate deployment unit Defend your language against the

    enemies Physical station Model + Language Flow Call Flow Adapter
  5. Adapter Web Backend-For- Frontend Mobile Backend-For- Frontend Adapter Adater Adapter

    Adapter Adapter Adapter Adapter Adapter Adapter Architecture
  6. Adapter Web Backend-For- Frontend Mobile Backend-For- Frontend Adapter Adater Adapter

    Adapter Adapter Adapter Adapter Adapter Adapter Service level design
  7. Build Test Package Infra- structure Deploy CI/CD with Bitbucket Pipelines

    Docker image AWS General Resources AWS ECS Service AWS Application Resources
  8. AWS CloudFormation (Infrastructure as Code) Template Stack Harder: Application resources

    as part of the whole platform infrastructure Build Test Package Infra- structure Deploy Easy: ECR Repository for each application to store and access docker image
  9. Build Test Package Infra- structure Deploy Build Test Package Infra-

    structure Deploy Sharing infrastructure code CI/CD Pipeline executed in Docker Container with custom Image aws-cli (python package) cfn-create-or-update (npm package) shared shell scripts shared AWS Cloudformation scripts
  10. Build Test Package Infra- structure Deploy Master Stack Networking Hosting

    Database Queueing Secrets- manager Bastion Host Challenges: Passwords of stacks should not be in code! Creating vs. updating of a stack Excursus to ePower Infrastructure Manually created resources
  11. Build Test Package Infra- structure Deploy VPC AWS Cloud Public

    subnet Private subnet Region eu-central-1 Availability Zone 1 Availability Zone 2 NAT Gateway Auto Scaling Group Instance Instance Amazon Aurora Amazon MQ Bastion Host Elastic Load Balancing Elastic Load Balancing Public subnet Private subnet NAT Gateway Instance Instance Amazon Aurora Amazon MQ Elastic Load Balancing Elastic Load Balancing Secretsmanager Route 53 Elastic Container Service AWS Lambda Amazon IAM Internet gateway Excursus to ePower Infrastructure
  12. How does the application get the urls for http inter-service-communication?

    AWS Secrets Manager Build Test Package Infra- structure Deploy AWS Identity and Access Management (IAM) Role for every Service Permissions List Secrets, Get Secret Value Task Role
  13. Build Test Package Infra- structure Deploy Deployment Docker container image

    of application is built. ECR Repository for container image is built. Application infrastructure resources are built within existing infrastructure. Force new deployment of ECS Service. Push container image.
  14. 200% of running instances are allowed while deployment. Build Test

    Package Infra- structure Deploy Trigger new deployment for service with aws-cli. Place tasks with new image and remove existing ones. Tasks get placed over different availability zones. Press the red button
  15. Fetch secrets and configurations from AWS Secrets Manager Different sources

    for environment variables: - application.yml - System environment variables - PropertySource Fetch secrets and set as environment variables: - URLs - Springboot Admin - Database Credentials - Active MQ Credentials - Configurations AWS Secrets Manager Build Test Package Infra- structure Deploy
  16. AWS Account Setup IAM Users: assume roles in member accounts

    PLAYGROUND Account DEV Account INT Account LIVE Account Root Account Organization Organization Unit