Beruflich Dokumente
Kultur Dokumente
Persistent Containers
Powering New Opportunities at Scale
Conclusion
Containers + Databases = Happy Developers
Ephemeral Containers + Databases = DevOps headaches
4 Things you must use to evaluate
Data Redundancy
Dynamic Self Discovery & Cluster formation
Self Healing (as containers enter and leave)
Application Tier discovery of Database Cluster
2
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Part One
"Here's another nice mess you have
got me into"
Laurel & Hardy circa 1929
3
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Real-time
Consumer Facing
Pricing /
Inventory / Billing
Real-time
Decisionin
g
Streaming
Data
Caching Layer
Complex
Maintainability
Durability
Operational Database
Enterprise Environment
Consistency
Scalability
Cost ($)
Data Lag
Legacy Database
(Mainframe)
RDBMS
Database
Transactional
Systems
4
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
2. Test
3. Stage / Production
Version
control
Developer
QA / QE
Sysadmin
DATABASE
OS FILE SYSTEM
MEMORY SYSTEM
PAGE CACHE
BLOCK INTERFACE
SSD
HDD
BLOCK INTERFACE
SSD
SSD
OPEN NVM
SSD
6
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Part Two
Containers
Process Isolation
Isolate the process from anything else running
9
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
10
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Build
Run
Ship
Pla3orm
Clustering
Runtime
Distribution
Plumbing
Trust
Open Standards
Container run-time spec
Image spec
11
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Dockerfile - Example
FROM python:2.7
ADD . /code
WORKDIR /code
RUN apt-get update
RUN apt-get -y install python-dev
RUN apt-get -y install libssl-dev
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
CMD python app.py
12
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
13
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Containers encapsulates
your code, dependencies
Containers are run
by Docker Engine
Swarm clusters
Docker Engines
Container
Compose orchestrates
Container deployment
Docker Engine
Machine provisions
Docker Engines
Docker Machine
Docker Compose
14
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
16
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
17
Fundamental IP
Self-managing nodes of a
distributed database cluster
Cluster-node load balancing in a
distributed system
Hybrid DRAM-SSD memory
system
Real-time transaction scheduling
X Point
17
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Master-Based Clustering
Architecturally
Correct
18
18
High Availability
High Consistency
Aerospikes HA reputation is
unmatched
Developer Experience
Rich & Simple
Schema free
Geospatial
List & Map server-side
manipulation
Secondary Indexes
19
Integration
Deployment
Frameworks
SpringData
Play
Docker integration
Connectors
JDBC
Spark / Hadoop
IPv6 - in progress
Orchestration (Mesos,
Kubernetes) in progress
Security with transport
encryption, certificate based
authentication (in progress)
19
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Rule 1-Passed
Rule 2-Passed
Rule 3-Failed
Rules
Rule 1
Rule 2
Rule 3
Account Behavior
Static Data
Account Statistics
Historical Data
22
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
50 nodes
23
300 nodes
Part Four
Databases and Docker
Requirements
Data Redundancy
Containers are Ephemeral Need more than one copy of the data
Self Healing
Loss of nodes must not be fatal to the cluster integrity
Addition of nodes must scale capacity
Self Healing
Automatic hashing of keys across the cluster & rebalancing
RIPEMD-160 collision free algorithm with Smart Partitions
Part Five
Demo
29
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
web
python / flask
Aerospike
Development
30
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Scale in Production
HA Proxy
web
web1
web2
web3
web4
webN
Aerospike
asd1
Development
asd2
asdN
Production
31
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
32
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Dockerfile
FROM python:2.7
ADD . /code
WORKDIR /code
RUN apt-get update
RUN apt-get -y install python-dev
RUN apt-get -y install libssl-dev
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
CMD python app.py
33
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
docker-compose.yml
web:
build: .
ports:
- "5000:5000"
links:
- aerospike
hostname: dev.awesome-counter.com
environment:
- AEROSPIKE_HOST=dev_aerospike_1
aerospike:
image: aerospike/aerospike-server:latest
volumes:
- $PWD:/etc/aerospike
34
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
web
web1
Aerospike
Aerospike
Development
Production
35
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
web
web1
Aerospike
Aerospike
Development
web2
web3
web4
webN
Production
36
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Docker Networking
37
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
38
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
aes_base_cluster.yml
discovery:
image: aerospike/interlock:latest
environment:
- "DOCKER_HOST"
volumes:
- "/var/lib/boot2docker:/etc/docker"
command: "... --plugin aerospike start"
aerospike:
image: aerospike/aerospike-server:latest
volumes:
- "$PWD:/etc/aerospike"
39
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
docker-compose.yml
haproxy:
extends:
file: haproxy.yml
service: haproxy-server
environment:
- "constraint:node==swarm-0"
net: bridge
web:
image: alvinr/demo-webapp-as:latest
extends:
file: haproxy.yml
service: haproxy-app
environment:
- AEROSPIKE_HOST=prod_aerospike_1
net: prod
aerospike:
extends:
file: aes_base_cluster.yml
service: aerospike
image: aerospike/aerospike-server:3.7.1
labels:
- "com.aerospike.cluster=awesomecounter"
environment:
- "affinity:com.aerospike.cluster!
=awesome-counter"
net: prod
40
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
web
web1
web2
web3
web4
webN
mongodb
asd1
Development
asd2
asdN
Production
41
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
42
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
43
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
cmd := exec.Command(asinfo,args...)
44
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Part Six
Considerations & Conclusion
45
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Host
daemon
daemon
container
container
/dev/xvdb
e.g.
SSD
/data/db
e.g.
EBS
/mnt/xx:/data/db
Inside
Encapsulation of Concerns
Outside
Separation of Concerns
Storage Features (e.g.
Snapshots)
46
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Host
daemon
container
container
Data Container
--volumes-from <container name>
Managed like other containers
Special rules for Destruction
TBD: Performance
47
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Summary
One solution from Dev -> Production
Define Container, their contents and how they work together once
Deploy the same images in Dev, Pre-Prod and Production across
Platforms
Running Docker & Database in Production
Ops define the whitelisted images, security policies etc.
Dev use approved images to build upon
Eliminate the complexity (and cost) of deployment
Scale up & down in a Flexible and Simple way
48
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.
Docker Images
http://hub.docker.com/r/aerospike/
Contact me!
alvin@aerospike.com
@jonnyeight
49
Proprietary & Confidential | 2015 Aerospike Inc. All rights reserved.