SlideShare a Scribd company logo
Building Bizweb Microservices
with Docker
Nguyễn Minh Khôi
CTO of DKT Technology
dkt.com.vn
Programming Languages
Frameworks & Libraries
Web ServersDatabases
Message Queues
|S3, EC2, Route53
Cloud Services
Others
Bizweb Tech Stack
2
Bizweb Microservices Components
• Based on Spring Boot & Netflix OSS
• Service Discovery: Eureka (Server), Ribbon (Client)
• API Gateway: Zuul
• Centralized Configuration: Spring Cloud Config
• API Security: Spring Security & Spring Security OAuth
• REST API: Spring Boot
• Job Service: Kafka & Spring Boot
3
Bizweb Microservices Architecture
4
Eureka Service Discovery
• Each service has unique serviced
• Service uses Eureka Client to interact
with Eureka Server:
• Register: serviceId, host, port
• Renew: using heartbeats to check status
• Get Registry: return list host:port of
services by serviceId
5
Zuul API Gateway
• Single entry point for clients to call API
• Edge service: not use to call between microservices
• Using Ribbon to call microservices
• Client Load Balancer
• Caching
• Fault tolerance
• Zuul Filter:
• Handle request in pipeline mode
• PRE, ROUTING, POST, ERROR
6
Centralized Configuration
7
Problems:
- Stored on each service,
hard to control
- Hard to update new
configuration
- Reload config at
runtime
Centralized Configuration
8
Problems
• Take times to deploy on new servers:
• Install Java
• Copy fat .jar file (~75-100MB) using FTP/SCP
• Make script to run as a Linux service
• Take times to update services:
• 20 microservices + job services
• Manual update on multiple hosts
• Manual scale & choose server to deploy
• Quite hard to monitor these microservices
9
Solved with Docker & Jenkins
10
Simple Dockerfile for all services
FROM frolvlad/alpine-oraclejdk8:slim
ADD lib lib
ADD product.jar app.jar
RUN sh -c 'touch /app.jar'
ENTRYPOINT ["java","-Xmx128m","-Xms128m","-
Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
11
Docker Swarm Mode
• Built-In Orchestration
• Easy to start
docker swarm init
docker services create --name product product:1.2.0
• Secure by default
docker swarm join --token [manager_token|worker_token]
• Easy to scale
docker service scale product=10
• Rolling updates
docker service update --update-delay 1m --update-parallelism 2
--image product:1.2.1 product
12
Swarm Manager & Worker
13
Swarm Manager & Worker
14
• Maintaining cluster state
• Scheduling services
• Use RAFT consensus to elect new leader
Swarm Manager & Worker
15
• Pull tasks from Managers
• Receive tasks in batch (100ms or 100 tasks)
• Manager node can be worker, too
Combine Netflix OSS with Docker Swarm
• Zuul for API Gateway
• Eureka for Service Discovery
• Ribbon Client for direct call between microservices
• Docker Swarm:
• Manage microservices
• Deploy, scale, update microservices
16
Docker Swarm Deployment
• 3 manager nodes on 3 different physical machines
• Workers on Physical & Virtual Machines
• Using overlay network:
• Communicate with Eureka Server
• Direct call between microservices
• Label for services & environment:
• INFRASTRUCTURE: running Zuul, Eureka, Config, OAuth Service
• SERVICE: running microservices
• JOB: running Job services
• DEV: running all containers of dev environment
17
Docker Swarm Cluster
18
swarm manager
(primary)
config server
eureka server
zuul server
swarm manager
(secondary)
config server
eureka server
zuul server
swarm manager
(secondary)
config server
eureka server
zuul server
worker-01
microservice-02
microservice-xx
microservice-01
worker-xx
microservice-02
microservice-xx
microservice-01
worker-job
job-02
job-xx
job-01
oauth server oauth server oauth server
Bizweb Overlay Network
server-01
redis
INFRASTRUCTUREINFRASTRUCTUREINFRASTRUCTURE
SERVICE SERVICE JOB
worker-dev
job-yy
microservices-xx
DEV
Docker Swarm Cluster
server-02
redis
server-03
redis
Redis Cluster
CI with Jenkins & Docker
• Environment Prerequisites:
• Gitlab 8.12 (support webhooks)
• Jenkins 2
• Docker Registry 2.0
• Run on Docker
19
Data Center Zone
Office Dev Zone
VPN, IP Restriction
local dev server
20
1. Developer pushes to Gitlab repo
2. Gitlab webhook
triggers Jenkins
3. Jenkins pull code from Gitlab:
- source code
- Dockerfile
- Jenkinsfile
4. Compile source code
& build Docker image,
auto tag image
5. Push image to
Private Docker Registry
6. Run custom script based on
branch committed
CI with Jenkins & Docker
• Using Spotify docker-maven-plugin:
• Save space by caching java libraries image layer (~75MB)
• Reduce network traffic & deploy time (only 200-700KB transferred)
• Docker image auto tag:
{git_commit_short_code}-{branch} -> 4b4a71ef-dev
• Custom script based on branch committed:
• dev: trigger another Jenkins Server to update service
• live: manual update
21
Summary
• Docker is great way to package microservices
• Building HA system is easier with Docker Swarm Mode
• CI with Jenkins will reduce delivery time, increase productivity
22
References
• http://www.slideshare.net/juminchoi/bizweb-microservices-
architecture
• https://docs.docker.com/engine/swarm/
• https://www.docker.com/use-cases/cicd
23
Contact
• Nguyễn Minh Khôi – DKT Technology
• Email: khoinm@dkt.com.vn
• Facebook: https://fb.com/khoinguyen84
24
Thank you!
Q&A

More Related Content

PDF
Kinh nghiệm triển khai Microservices tại Sapo.vn
PDF
Bizweb Microservices Architecture
PPTX
Distributed Transaction in Microservice
PDF
Sapo Microservices Architecture
PPTX
Go micro framework to build microservices
PPTX
Software architecture for high traffic website
PPTX
Toi uu hoa he thong 30 trieu nguoi dung
PPTX
Domain Driven Design
Kinh nghiệm triển khai Microservices tại Sapo.vn
Bizweb Microservices Architecture
Distributed Transaction in Microservice
Sapo Microservices Architecture
Go micro framework to build microservices
Software architecture for high traffic website
Toi uu hoa he thong 30 trieu nguoi dung
Domain Driven Design

What's hot (20)

PPTX
Communication in a Microservice Architecture
ODP
Introduction To RabbitMQ
PDF
Service discovery with Eureka and Spring Cloud
PPTX
Microservices Part 3 Service Mesh and Kafka
PPT
Domain Driven Design (DDD)
PPTX
Introduction To Microservices
PDF
Microservice - Up to 500k CCU
PDF
Design patterns for microservice architecture
PDF
Apresentação maven
PDF
Microservice Architecture
PPTX
Microservice vs. Monolithic Architecture
PDF
Event storming
PPTX
Domain Driven Design(DDD) Presentation
PPTX
Domain driven design
PPTX
Micro services and Containers
PPTX
Microservices Architecture Part 2 Event Sourcing and Saga
PPTX
Introduction to Spring Boot
PPTX
Jenkins tutorial for beginners
PPSX
Domain Driven Design
PPSX
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Communication in a Microservice Architecture
Introduction To RabbitMQ
Service discovery with Eureka and Spring Cloud
Microservices Part 3 Service Mesh and Kafka
Domain Driven Design (DDD)
Introduction To Microservices
Microservice - Up to 500k CCU
Design patterns for microservice architecture
Apresentação maven
Microservice Architecture
Microservice vs. Monolithic Architecture
Event storming
Domain Driven Design(DDD) Presentation
Domain driven design
Micro services and Containers
Microservices Architecture Part 2 Event Sourcing and Saga
Introduction to Spring Boot
Jenkins tutorial for beginners
Domain Driven Design
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Ad

Viewers also liked (20)

PPTX
ITLC HN 14 - Bizweb Microservices Architecture
PPTX
Tiki.vn - How we scale as a tech startup
PDF
Domain Driven Design và Event Driven Architecture
PPTX
ITEC - Qua trinh phat trien he thong BigData
PPTX
Đánh giá một website TMĐT theo nguyên tắc 7C (Tiki.vn)
PPTX
High performance web sites with multilevel caching
PPTX
ITLCHN 18 - Automation & DevOps - Automic
PPTX
itlchn 20 - Kien truc he thong chung khoan - Phan 1
PPTX
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
PDF
IM Group hợp tác Haravan - slide nền tảng tổng thể haravan
PPTX
Graph ql
PPTX
Nghiên cứu luật kết hợp áp dụng xây dựng mạng chia sẻ đồ vật MiGi
PPTX
itlchn 20 - Kien truc he thong chung khoan - Phan 2
PDF
Migrating to aws
PDF
API Gateway report
PPTX
Ecom trend
PDF
Google Dev Fest 2016 - Realm database
PDF
Niels Leenheer - Weird browsers - code.talks 2015
PDF
Seamless Migration
PDF
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
ITLC HN 14 - Bizweb Microservices Architecture
Tiki.vn - How we scale as a tech startup
Domain Driven Design và Event Driven Architecture
ITEC - Qua trinh phat trien he thong BigData
Đánh giá một website TMĐT theo nguyên tắc 7C (Tiki.vn)
High performance web sites with multilevel caching
ITLCHN 18 - Automation & DevOps - Automic
itlchn 20 - Kien truc he thong chung khoan - Phan 1
ITLC - Hanoi - NodeJS - ArrowJS - 27-11 - 2015
IM Group hợp tác Haravan - slide nền tảng tổng thể haravan
Graph ql
Nghiên cứu luật kết hợp áp dụng xây dựng mạng chia sẻ đồ vật MiGi
itlchn 20 - Kien truc he thong chung khoan - Phan 2
Migrating to aws
API Gateway report
Ecom trend
Google Dev Fest 2016 - Realm database
Niels Leenheer - Weird browsers - code.talks 2015
Seamless Migration
Dennis Benkert & Matthias Lübken - Patterns in a containerized world? - code....
Ad

Similar to Building Bizweb Microservices with Docker (20)

PDF
Rami Sayar - Node microservices with Docker
PDF
Containers, microservices and serverless for realists
PDF
Deploy microservices in containers with Docker and friends - KCDC2015
PPTX
Devoxx 2016 - Docker Nuts and Bolts
PDF
Alibaba Cloud Conference 2016 - Docker Enterprise
PPTX
Docker for the enterprise
PPTX
A docker love story
PDF
Getting Started with Docker - Nick Stinemates
PDF
Docker + Microservices in Production
PDF
Migrating to Microservices – It's Easier Than You Think
PPTX
Docker Enterprise Workshop - Intro
PPTX
Microservices and containers for the unitiated
PPTX
Microservices in academic environment
PDF
Microservices. Microservices everywhere! (At OSCON 2015)
PDF
Containers, Docker, and Microservices: the Terrific Trio
PPTX
Docker Meetup Paris: enterprise Docker
PDF
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
PPT
TransitioningToMicroServonDocker_MS
PDF
Francisco Javier Ramirez Urea - Hopla - OSL19
PDF
Developer workflow with docker
Rami Sayar - Node microservices with Docker
Containers, microservices and serverless for realists
Deploy microservices in containers with Docker and friends - KCDC2015
Devoxx 2016 - Docker Nuts and Bolts
Alibaba Cloud Conference 2016 - Docker Enterprise
Docker for the enterprise
A docker love story
Getting Started with Docker - Nick Stinemates
Docker + Microservices in Production
Migrating to Microservices – It's Easier Than You Think
Docker Enterprise Workshop - Intro
Microservices and containers for the unitiated
Microservices in academic environment
Microservices. Microservices everywhere! (At OSCON 2015)
Containers, Docker, and Microservices: the Terrific Trio
Docker Meetup Paris: enterprise Docker
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
TransitioningToMicroServonDocker_MS
Francisco Javier Ramirez Urea - Hopla - OSL19
Developer workflow with docker

Recently uploaded (20)

PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Oracle Fusion HCM Cloud Demo for Beginners
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
AutoCAD Professional Crack 2025 With License Key
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PPTX
history of c programming in notes for students .pptx
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Odoo Companies in India – Driving Business Transformation.pdf
Oracle Fusion HCM Cloud Demo for Beginners
Wondershare Filmora 15 Crack With Activation Key [2025
Internet Downloader Manager (IDM) Crack 6.42 Build 41
CHAPTER 2 - PM Management and IT Context
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Advanced SystemCare Ultimate Crack + Portable (2025)
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Monitoring Stack: Grafana, Loki & Promtail
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
17 Powerful Integrations Your Next-Gen MLM Software Needs
Computer Software and OS of computer science of grade 11.pptx
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
AutoCAD Professional Crack 2025 With License Key
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
history of c programming in notes for students .pptx
Salesforce Agentforce AI Implementation.pdf
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design

Building Bizweb Microservices with Docker

  • 1. Building Bizweb Microservices with Docker Nguyễn Minh Khôi CTO of DKT Technology dkt.com.vn
  • 2. Programming Languages Frameworks & Libraries Web ServersDatabases Message Queues |S3, EC2, Route53 Cloud Services Others Bizweb Tech Stack 2
  • 3. Bizweb Microservices Components • Based on Spring Boot & Netflix OSS • Service Discovery: Eureka (Server), Ribbon (Client) • API Gateway: Zuul • Centralized Configuration: Spring Cloud Config • API Security: Spring Security & Spring Security OAuth • REST API: Spring Boot • Job Service: Kafka & Spring Boot 3
  • 5. Eureka Service Discovery • Each service has unique serviced • Service uses Eureka Client to interact with Eureka Server: • Register: serviceId, host, port • Renew: using heartbeats to check status • Get Registry: return list host:port of services by serviceId 5
  • 6. Zuul API Gateway • Single entry point for clients to call API • Edge service: not use to call between microservices • Using Ribbon to call microservices • Client Load Balancer • Caching • Fault tolerance • Zuul Filter: • Handle request in pipeline mode • PRE, ROUTING, POST, ERROR 6
  • 7. Centralized Configuration 7 Problems: - Stored on each service, hard to control - Hard to update new configuration - Reload config at runtime
  • 9. Problems • Take times to deploy on new servers: • Install Java • Copy fat .jar file (~75-100MB) using FTP/SCP • Make script to run as a Linux service • Take times to update services: • 20 microservices + job services • Manual update on multiple hosts • Manual scale & choose server to deploy • Quite hard to monitor these microservices 9
  • 10. Solved with Docker & Jenkins 10
  • 11. Simple Dockerfile for all services FROM frolvlad/alpine-oraclejdk8:slim ADD lib lib ADD product.jar app.jar RUN sh -c 'touch /app.jar' ENTRYPOINT ["java","-Xmx128m","-Xms128m","- Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 11
  • 12. Docker Swarm Mode • Built-In Orchestration • Easy to start docker swarm init docker services create --name product product:1.2.0 • Secure by default docker swarm join --token [manager_token|worker_token] • Easy to scale docker service scale product=10 • Rolling updates docker service update --update-delay 1m --update-parallelism 2 --image product:1.2.1 product 12
  • 13. Swarm Manager & Worker 13
  • 14. Swarm Manager & Worker 14 • Maintaining cluster state • Scheduling services • Use RAFT consensus to elect new leader
  • 15. Swarm Manager & Worker 15 • Pull tasks from Managers • Receive tasks in batch (100ms or 100 tasks) • Manager node can be worker, too
  • 16. Combine Netflix OSS with Docker Swarm • Zuul for API Gateway • Eureka for Service Discovery • Ribbon Client for direct call between microservices • Docker Swarm: • Manage microservices • Deploy, scale, update microservices 16
  • 17. Docker Swarm Deployment • 3 manager nodes on 3 different physical machines • Workers on Physical & Virtual Machines • Using overlay network: • Communicate with Eureka Server • Direct call between microservices • Label for services & environment: • INFRASTRUCTURE: running Zuul, Eureka, Config, OAuth Service • SERVICE: running microservices • JOB: running Job services • DEV: running all containers of dev environment 17
  • 18. Docker Swarm Cluster 18 swarm manager (primary) config server eureka server zuul server swarm manager (secondary) config server eureka server zuul server swarm manager (secondary) config server eureka server zuul server worker-01 microservice-02 microservice-xx microservice-01 worker-xx microservice-02 microservice-xx microservice-01 worker-job job-02 job-xx job-01 oauth server oauth server oauth server Bizweb Overlay Network server-01 redis INFRASTRUCTUREINFRASTRUCTUREINFRASTRUCTURE SERVICE SERVICE JOB worker-dev job-yy microservices-xx DEV Docker Swarm Cluster server-02 redis server-03 redis Redis Cluster
  • 19. CI with Jenkins & Docker • Environment Prerequisites: • Gitlab 8.12 (support webhooks) • Jenkins 2 • Docker Registry 2.0 • Run on Docker 19 Data Center Zone Office Dev Zone VPN, IP Restriction local dev server
  • 20. 20 1. Developer pushes to Gitlab repo 2. Gitlab webhook triggers Jenkins 3. Jenkins pull code from Gitlab: - source code - Dockerfile - Jenkinsfile 4. Compile source code & build Docker image, auto tag image 5. Push image to Private Docker Registry 6. Run custom script based on branch committed
  • 21. CI with Jenkins & Docker • Using Spotify docker-maven-plugin: • Save space by caching java libraries image layer (~75MB) • Reduce network traffic & deploy time (only 200-700KB transferred) • Docker image auto tag: {git_commit_short_code}-{branch} -> 4b4a71ef-dev • Custom script based on branch committed: • dev: trigger another Jenkins Server to update service • live: manual update 21
  • 22. Summary • Docker is great way to package microservices • Building HA system is easier with Docker Swarm Mode • CI with Jenkins will reduce delivery time, increase productivity 22
  • 24. Contact • Nguyễn Minh Khôi – DKT Technology • Email: [email protected] • Facebook: https://fb.com/khoinguyen84 24