SlideShare a Scribd company logo
1 of 40
Download to read offline
Container-Based Microservice Architecture
M A K I N G D R E A M W E D D I N G S P O S S I B L E
Docker ID Meetup - Jakarta, 28 March 2018
ADITYA HILMAN
M A K I N G D R E A M W E D D I N G S P O S S I B L E
ABOUT ME
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
PROFESSIONAL
● Linux System Consultant, Indolinux (2008 - 2011)
● Senior System Administrator, FirstWAP (2011-2014)
● System Architect Engineer, Bridestory (2014-now)
CONTACT
● Personal Email : aditya.hilman@gmail.com
● Business Email : aditya.hilman@bridestory.com
● Linkedin : http://bit.ly/adityahilman
WHAT IS
BRIDESTORY?
M A K I N G D R E A M W E D D I N G S P O S S I B L E
WHAT IS BRIDESTORY
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
OUR VISION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
OUR VISION
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
TO HELP CREATE DREAM WEDDINGS POSSIBLE FOR
EVERYONE, EVERYWHERE
OUR MISSION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
OUR MISSION
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
TO BECOME THE MOST POWERFUL TOOL FOR
BRIDES-TO-BE AROUND THE WORLD THAT ENABLES
THEM TO:
FIND MILLION OF
WEDDING
INSPIRATIONS
FIND THE BEST
WEDDING VENDORS
ANYWHERE
BOOK THEIR SERVICE
THROUGH OUR WEDDING
CONSULTANT SERVICE
BRIDESTORY IN
NUMBERS
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY IN NUMBERS
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
*according to Similar Web, since August 2015
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY PRODUCTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
CONTAINER-BASED
MICROSERVICE ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
DISCLAIMER
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Emphasis on infrastructure and deployment point of view, not on application or
software development point of view
MONOLITHIC
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Pros :
● Simple infra architecture
● Easy to troubleshoot
Cons :
● Slow iteration: small change requires full
deployment
● Difficult to isolate application services
● Difficult to deploy
● Difficult to scale
From infrastructure point of view
MONOLITHIC BIG PROBLEM
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
v1.0 v2.0 v2.1
Local Staging Production
DOCKERIZE ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Pros :
● Isolate
● Easy deployment
Cons :
● Difficult to scale
MONOLITHIC vs MICROSERVICE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
MONOLITHIC vs MICROSERVICE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
MICROSERVICE ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Pros :
● Easy to scale
● Infra cost effective (start with 1 instance)
Cons :
● More complex deployment pipeline
● Challenging in Logging, need to build
Centralized Logging
From infrastructure point of view
AWS ELASTIC CONTAINER SERVICE (ECS)
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
ECS COMPONENTS
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
IMPLEMENTATION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● URL Application Health Check
○ /microservice/healthcheck (Custom Url)
● Application Load Balancer
○ Distribute traffic to container
● Task Definition
○ Group of container
● Cluster
○ Group of services
● Service
○ Group of tasks
TASK DEFINITION
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Docker image for each container
● CPU and Memory requirement for each container
● Links between containers
● Networking and port settings
● Log settings
SERVICES
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Manage long-running workloads
● Monitor running tasks
● Restart tasks if they fail
Application Load Balancer-Based Service Discovery
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Service health checks
● Automatic registration/de-registration services
● Path and Host based routing
SECURING ECS CLUSTER
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
BRIDESTORY ARCHITECTURE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
ECS DEPLOYMENT
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
DEPLOYMENT PIPELINE
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
● Checkout Repo
● Build & Tag Docker Image
● Container Testing
● Push Docker Image to ECR
● Create New Task
● Update Service Cluster
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Build & Docker Image
sh 'docker build -f dockerfile-staging -t microservice-app:staging-${BUILD_NUMBER} .'
● Different dockerfile for staging and production
● Tag ${BUILD_NUMBER} => Jenkins Env Variable
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Container Testing
sh './container-testing.bash'
docker run --rm --name ms-staging -d -P microservice-app:staging-${BUILD_NUMBER}
MS_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' ms-staging`
sleep 30s
RESPONSE_CODE=`curl -I -X GET http://$MS_IP/v2/endpoint | head -n1 | awk '{ print $2 }'`
if [ $RESPONSE_CODE != "200" ]
then
echo "Tests Failed! - Return code $RESPONSE_CODE"
echo "Remove ms-staging container"
docker stop ms-staging
exit 1
else
echo "Tests Passed"
echo "Remove ms-staging container"
docker stop ms-staging
exit 0
fi
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Create New Task
sh 'sed -e "s:BUILD_NUMBER:${BUILD_NUMBER}:g"
task-template/staging/microservice-app.json > microservice-app-${BUILD_NUMBER}.json'
sh 'aws ecs register-task-definition --family microservice-staging-task --cli-input-json
file://microservice-app-${BUILD_NUMBER}.json'
● Tag ${BUILD_NUMBER} => Jenkins Env Variable
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Task Template
{
"containerDefinitions": [
{
"portMappings": [
{
"hostPort": 0,
"containerPort": 3000,
"protocol": "tcp"
}
],
"essential": true,
"name": "chat-staging-container",
"image": "xxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/chat-web:staging-BUILD_NUMBER",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "cluster-staging",
"awslogs-region": "ap-southeast-1",
"awslogs-stream-prefix": "chat-staging"
}
},
"cpu": 0,
"memoryReservation": 128
}
],
"family": "chat-staging-task"
}
JENKINS DEPLOYMENT WORKFLOW
M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Stage : Update Service Cluster
#!/bin/bash
TASK_REVISION=`aws ecs describe-task-definition --task-definition
microservice-staging-task | egrep "revision" | tr "/" " " | awk '{ print $2 }' | sed
's/,$//'`
DESIRED_COUNT=`aws ecs describe-services --services
arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service --cluster
arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private | egrep
"desiredCount" | tr "/" " " | awk '{print $2}' | sed 's/,$//' | head -n1`
if [ ${DESIRED_COUNT} = "0" ]; then
DESIRED_COUNT="1"
fi
aws ecs update-service --cluster
arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private
--service arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service
--task-definition microservice-staging-task:${TASK_REVISION} --desired-count
${DESIRED_COUNT}
MONITORING
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
MONITORING & ALERTING
● GRAFANA
● GOOGLE STACK DRIVER
● TELEGRAM
● EMAIL
CENTRALIZED LOGGING
● CLOUDWATCH LOGS
● ELK STACK
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
GRAFANA
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
TELEGRAM
M A K I N G D R E A M W E D D I N G S P O S S I B L E
BRIDESTORY - DOCKER ID MEETUP
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
Q & A
M A K I N G D R E A M W E D D I N G S P O S S I B L E
Q & A
© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.

