microservices architecture
TRANSCRIPT
Microservices ArchitectureRam Vijapurapu ~ @rvijapurapu
Agenda
2
*Terms & conditions apply.
3
4
Monolith
tl;dr ….
Microservice
The Quest for Modularity
5
Sales Inventory Admin
Web/shop /inventory /admin Mobile
Controllers (& Services)shopSvc inventorySvc adminSvc
DAOs
Security Framework
NAPPY_SITE_DB
What if?
6
Web/sales /inventory /admin Mobile
Controllers (& Services)shopSvc inventorySvc adminSvc
DAOs
Security Framework
IoT
Controllers (& Services)shopSvc inventorySvc adminSvc
buttonOrderSvc
BIG_F$_SITE_DB
What if?
7
Web/sales /inventory /admin Mobile
Controllers (& Services)shopSvc inventorySvc adminSvc
DAOs
Security Framework
IoT
Controllers (& Services)shopSvc inventorySvc adminSvc
buttonOrderSvc
BIG_F$_SITE_DB
Something has to change….
8
Micro ervicesto the rescue….
By Source, Fair use, https://en.wikipedia.org/w/index.php?curid=45003610
Is Microservices the new Hype?
9
https://de.wikipedia.org/wiki/Datei:Back-to-the-future-logo.svg10
Let’s start at the very beginning“Even though the UNIX system introduces a number of innovative programs and
techniques, no single program or idea makes it work well. Instead, what makes it
effective is the approach to programming, a philosophy of using the computer.
Although that philosophy can’t be written down in a single sentence, at its heart is the
idea that the power of a system comes more from the
relationships among programs than from the
programs themselves. Many UNIX programs do quite trivial things in
isolation, but, combined with other programs, become general and useful tools.”
– Brian Kernighan and Rob Pike, The UNIX Programming Environment
11
Let’s start at the very beginning
Write programs that do one
thing and do it well. Write
programs to work together. Write
programs to handle text streams, because that is a universal interface.
- Doug McIlroy, the inventor of Unix pipes
Read More: The Art of Unix Programming http://www.catb.org/~esr/writings/taoup/html/index.html 12
Whatever that means...
13
14
So the secret ingredient is?
…..Data
Flow Based Programming….
15
Flow Based Programming….
16
Flow-based programming (FBP) is a programming
paradigm that defines applications as networks of
"black box" processes, which exchange data across
predefined connections by message passing, where
the connections are specified externally to the
processes.
Microservices in the wild….
17
● Intents● Activities● Services● Broadcast Receivers● Listeners
Microservices in the wild….
18
Just give me a definition, will ya!
The microservice architectural style is an approach to developing a
single application as a suite of small
services, each running in its own process and communicating with lightweight
mechanisms, often an HTTP resource API. These services are built around business
capabilities and independently deployable by fully automated deployment machinery.
There is a bare minimum of centralized management of these services, which may be
written in different programming languages and use different data storage
technologies. - James Lewis & Martin Fowler
Read More: Microservices a definition of this new architectural term http://martinfowler.com/articles/microservices.html 19
Isn’t that what SOA is?
20
YesNO!
Maybe
Let’s backup a bit….
21
Sales Inventory Admin
Web/sales /inventory /admin Mobile
Controllers (& Services)shopSvc inventorySvc adminSvc
DAOs
Security Framework
Building Castles
22
Sales
/shop
SalesSvc
Shop DAO
Security
Inventory
/inventory
InventorySvc
Inventory DAO
Security
Admin
/admin
AdminSvc
Admin DAO
Security
The focus will be on communication
23
Sales
/shop
SalesSvc
Shop DAO
Security
Inventory
/inventory
InventorySvc
Inventory DAO
Security
Admin
/admin
AdminSvc
Admin DAO
Security
The focus will be on communication
24
Shop
/shop
SalesSvc
Shop DAO
Security
Inventory
/inventory
InventorySvc
Inventory DAO
Security
Admin
/admin
AdminSvc
Admin DAO
Security
API First
25
Takes two to tango
26
REST
ATTR: Ginny Huo, "Pass the Message," Copyright 2016. http://www.ginnyhuo.com/pass-the-message/
Message Queues
Sync vs Async
27
So, are we just going to run one instance of each???
28
Shop
/shop
SalesSvc
Shop DAO
Security
Inventory
/inventory
InventorySvc
Inventory DAO
Security
Admin
/admin
AdminSvc
Admin DAO
Security
Docker
29
Containers
30
Shop
Inventory
Admin
/shop
/inventory
/admin
31
32
Enough talk, ….
Kung Fu Panda (2008) - http://www.imdb.com/title/tt0441773/