This document discusses emerging trends in web application architectures and how Docker and microservices are shaping the future. It begins with an introduction to the author and then covers:
1) How architectures are shifting from monolithic backends to distributed, share-nothing systems.
2) The benefits of microservices architectures that use REST APIs and other techniques like asset hosting, session management, and asynchronous processing.
3) How Docker and containers allow applications to be packaged and distributed more easily while maintaining consistency across environments.
The document concludes that automation, containers, and microservices are dominating future web application architectures.
The Future of Web Application Architectures: Microservices, Containers, and Cloud Trends
1. The Future of Web
Application
Architectures
by
Lucas Carlson
2. Programmer
18 Years
Author
• Ruby Cookbook
• Programming for PaaS
Entrepreneur
• AppFog PaaS
• Mog Music Streaming Service
Current Role
• Chief Innovation Officer at
CenturyLink
Who Am I?
3. Structure
1
Who Am I?
2
What’s Next
for Web App
Architectures?
3
How to Future-Proof
Your Applications
with Micro-Services
4
The 6 Insider Tech
Trends in Cloud
Computing
5
Getting the Most
From Docker and
Linux Containers
6
Conclusions
6. Web Architectures Are Changing
From
heavy
monolithic
backend
systems
To
lightweight
distributed
share-nothing
systems
7. What’s Share-Nothing?
No persistent state is ever stored on
application instances (database,
uploaded files, sessions, etc.)
Easy to scale because you can add more
to a load balancer without worrying
about discrepancies
8.
9. Web Architectures Are Changing
From
hands-on IT-deployed and
managed
To
automated DevOps-deployed through
PaaS or continuous integration and
continuous deployment
12. 4 Things to Think About
JSON REST APIs
Asset hosting
Session
management
Async Processing
13. JSON REST APIs
Micro-Services are small
lightweight services
Communicate with databases to produce
JSON through REST APIs
Minimalist application logic by encapsulating one
thing well (authentication service, blog post
service, credit card service, etc.)
14. Asset Hosting
Use Object Storage and
CDN to eliminate
dependencies on disk
Allows you to scale
horizontally
This is the foundation of
share-nothing
architecture
15. Session Management
• By default, many sessions are stores on disk
• This breaks share-nothing architecture
• Especially look out for WordPress/
Drupal/Joomla
16. Async Processing
Evaluate if you want a
simple queue or to
consider orchestration
which has first-class
queue in it
Keeping micro-services lightweight means
running complicated logic asynchronously
26. Cargo Transport Pre-1960
Multiplicity of Goods
Multiplicity of methods for transporting
Do I worry about how goods interact
Can I transport quickly and smoothly
27. Multiplicity of Goods
Multiplicity of methods
for transporting
Do I worry about how
goods interact
Can I transport quickly
and smoothly
Solution: Intermodal Shipping
Container
28. Docker is a shipping container
system for code
Static website Web frontendUser DB Queue Analytics DB
Multiplicity of Stacks
Multiplicity of
hardware
environments
Do services and apps
interact appropriately?
Can I migrate smoothly
and quickly
Development VM QA server Public Cloud Contributor’s laptopProduction ClusterCustomer Data Center
29. Containers vs. VMs
App A
Bins/Li
bs
Guest
OS
App A’
Bins/Li
bs
Guest
OS
App B
Bins/Li
bs
Guest
OS
Hypervisor (Type 2)
Host OS
Server
VM
Containers are isolated, but share OS
and, where appropriate, bins/libraries
App
App
App
App
App
App
App
Bins/Libs Bins/Libs
Docker Engine
Host OS
Server
Container
30. What are the basics of the Docker
system?
Build
ContainerA
ContainerA
Push
Search
Pull
Run
Docker Engine
Host 1 OS (Linux)
ContainerC
ContainerB
Source Code
Repository
Dockerfile
For A
Docker
Container
Image
Registry
Docker Engine
Host 2 OS 2 (Linux)
35. Daemonized Docker
$ docker run -d ubuntu nc -l -p 80
5b06834fe326
$ docker ps
CONTAINER ID IMAGE COMMAND
5b06834fe326 ubuntu:latest "nc -l -p 80"
CREATED STATUS PORTS
22 seconds ago Up 21 seconds
36. Open Ports Docker
$ docker run -d -p 80 ubuntu nc -l -p 80
c7a533f7901b
$ docker ps
CONTAINER ID IMAGE COMMAND
c7a533f7901b ubuntu:latest "nc -l -p 80"
CREATED STATUS PORTS
2 seconds ago Up 1 seconds 0.0.0.0:49153->80/tcp
37. Dockerfile
FROM Ubuntu
MAINTAINER Lucas Carlson <lucas@carlson.net>
RUN apt-get update && apt-get install -y nginx
RUN echo "daemon off;" >> /etc/nginx/nginx.conf
ADD . /usr/share/nginx/html
EXPOSE 80
CMD /usr/sbin/nginx -c /etc/nginx/nginx.conf
38. Build Docker Images
$ docker build -t cardmagic/nginx .
Sending build context to Docker daemon
2.56 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu
---> 5506de2b643b
Step 1 : MAINTAINER Lucas Carlson
<lucas@carlson.net>
---> Using cache
---> 6d173bfde6c5
Step 2 : RUN apt-get update && apt-get
install -y nginx
---> Using cache
---> 8a9eb983d6f9
Step 3 : ADD . /usr/share/nginx/html
---> Using cache
---> 4b2ebb367b5f
Step 4 : EXPOSE 80
---> Using cache
---> ce5d15c82edf
Step 5 : CMD /usr/bin/nginx
---> Using cache
---> 3b7a04a72de7
Successfully built 3b7a04a72de7
39. Run your Container
$ docker run -d -p 80 cardmagic/nginx
c7a533f7901b
$ docker ps
CONTAINER ID IMAGE COMMAND
f2cd2860cf84 cardmagic/nginx:latest “/usr/sbin/nginx"
CREATED STATUS PORTS
3 seconds ago Up 2 seconds 0.0.0.0:49158->80/tcp
$ curl http://$(boot2docker ip):49158/
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
41. Docker’s Do and Don’ts
Do
Containerize your application
code
Use containers to create
consistency
Don’ts
Run databases inside containers
yet
Run multi-tenant containers
43. Conclusion
Automation is dominating the future landscape of
web app architectures
1
Docker and Linux Containers are the new way to
package and distribute your applications
3
Micro-services are the future:
• Lightweight distributed
• Share-nothing systems built with APIs
2