More Related Content

Similar to Container-Based Microservice Architecture

How to build technology based product effectively
How to build technology based product effectivelyHow to build technology based product effectively
How to build technology based product effectivelyDoni Hanafi
 
Snowflake Ohio Valley User Group Meeting - June 2022
Snowflake Ohio Valley User Group Meeting - June 2022Snowflake Ohio Valley User Group Meeting - June 2022
Snowflake Ohio Valley User Group Meeting - June 2022Snowflake User Groups
 
SMAC - Presentation from RetailWeek Technology Summit, Sept 23
SMAC - Presentation from RetailWeek Technology Summit, Sept 23SMAC - Presentation from RetailWeek Technology Summit, Sept 23
SMAC - Presentation from RetailWeek Technology Summit, Sept 23AirTight Networks
 
Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...
Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...
Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...AgileNetwork
 
Neo4j GraphTour New York_ GraphAware Presentation_Michal Bachman
Neo4j GraphTour New York_ GraphAware Presentation_Michal BachmanNeo4j GraphTour New York_ GraphAware Presentation_Michal Bachman
Neo4j GraphTour New York_ GraphAware Presentation_Michal BachmanNeo4j
 
INTERFACE, by apidays - API Data Protection in Gateways
INTERFACE, by apidays - API Data Protection in GatewaysINTERFACE, by apidays - API Data Protection in Gateways
INTERFACE, by apidays - API Data Protection in Gatewaysapidays
 
Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...
Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...
Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...Codemotion
 
Secrets of Successful Digital Transformers
Secrets of Successful Digital TransformersSecrets of Successful Digital Transformers
Secrets of Successful Digital TransformersVMware Tanzu
 
NaviSite Webinar_Scramble to Strategy_final
NaviSite Webinar_Scramble to Strategy_finalNaviSite Webinar_Scramble to Strategy_final
NaviSite Webinar_Scramble to Strategy_finalRay Glass
 
