In June 2017 at the Devops Enterprise Summit in London, while announcing the 2017 State of Devops Report with his esteemed colleagues, Jez Humble reveled that their studies showed that there was a strong correlation between high-functioning teams and the architecture of the software they are building, deploying and managing. In short - architecture matters to Devops.
In this talk Cornelia goes over a host of software architectural patterns and their relationship to some of the key goals of Devops - "higher throughput and higher quality and stability." Cloud native applications and cloud native data are both covered.
7. @cdavisafc
TEXT
Major Outage on 20 September 2015
Airbnb, Nest, IMDB and many more experienced downtime
… Including Netflix
Outage lasted 5+ hours
“brief availability blip”
experienced a
8. @cdavisafc
CLOUD-NATIVE SERVICE
LET’S TALK ABOUT AUTONOMY
A major benefit of cloud-native architectures is independent:
▸ Application Scaling
▸ Team Scaling
▸ Development Cycles
▸ Experimentation
▸ Resilience
9. @cdavisafc
CLOUD-NATIVE ARCHITECTURES
▸ Cloud-native Apps
▸ Scale out
▸ Statelessness
▸ Externalize configuration
▸ Implications from changes in the application
lifecycle
▸ Versioned services
▸ Service Discovery
▸ Distributed tracing
▸ Retries
▸ Cloud-native Data
▸ Breaking the Data monolith
▸ Data APIs
▸ Caching
▸ Polyglot Persistence
▸ Event sourcing
18. @cdavisafc
CLOUD-NATIVE APP
STATELESSNESS
▸ Do NOT use sticky sessions!
▸ Eventually (and sooner than you
think!) the instance you are sticky to
will disappear
▸ Do make your instances
completely stateless
ROUTER
APP
(INSTANCE 1)
ValidTokens:
[UserToken]
/login
token=UserToken
token=UserToken
APP
(INSTANCE 2)
Unauthorized ValidTokens: []
token=UserToken
19. @cdavisafc
CLOUD-NATIVE APP
STATELESSNESS
▸ Do NOT use sticky sessions!
▸ Eventually (and sooner than you
think!) the instance you are sticky to
will disappear
▸ Do make your instances
completely stateless
▸ Externalize state
ROUTER
APP
(INSTANCE 1)
ValidTokens:
[UserToken]
token=UserToken
token=UserToken
APP
(INSTANCE 2)
token=UserToken
STATE
STORE
20. @cdavisafc
CLOUD-NATIVE APP
APP CONFIGURATION
▸ Property Files are the abstraction
used to externalize configuration
▸ They do not hold actual values!
▸ Values coming from the environment
are supplied via environment
variables
▸ Other configuration is controlled just
like source code and injected
RUNTIME CONTEXT
WHERE CONFIGURATION PARAMETERS ARE DEFINED IN ENVIRONMENT VARIABLES
PROPERTY FILE(S)
DEFINE THE CONFIGURATION
PARAMETERS AND DEFAULT VALUES
hostIp=
${CF_INSTANCE_IP}
specialization=
${SPECIALIZATION:
Science}
APP
CODE THAT REFERENCES THE CONFIGURATION PARAMETERS
DEFINED IN THE PROPERTY FILE
public class HelloController {
@Value("${hostIp}")
private String hostIp;
@Value("${specialization}")
private String specialization;
...
}
SYSTEM PROPERTIES
PROVIDED BY THE RUNTIME ENVIRONMENT, VIA
ENVIRONMENT VARIABLES
CF_INSTANCE_IP=10.10.148.29
21. @cdavisafc
CLOUD-NATIVE APP
APP CONFIGURATION
▸ Other configuration is controlled just
like source code and injected
RUNTIME CONTEXT
WHERE CONFIGURATION PARAMETERS ARE DEFINED IN ENVIRONMENT VARIABLES
PROPERTY FILE(S)
DEFINE THE CONFIGURATION
PARAMETERS AND DEFAULT VALUES
hostIp=
${CF_INSTANCE_IP}
specialization=
${SPECIALIZATION:
Science}
APP
CODE THAT REFERENCES THE CONFIGURATION PARAMETERS
DEFINED IN THE PROPERTY FILE
public class HelloController {
@Value("${hostIp}")
private String hostIp;
@Value("${specialization}")
private String specialization;
...
}
SYSTEM PROPERTIES
PROVIDED BY THE RUNTIME ENVIRONMENT, VIA
ENVIRONMENT VARIABLES
CF_INSTANCE_IP=10.10.148.29
APP PROPERTIES
STORED AND VERSIONED IN A
REPOSITORY SUCH AS GIT
specialization
=Sports
CONFIG SERVER
ROLE IS TO INJECT MANAGED APP
PROPERTIES INTO THE APP
23. @cdavisafc
CLOUD-NATIVE APP
APPLICATION LIFECYCLE
▸ Application lifecycle events have
rippling effects through the collective
▸ The application must broadcast
lifecycle change events
▸ (Note: I strongly recommend you
use a framework to help you with
this!)
▸ And an app must be able to absorb
that configuration at the right time
(run time?)
INVOICE APP
ordersvcIP
=10.24.1.35
ORDER SERVICE APP
Some “magic” happens
10.24.63.116
Here I am!
IP Address: 10.24.63.116
Version: 3.4.239
…
I’ll adapt to these changes!
Orders Service new IP:
10.24.63.116
24. @cdavisafc
CLOUD-NATIVE SERVICE
VERSIONED SERVICES
▸ Use Semantic Versioning
▸ major.minor.patch
▸ Use Blue/Green deploys
▸ Deployments needn’t be replacements
▸ Powerful lever in making
deployments a non-event
SERVICE
APP
SERVICE
APP
APP
SERVICE
APP
APP
… AND PARALLEL DEPLOYS
25. @cdavisafc
CLOUD-NATIVE SERVICE
VERSIONED SERVICES
▸ Use Semantic Versioning
▸ major.minor.patch
▸ Use Blue/Green deploys
▸ Deployments needn’t be replacements
▸ Powerful lever in making
deployments a non-event
SERVICE
APP
SERVICE
APP
APP
SERVICE
APP
APP
… AND PARALLEL DEPLOYS
SERVICE
APP
1.0.0 2.0.0
26. @cdavisafc
CLOUD-NATIVE SERVICE
SERVICE DISCOVERY
▸ Let’s dig into the “magic”
(it’s not really magic)
INVOICE APP
orderSvcCoords...
ORDER SERVICE APP
10.24.63.116
Here I am!
IP Address: 10.24.63.116
Version: 3.4.239
…
I’ll adapt to these changes!
Orders Service new IP:
10.24.63.116
Some “magic” happens
27. @cdavisafc
CLOUD-NATIVE SERVICE
SERVICE DISCOVERY
▸ Dynamic Router maintains routing
table
▸ Messaging pattern to decouple
service from router
▸ Must handle lost broadcast
messages
▸ Request pass through router INVOICE APP
orderSvcCoords
=orderSvc.example.com
ORDER SERVICE APP
10.24.63.116
Here I am!
IP Address: 10.24.63.116
Version: 3.4.239
…
ROUTER
OrderService: 10.24.63.116, …
CustomerService: 10.24.3.1, …
28. @cdavisafc
CLOUD-NATIVE SERVICE
SERVICE DISCOVERY
▸ Dynamic Router maintains routing
table
▸ Messaging pattern to decouple
service from router
▸ Must handle lost broadcast
messages
▸ Request pass through router INVOICE APP
orderSvcCoords
=10.24.1.13
ORDER SERVICE APP
10.24.63.116
Here I am!
IP Address: 10.24.63.116
Version: 3.4.239
…
SERVICE DISCOVERY SERVER
OrderService: 10.24.63.116, …
CustomerService: 10.24.3.1, …
ORDER SERVICE APP
10.24.1.13
I’ll adapt to these changes!
Orders Service new IP:
10.24.63.116
29. @cdavisafc
CLOUD-NATIVE SERVICE
SERVICE DISCOVERY
▸ Dynamic Router maintains routing
table
▸ Messaging pattern to decouple
service from router
▸ Must handle lost broadcast
messages
▸ Request pass through router INVOICE APP
orderSvcCoords
=10.24.63.116
ORDER SERVICE APP
10.24.63.116
Here I am!
IP Address: 10.24.63.116
Version: 3.4.239
…
SERVICE DISCOVERY SERVER
OrderService: 10.24.63.116, …
CustomerService: 10.24.3.1, …
ORDER SERVICE APP
10.24.1.13
I’ll adapt to these changes!
Orders Service new IP:
10.24.63.116
34. @cdavisafc
CLOUD-NATIVE SERVICE
RETRIES
▸ #1 Fallacy of Distributed Computing:
The Network is Reliable
It's not.
https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing
35. @cdavisafc
CLOUD-NATIVE SERVICE
RETRIES
CLIENT
SERVICE
▸ Client must consider failure
▸ Decide on fall-back behavior
▸ Likely including retries
▸ But then we need to handle
downstream consequences of these
(retry) behaviors
Timeouts?
If we don’t hear back,
try again
39. @cdavisafc
CLOUD-NATIVE SERVICE
DISTRIBUTED TRACING
▸ App must look for and leave tracers
▸ Use a framework to help you do
this!!!
▸ Tools can then read and correlate logs
SERVICE
APP
SERVICE
APP
APP
SERVICE
APP
SERVICE
APP
SERVICE
APP
44. @cdavisafc
CLOUD-NATIVE DATA
DATA APIS (SERVICES)
▸ Microservices do not access data layer directly
▸ Except for those that implement the data API
▸ A surface area to:
▸ Implement access control
▸ Implement throttling
▸ Perform logging
▸ Other policies…
56. @cdavisafc
CLOUD-NATIVE DATA
INDEPENDENT DATABASES - SHARED ENTITIES
▸ We’ve started to break up the data monolith
▸ BUT our data integration “strategy” is rather
brittle and bespoke
▸ How are changes to data in one bounded
context reflected in the other?
Sales
Support
?