Modern Microservices
Architecture with Docker
Alon Fliess
Chief Software Architect
Microsoft Regional Director
alonf@codevalue.net
http://alonfliess.me
1
Eran Stiller
Cloud Division Leader
Senior Software Architect
erans@codevalue.net
http://stiller.co.il/blog
Agenda
Software Architecture
Micro Services Architecture
Containers & Docker
Azure Container Services
Demo
2
About Alon
Chief Architect & Co-Founder at CodeValue
More than 25 years of hands-on experience
Microsoft Regional Director & Microsoft MVP
Active member of Microsoft Advisory Councils
Renowned speaker at both international and
domestic events
3
About Eran
Cloud Division Leader & Co-Founder at CodeValue
Software architect, consultant and instructor
Microsoft Azure MVP
More than 10 years of hands-on experience
Expert in large-scale, server-side, highly-concurrent
systems
Co-Founder of Azure Israel Meetup
4
About CodeValue & OzCode
CodeValue – Inspiring Code. Creating Value.
A consultancy and software development firm
High quality software projects and managed services
Valuable training and mentoring
Advanced software technology and methodology consulting
OzCode – an innovative VS debugging extension
Helps identify and fix bugs during C# development
Saves time and effort
Makes the debugging process easy and simple
6
Software Architecture
What a Modern Architect SHOULD Know
7
SRS
UML
Use
Cases
User
Stories
Risk
Mitigations
Design
Redis
SRP
7
Client
Server
Schema
OOP
SQL
SOA
NoSQL
Encapsulation
Data
JSON
ETL
Reporting
AWS
BASE
Queue
XML
Cloud
Big Data
ACID
Micro
Services
Architecture
Distributed
Cache
REST
Idempotency
BI
Map
Reduce
NLB
HTTP
Indexing
CDN
Search
Security
Log
HPC
Authentication
Docker
Containers
HA
DRPub/Sub
UI/UX
CQRS
MEAN
ORM
Push
Notifications
What a Modern Architect MUST Know
Understand the requirements
Understand the constraints
Low coupling
High cohesion
Balance of size & number of components
Volatility
Workplace politics
Software Architecture
The system structure
Built from software components
The relationship between components
The properties of both components and relations
Software architecture is about making fundamental
structural choices
Which are costly to change once implemented
Designing software architecture is a mix of art and science!
Software Architecture Goals
Defining a structured solution that
Meets all the technical and operational requirements
Captures the non-volatile (hard to change) decisions
Focuses on important elements of the system (context)
Provide a solid foundation for a successful software product
Answer the requirements:
Functional
Non-Functional (quality attributes)
Constraints
10
Cohesion
The degree to which a module
performs one and only one function
Strive for high cohesion
A module can be:
Library (assembly, shared module, DLL)
File
Class
Method
COM/CORBA component
(Micro) Service
Any reusable element
11
Coupling
The degree to which each program module
relies on each of the other modules
Low coupling often correlates with
high cohesion, and vice versa
Low coupling is
A sign of a well-structured computer system
Good design
When combined with high cohesion
Supports high readability, maintainability, extendibility, and
reusability
Micro Service Architecture == High Cohesion & Low Coupling
12
Why Should I Care About Coupling
Tightly coupled systems tend to exhibit the following
developmental characteristics
A change in one module usually forces a ripple (cascading) effect
of changes in other modules
Assembly of modules might require more effort and/or time due
to the increased inter-module dependency
A particular module might be harder to reuse and/or test because
dependent modules must be included
The DevOps process becomes a nightmare!!!
13
Fan-In Fan-Out and Stable Module
One way to examine module stability (i.e. low coupling and high
cohesion) is by looking at its fan-in fan-out and other dependencies
Fan-In
The number of users of the module
Fan-Out
The number of modules that the current module is being used by
A stable module is a module that has high fun-in and low fan-out
This module can be easily reused
14
Just The Right Number Of Modules
15
number of modules
Module
integration cost
module development cost
The cost of
the software
Modern Software Project Challenges
16
We need to do more with less
More functional requirements and better quality
attributes
(Many) more end users
(Many) more servers to manage with less operators
More changes with less or even no maintenance
downtime
The 24/7 Challenge
How do you update a system running
24/7/365?
How do you keep the application servers
responsive?
How do you keep all application servers
synced?
How do you update the data/schema?
How do you update all your clients’ software?
Web, Mobile, Desktop…
How do you rollback on error?
How do you rollback data?
How do you know there is an error?
17
The 24/7 Challenge
Plan ahead
DevOps
Architect
Low Coupling, High Cohesion
Schema/API Versioning
Use supporting platforms
Cloud
Containers
18
Microservices Architecture (MSA) - Wikipedia
“Microservices is a specialization of and implementation approach for
service-oriented architectures (SOA) used to build flexible,
independently deployable software systems”
“Services are small in size, messaging enabled, bounded by contexts,
autonomously developed, independently deployable, decentralized
and built and released with automated processes”
“The benefit of distributing different responsibilities of the system into
different smaller services is that it enhances the cohesion and
decreases the coupling”
19
MSA Criticism
The architecture introduces additional complexity
such as:
Network latency
Message formats and versioning nightmare
Load balancing and fault tolerance management
Testing and deployment are more complicated
20
MSA Drawbacks Solution
Plan ahead
DevOps
Architect
Low Coupling, High Cohesion
Schema/API Versioning
Use supporting platforms
Cloud
Containers
21
22
Modern Microservices Architecture
with Docker
Docker, Docker, Docker
Containers have been around for many years
Docker Inc. did not invent them
They created open source software to build and manage containers
Docker makes containers easy
Even I can create and run them
Docker is a container format and a set of tools
Docker CLI, Docker Engine, Docker Swarm, Docker Compose, Docker Machine
and more…
Docker is an eco-system
23
Server
Host OS
Hypervisor
Server
Host OS
Docker Engine
Guest
OS
Guest
OS
Guest
OS
Bins/Libs Bins/Libs Bins/Libs
App A App A’ App B
Bins/Libs Bins/Libs
AppA
AppA’
AppB
AppB’
AppB
AppB’
AppB
AppB’
Containers are isolated,
but share OS and, where
appropriate,
bins/libraries
Bins/Libs
Developer Workstation
Docker Host
Container
Container
Container
Developer Workstation
Docker Engine
Container
Container
Container
Container
Container
Container
Developer Workstation
Container
Container
ContainerContainer
Container
Container
Container
Container
Container
App1
App2
Demo Architecture
33
Web Portal
RedisTwitter Reader
Queue
Twitter
Twitter Analyzer
Queue
Aggregator
Pub/Sub
Microsoft Cognitive Services
Demo Architecture
34
RedisTwitter Reader
Web Portal
Load Balancer
Queue
Twitter
Queue
Aggregator
Pub/Sub
Microsoft Cognitive Services
Twitter Analyzer
Demo
35
https://github.com/estiller/tweet-analyzer-demo
Summary
Software Architecture
Micro services Architecture
Containers & Docker
Azure Container Services
Demo
39
41