Getting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsGetting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsThousandEyes
 
Brink sanders cisco architecture keynote
Brink sanders   cisco architecture keynoteBrink sanders   cisco architecture keynote
Brink sanders cisco architecture keynoteNur Shiqim Chok
 
Getting Demo & POV Ready
Getting Demo & POV ReadyGetting Demo & POV Ready
Getting Demo & POV ReadyThousandEyes
 
Basc presentation on security and application architecture
Basc presentation on security and application architectureBasc presentation on security and application architecture
Basc presentation on security and application architecturewbjwilliams3
 
Why I Am a Software Engineer
Why I Am a Software EngineerWhy I Am a Software Engineer
Why I Am a Software EngineerCraig Saunders
 
Realise True Business Value .pdf
Realise True Business Value .pdfRealise True Business Value .pdf
Realise True Business Value .pdfThousandEyes
 
Git to empower your instinctive skills and your collaboration culture
Git to empower your instinctive skills and your collaboration cultureGit to empower your instinctive skills and your collaboration culture
Git to empower your instinctive skills and your collaboration cultureCarlo Gilmar Padilla Santana
 
© 2017 Cisco andor its affiliates. All rights reserved. Ci.docx
© 2017  Cisco andor its affiliates. All rights reserved.   Ci.docx© 2017  Cisco andor its affiliates. All rights reserved.   Ci.docx
© 2017 Cisco andor its affiliates. All rights reserved. Ci.docxgerardkortney
 
PaaS in the Real World
PaaS in the Real WorldPaaS in the Real World
PaaS in the Real WorldAngie Hirata
 
How Web Analytics can help User Experience
How Web Analytics can help User ExperienceHow Web Analytics can help User Experience
How Web Analytics can help User ExperiencePatrick Glinski
 
Getting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsGetting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsThousandEyes
 

Similar to Container-Based Microservice Architecture (20)

How to build technology based product effectively
How to build technology based product effectivelyHow to build technology based product effectively
How to build technology based product effectively
 
Snowflake Ohio Valley User Group Meeting - June 2022
Snowflake Ohio Valley User Group Meeting - June 2022Snowflake Ohio Valley User Group Meeting - June 2022
Snowflake Ohio Valley User Group Meeting - June 2022
 
SMAC - Presentation from RetailWeek Technology Summit, Sept 23
SMAC - Presentation from RetailWeek Technology Summit, Sept 23SMAC - Presentation from RetailWeek Technology Summit, Sept 23
SMAC - Presentation from RetailWeek Technology Summit, Sept 23
 
Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...
Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...
Agile Kolkata 2022 - Somanth Chatterjee & Soumen Deb | Managing Innovation wi...
 
Neo4j GraphTour New York_ GraphAware Presentation_Michal Bachman
Neo4j GraphTour New York_ GraphAware Presentation_Michal BachmanNeo4j GraphTour New York_ GraphAware Presentation_Michal Bachman
Neo4j GraphTour New York_ GraphAware Presentation_Michal Bachman
 
INTERFACE, by apidays - API Data Protection in Gateways
INTERFACE, by apidays - API Data Protection in GatewaysINTERFACE, by apidays - API Data Protection in Gateways
INTERFACE, by apidays - API Data Protection in Gateways
 
Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...
Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...
Roger Dickinson - Making Enterprise Virtual Reality a Practical Reality - Cod...
 
Secrets of Successful Digital Transformers
Secrets of Successful Digital TransformersSecrets of Successful Digital Transformers
Secrets of Successful Digital Transformers
 
NaviSite Webinar_Scramble to Strategy_final
NaviSite Webinar_Scramble to Strategy_finalNaviSite Webinar_Scramble to Strategy_final
NaviSite Webinar_Scramble to Strategy_final
 
Getting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsGetting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of Concepts
 
Brink sanders cisco architecture keynote
Brink sanders   cisco architecture keynoteBrink sanders   cisco architecture keynote
Brink sanders cisco architecture keynote
 
Getting Demo & POV Ready
Getting Demo & POV ReadyGetting Demo & POV Ready
Getting Demo & POV Ready
 
Basc presentation on security and application architecture
Basc presentation on security and application architectureBasc presentation on security and application architecture
Basc presentation on security and application architecture
 
