Programmer18 Years
Author• Ruby Cookbook• Programming for PaaS
Entrepreneur• AppFog PaaS• Mog Music Streaming Service
Current Role• Chief Innovation Officer at
CenturyLink
Who Am I?
Structure
1
Who Am I?2
What’s Nextfor Web AppArchitectures?
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
Web Architectures Are Changing
Fromheavy monolithic backend systems
Tolightweight distributed share-nothing systems
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
Web Architectures Are Changing
Fromhands-on IT-deployed and managed
Toautomated DevOps-deployed through
PaaS or continuous integration and continuous deployment
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.)
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
Session Management
• By default, many sessions are stores on disk
• This breaks share-nothing architecture
• Especially look out for WordPress/ Drupal/Joomla
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
• More logic happening in the browser than ever using the same mobile APIs
• AngularJS, Backbone, Ember
#6 Client Side Javascript
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
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
Docker is a shipping container system for code
Static website Web frontend User 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
Containers vs. VMs
App A
Bins/Libs
Guest OS
App A’
Bins/Libs
Guest OS
App B
Bins/Libs
Guest OS
Hypervisor (Type 2)
Host OS
Server
VM
Containers are isolated, but share OS and, where appropriate, bins/libraries
Ap
p
Ap
p
Ap
p
Ap
p
Ap
p
Ap
p
Ap
p
Bins/Libs Bins/Libs
Docker Engine
Host OS
Server
Co
nta
ine
r
What are the basics of the Dockersystem?
Build
Co
ntain
er A
Co
ntain
er A
Push
SearchPull
Run
Docker Engine
Host 1 OS (Linux)
Co
ntain
er C
Co
ntain
er B
Source Code Repository
DockerfileFor A
DockerContainerImage Registry
Docker Engine
Host 2 OS 2 (Linux)
Interactive Docker
$ docker run -i -t ubuntu bashroot@0bffc7cc54f7:/# ps
PID TTY TIME CMD1 ? 00:00:00 bash16 ? 00:00:00 ps
Daemonized Docker
$ docker run -d ubuntu nc -l -p 805b06834fe326
$ docker psCONTAINER ID IMAGE COMMAND 5b06834fe326 ubuntu:latest "nc -l -p 80"
CREATED STATUS PORTS 22 seconds ago Up 21 seconds
Open Ports Docker
$ docker run -d -p 80 ubuntu nc -l -p 80c7a533f7901b
$ docker psCONTAINER 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
Dockerfile
FROM UbuntuMAINTAINER Lucas Carlson <[email protected]>
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
Build Docker Images
$ docker build -t cardmagic/nginx .
Sending build context to Docker daemon 2.56 kBSending build context to Docker daemon Step 0 : FROM ubuntu---> 5506de2b643b
Step 1 : MAINTAINER Lucas Carlson <[email protected]>---> 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
Run your Container
$ docker run -d -p 80 cardmagic/nginxc7a533f7901b
$ docker psCONTAINER 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>
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
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
Top Related