Modern Microservices Architecture with Docker

  • 1.
    Modern Microservices Architecture withDocker Alon Fliess Chief Software Architect Microsoft Regional Director alonf@codevalue.net http://alonfliess.me 1 Eran Stiller Cloud Division Leader Senior Software Architect erans@codevalue.net http://stiller.co.il/blog
  • 2.
    Agenda Software Architecture Micro ServicesArchitecture Containers & Docker Azure Container Services Demo 2
  • 3.
    About Alon Chief Architect& Co-Founder at CodeValue More than 25 years of hands-on experience Microsoft Regional Director & Microsoft MVP Active member of Microsoft Advisory Councils Renowned speaker at both international and domestic events 3
  • 4.
    About Eran Cloud DivisionLeader & Co-Founder at CodeValue Software architect, consultant and instructor Microsoft Azure MVP More than 10 years of hands-on experience Expert in large-scale, server-side, highly-concurrent systems Co-Founder of Azure Israel Meetup 4
  • 5.
    About CodeValue &OzCode CodeValue – Inspiring Code. Creating Value. A consultancy and software development firm High quality software projects and managed services Valuable training and mentoring Advanced software technology and methodology consulting OzCode – an innovative VS debugging extension Helps identify and fix bugs during C# development Saves time and effort Makes the debugging process easy and simple
  • 6.
  • 7.
    What a ModernArchitect SHOULD Know 7 SRS UML Use Cases User Stories Risk Mitigations Design Redis SRP 7 Client Server Schema OOP SQL SOA NoSQL Encapsulation Data JSON ETL Reporting AWS BASE Queue XML Cloud Big Data ACID Micro Services Architecture Distributed Cache REST Idempotency BI Map Reduce NLB HTTP Indexing CDN Search Security Log HPC Authentication Docker Containers HA DRPub/Sub UI/UX CQRS MEAN ORM Push Notifications
  • 8.
    What a ModernArchitect MUST Know Understand the requirements Understand the constraints Low coupling High cohesion Balance of size & number of components Volatility Workplace politics
  • 9.
    Software Architecture The systemstructure Built from software components The relationship between components The properties of both components and relations Software architecture is about making fundamental structural choices Which are costly to change once implemented Designing software architecture is a mix of art and science!
  • 10.
    Software Architecture Goals Defininga structured solution that Meets all the technical and operational requirements Captures the non-volatile (hard to change) decisions Focuses on important elements of the system (context) Provide a solid foundation for a successful software product Answer the requirements: Functional Non-Functional (quality attributes) Constraints 10
  • 11.
    Cohesion The degree towhich a module performs one and only one function Strive for high cohesion A module can be: Library (assembly, shared module, DLL) File Class Method COM/CORBA component (Micro) Service Any reusable element 11
  • 12.
    Coupling The degree towhich each program module relies on each of the other modules Low coupling often correlates with high cohesion, and vice versa Low coupling is A sign of a well-structured computer system Good design When combined with high cohesion Supports high readability, maintainability, extendibility, and reusability Micro Service Architecture == High Cohesion & Low Coupling 12
  • 13.
    Why Should ICare About Coupling Tightly coupled systems tend to exhibit the following developmental characteristics A change in one module usually forces a ripple (cascading) effect of changes in other modules Assembly of modules might require more effort and/or time due to the increased inter-module dependency A particular module might be harder to reuse and/or test because dependent modules must be included The DevOps process becomes a nightmare!!! 13
  • 14.
    Fan-In Fan-Out andStable Module One way to examine module stability (i.e. low coupling and high cohesion) is by looking at its fan-in fan-out and other dependencies Fan-In The number of users of the module Fan-Out The number of modules that the current module is being used by A stable module is a module that has high fun-in and low fan-out This module can be easily reused 14
  • 15.
    Just The RightNumber Of Modules 15 number of modules Module integration cost module development cost The cost of the software
  • 16.
    Modern Software ProjectChallenges 16 We need to do more with less More functional requirements and better quality attributes (Many) more end users (Many) more servers to manage with less operators More changes with less or even no maintenance downtime
  • 17.
    The 24/7 Challenge Howdo you update a system running 24/7/365? How do you keep the application servers responsive? How do you keep all application servers synced? How do you update the data/schema? How do you update all your clients’ software? Web, Mobile, Desktop… How do you rollback on error? How do you rollback data? How do you know there is an error? 17
  • 18.
    The 24/7 Challenge Planahead DevOps Architect Low Coupling, High Cohesion Schema/API Versioning Use supporting platforms Cloud Containers 18
  • 19.
    Microservices Architecture (MSA)- Wikipedia “Microservices is a specialization of and implementation approach for service-oriented architectures (SOA) used to build flexible, independently deployable software systems” “Services are small in size, messaging enabled, bounded by contexts, autonomously developed, independently deployable, decentralized and built and released with automated processes” “The benefit of distributing different responsibilities of the system into different smaller services is that it enhances the cohesion and decreases the coupling” 19
  • 20.
    MSA Criticism The architectureintroduces additional complexity such as: Network latency Message formats and versioning nightmare Load balancing and fault tolerance management Testing and deployment are more complicated 20
  • 21.
    MSA Drawbacks Solution Planahead DevOps Architect Low Coupling, High Cohesion Schema/API Versioning Use supporting platforms Cloud Containers 21
  • 22.
  • 23.
    Docker, Docker, Docker Containershave been around for many years Docker Inc. did not invent them They created open source software to build and manage containers Docker makes containers easy Even I can create and run them Docker is a container format and a set of tools Docker CLI, Docker Engine, Docker Swarm, Docker Compose, Docker Machine and more… Docker is an eco-system 23
  • 24.
    Server Host OS Hypervisor Server Host OS DockerEngine Guest OS Guest OS Guest OS Bins/Libs Bins/Libs Bins/Libs App A App A’ App B Bins/Libs Bins/Libs AppA AppA’ AppB AppB’ AppB AppB’ AppB AppB’ Containers are isolated, but share OS and, where appropriate, bins/libraries Bins/Libs
  • 25.
  • 26.
  • 27.
  • 29.
  • 30.
    Demo Architecture 33 Web Portal RedisTwitterReader Queue Twitter Twitter Analyzer Queue Aggregator Pub/Sub Microsoft Cognitive Services
  • 31.
    Demo Architecture 34 RedisTwitter Reader WebPortal Load Balancer Queue Twitter Queue Aggregator Pub/Sub Microsoft Cognitive Services Twitter Analyzer
  • 32.
  • 33.
    Summary Software Architecture Micro servicesArchitecture Containers & Docker Azure Container Services Demo 39
  • 34.

Editor's Notes

  • #17 Free image source: https://pixabay.com/en/neon-neon-sign-the-text-of-the-open-1191281/
  • #19 Free image source: https://pixabay.com/en/approval-female-gesture-hand-happy-15914/
  • #22 Free image source: https://pixabay.com/en/approval-female-gesture-hand-happy-15914/