Why I Am a Software Engineer
Why I Am a Software EngineerWhy I Am a Software Engineer
Why I Am a Software Engineer
 
Realise True Business Value .pdf
Realise True Business Value .pdfRealise True Business Value .pdf
Realise True Business Value .pdf
 
Git to empower your instinctive skills and your collaboration culture
Git to empower your instinctive skills and your collaboration cultureGit to empower your instinctive skills and your collaboration culture
Git to empower your instinctive skills and your collaboration culture
 
© 2017 Cisco andor its affiliates. All rights reserved. Ci.docx
© 2017  Cisco andor its affiliates. All rights reserved.   Ci.docx© 2017  Cisco andor its affiliates. All rights reserved.   Ci.docx
© 2017 Cisco andor its affiliates. All rights reserved. Ci.docx
 
PaaS in the Real World
PaaS in the Real WorldPaaS in the Real World
PaaS in the Real World
 
How Web Analytics can help User Experience
How Web Analytics can help User ExperienceHow Web Analytics can help User Experience
How Web Analytics can help User Experience
 
Getting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsGetting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of Concepts
 

Recently uploaded

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Container-Based Microservice Architecture

  • 1. Container-Based Microservice Architecture M A K I N G D R E A M W E D D I N G S P O S S I B L E Docker ID Meetup - Jakarta, 28 March 2018
  • 2. ADITYA HILMAN M A K I N G D R E A M W E D D I N G S P O S S I B L E ABOUT ME © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. PROFESSIONAL ● Linux System Consultant, Indolinux (2008 - 2011) ● Senior System Administrator, FirstWAP (2011-2014) ● System Architect Engineer, Bridestory (2014-now) CONTACT ● Personal Email : aditya.hilman@gmail.com ● Business Email : aditya.hilman@bridestory.com ● Linkedin : http://bit.ly/adityahilman
  • 3. WHAT IS BRIDESTORY? M A K I N G D R E A M W E D D I N G S P O S S I B L E WHAT IS BRIDESTORY © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 4. OUR VISION M A K I N G D R E A M W E D D I N G S P O S S I B L E OUR VISION © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. TO HELP CREATE DREAM WEDDINGS POSSIBLE FOR EVERYONE, EVERYWHERE
  • 5. OUR MISSION M A K I N G D R E A M W E D D I N G S P O S S I B L E OUR MISSION © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. TO BECOME THE MOST POWERFUL TOOL FOR BRIDES-TO-BE AROUND THE WORLD THAT ENABLES THEM TO: FIND MILLION OF WEDDING INSPIRATIONS FIND THE BEST WEDDING VENDORS ANYWHERE BOOK THEIR SERVICE THROUGH OUR WEDDING CONSULTANT SERVICE
  • 6. BRIDESTORY IN NUMBERS M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY IN NUMBERS © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. *according to Similar Web, since August 2015
  • 7. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 8. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 9. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 10. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 11. BRIDESTORY PRODUCTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 12. CONTAINER-BASED MICROSERVICE ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 13. DISCLAIMER M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Emphasis on infrastructure and deployment point of view, not on application or software development point of view
  • 14. MONOLITHIC M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Pros : ● Simple infra architecture ● Easy to troubleshoot Cons : ● Slow iteration: small change requires full deployment ● Difficult to isolate application services ● Difficult to deploy ● Difficult to scale From infrastructure point of view
  • 15. MONOLITHIC BIG PROBLEM M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. v1.0 v2.0 v2.1 Local Staging Production
  • 16. DOCKERIZE ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Pros : ● Isolate ● Easy deployment Cons : ● Difficult to scale
  • 17. MONOLITHIC vs MICROSERVICE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 18. MONOLITHIC vs MICROSERVICE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 19. MICROSERVICE ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Pros : ● Easy to scale ● Infra cost effective (start with 1 instance) Cons : ● More complex deployment pipeline ● Challenging in Logging, need to build Centralized Logging From infrastructure point of view
  • 20. AWS ELASTIC CONTAINER SERVICE (ECS) M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 21. ECS COMPONENTS M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 22. IMPLEMENTATION M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● URL Application Health Check ○ /microservice/healthcheck (Custom Url) ● Application Load Balancer ○ Distribute traffic to container ● Task Definition ○ Group of container ● Cluster ○ Group of services ● Service ○ Group of tasks
  • 23. TASK DEFINITION M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Docker image for each container ● CPU and Memory requirement for each container ● Links between containers ● Networking and port settings ● Log settings
  • 24. SERVICES M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Manage long-running workloads ● Monitor running tasks ● Restart tasks if they fail
  • 25. Application Load Balancer-Based Service Discovery M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Service health checks ● Automatic registration/de-registration services ● Path and Host based routing
  • 26. SECURING ECS CLUSTER M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 27. BRIDESTORY ARCHITECTURE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 28. ECS DEPLOYMENT M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 29. DEPLOYMENT PIPELINE M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. ● Checkout Repo ● Build & Tag Docker Image ● Container Testing ● Push Docker Image to ECR ● Create New Task ● Update Service Cluster
  • 30. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 31. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Build & Docker Image sh 'docker build -f dockerfile-staging -t microservice-app:staging-${BUILD_NUMBER} .' ● Different dockerfile for staging and production ● Tag ${BUILD_NUMBER} => Jenkins Env Variable
  • 32. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Container Testing sh './container-testing.bash' docker run --rm --name ms-staging -d -P microservice-app:staging-${BUILD_NUMBER} MS_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' ms-staging` sleep 30s RESPONSE_CODE=`curl -I -X GET http://$MS_IP/v2/endpoint | head -n1 | awk '{ print $2 }'` if [ $RESPONSE_CODE != "200" ] then echo "Tests Failed! - Return code $RESPONSE_CODE" echo "Remove ms-staging container" docker stop ms-staging exit 1 else echo "Tests Passed" echo "Remove ms-staging container" docker stop ms-staging exit 0 fi
  • 33. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Create New Task sh 'sed -e "s:BUILD_NUMBER:${BUILD_NUMBER}:g" task-template/staging/microservice-app.json > microservice-app-${BUILD_NUMBER}.json' sh 'aws ecs register-task-definition --family microservice-staging-task --cli-input-json file://microservice-app-${BUILD_NUMBER}.json' ● Tag ${BUILD_NUMBER} => Jenkins Env Variable
  • 34. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Task Template { "containerDefinitions": [ { "portMappings": [ { "hostPort": 0, "containerPort": 3000, "protocol": "tcp" } ], "essential": true, "name": "chat-staging-container", "image": "xxxxx.dkr.ecr.ap-southeast-1.amazonaws.com/chat-web:staging-BUILD_NUMBER", "logConfiguration": { "logDriver": "awslogs", "options": { "awslogs-group": "cluster-staging", "awslogs-region": "ap-southeast-1", "awslogs-stream-prefix": "chat-staging" } }, "cpu": 0, "memoryReservation": 128 } ], "family": "chat-staging-task" }
  • 35. JENKINS DEPLOYMENT WORKFLOW M A K I N G D R E A M W E D D I N G S P O S S I B L E© 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners. Stage : Update Service Cluster #!/bin/bash TASK_REVISION=`aws ecs describe-task-definition --task-definition microservice-staging-task | egrep "revision" | tr "/" " " | awk '{ print $2 }' | sed 's/,$//'` DESIRED_COUNT=`aws ecs describe-services --services arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service --cluster arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private | egrep "desiredCount" | tr "/" " " | awk '{print $2}' | sed 's/,$//' | head -n1` if [ ${DESIRED_COUNT} = "0" ]; then DESIRED_COUNT="1" fi aws ecs update-service --cluster arn:aws:ecs:ap-southeast-1:xxxxxxx:cluster/microservice-staging-cluster-private --service arn:aws:ecs:ap-southeast-1:xxxxxxx:service/microservice-staging-service --task-definition microservice-staging-task:${TASK_REVISION} --desired-count ${DESIRED_COUNT}
  • 36. MONITORING M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 37. MONITORING & ALERTING ● GRAFANA ● GOOGLE STACK DRIVER ● TELEGRAM ● EMAIL CENTRALIZED LOGGING ● CLOUDWATCH LOGS ● ELK STACK M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 38. GRAFANA M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 39. TELEGRAM M A K I N G D R E A M W E D D I N G S P O S S I B L E BRIDESTORY - DOCKER ID MEETUP © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.
  • 40. Q & A M A K I N G D R E A M W E D D I N G S P O S S I B L E Q & A © 2018 BRIDESTORY. All content & materials in this presentation belongs to Bridestory and its partners.