EDB Postgres with Containers
-
Upload
enterprisedb -
Category
Software
-
view
1.454 -
download
0
Transcript of EDB Postgres with Containers
© 2014 EDB All rights reserved. 1
EDB Postgres with Containers
© 2016 EnterpriseDB Corporation. All rights reserved. 2
• Who Is EnterpriseDB? • What Are Containers? • How Can I Get Started?
• How Are Stateful Applications Managed? • Can I Run This With My Current Architecture?
What we will learn
© 2016 EnterpriseDB Corporation. All rights reserved. 3
About EnterpriseDB
© 2016 EnterpriseDB Corporation. All rights reserved. 4
EDB is a Recognized Leader Magic Quadrant for Operational DBMS, Q4 ‘15
• Gartner Comments − “EnterpriseDB is responsible for
many features of PostgreSQL, contributing to JSON, materialized views and partitioning. Increasing numbers of users of Gartner’s inquiry services recognize the EnterpriseDB brand.”
− “Clients report that the functionality
of EnterpriseDB's Postgres Plus Oracle compatibility feature is more than sufficient to run both mission-critical and non-mission critical applications.”
− “Reference customers rated
EnterpriseDB highly for the stability of its DBMS, and were satisfied with its HAS/DR features.”
© 2016 EnterpriseDB Corporation. All rights reserved. 5
POSTGRES innovation
ENTERPRISE reliability
24/7 support
Services & training
Enterprise-class features & tools
Indemnification
Product road-map
Control
Thousands of developers
Fast development
cycles
Low cost
No vendor lock-in
Advanced features
Enabling commercial adoption of Postgres
© 2016 EnterpriseDB Corporation. All rights reserved. 6
EDB Customers EDB currently has over 3,000 total customers including 63 of the Fortune 500 and 137 of the Forbes Global 2000
© 2016 EnterpriseDB Corporation. All rights reserved. 7
Containers Have Changed Everything
© 2016 EnterpriseDB Corporation. All rights reserved. 8
Containers are kind of old news Linux Containers (LXC) and CGroups and namespaces are extensions of concepts that started with Solaris and BSD Jails
But projects like Docker and RKT are very new, and very ac(ve. ● This last week, Docker received 107 commits from 51 authors on github
● More than 22,000 commits since iniPal in 2013
● 2/3 of Companies That Try Docker Adopt It (according to datadog)
https://www.datadoghq.com/docker-adoption/
Where did they come from?
© 2016 EnterpriseDB Corporation. All rights reserved. 9
Developers and administrators conPnue to face well known problems:
How to package applicaPon code across environments
How to get the best performance from available physical resources
Why the sudden popularity?
© 2016 EnterpriseDB Corporation. All rights reserved. 10
Packaging ApplicaPons
Have you ever moved a simple code fix into ProducPon only to have problems with a library mismatch? Which leads to an easy-‐enough looking upgrade? Which suddenly cascades to updaPng mulPple packages, tracing dependencies, and hours of mess?
. . . Well me neither :-)
© 2016 EnterpriseDB Corporation. All rights reserved. 11
Packaging ApplicaPons
Containers provides a versioned run-‐Pme environment. A container is just a tar file, or a series of tar files. It holds: ● An OperaPng System ● Libraries ● All dependencies
Each step builds a new layer, making the finished container image instantly runnable.
© 2016 EnterpriseDB Corporation. All rights reserved. 12
• Be_er performance than VMs • Higher uPlizaPon than bare metal • Faster IOPs path
RunPme Architecture
Server
Host OS
Bins / Libs Bins / Libs
Docker
App A
App A
’
App A
’’
App B
App B
App B
© 2016 EnterpriseDB Corporation. All rights reserved. 13
A container wraps one single process: • A web server (nginx, ligh_pd) • An applicaPon server (Python, Java, C) • A middleware component (RabbitMQ, memcached) • A stateful service (PostgreSQL, Redis) • A one-‐off job (backup script, archiving, ETL)
What’s in the container?
© 2016 EnterpriseDB Corporation. All rights reserved. 14
Containers Change Architecture
© 2016 EnterpriseDB Corporation. All rights reserved. 15 © 2013 EDB All rights reserved 8.1. 15
Getting Started
© 2016 EnterpriseDB Corporation. All rights reserved. 16
Containers are NOT Virtual Machines They’re just tar files That you can run
Keep one thing in mind
© 2016 EnterpriseDB Corporation. All rights reserved. 17
EDB Postgres image Official PostgreSQL Docker image (DockerHub) Build your own
Pulling images
© 2016 EnterpriseDB Corporation. All rights reserved. 18
Containers are cheap to create, easy to dispose Containers wrap a single process Containers usually do not alter state That is to say, most containers don’t write data Wait. What about logs?
• manage them with a purpose-driven container • send them to stdout
The container mindset
© 2016 EnterpriseDB Corporation. All rights reserved. 19 © 2013 EDB All rights reserved 8.1. 19
Stateful Applications
© 2016 EnterpriseDB Corporation. All rights reserved. 20
The file system of a typical docker container is not permanent
But criPcal data can easily be made permanent by using Volumes
These map the host’s storage directly into the container
What happens to the data?
# docker run -v /my/local/volume:/container/pgdata \ --name vol_ppas ppas:9.5
© 2016 EnterpriseDB Corporation. All rights reserved. 21
Other containers can share the same volume, or mount the volume on start.
What happens to the data?
# docker run --name my_ppas \ --volumes-from vol_ppas \ -p 5432:5432 ppas:9.5 start
# docker run --name ppas_log_mgr \
--volumes-from vol_ppas \ --volumes-from log_dest \ ppas:9.5 log_maint
© 2016 EnterpriseDB Corporation. All rights reserved. 22
I can haz container demo?
© 2016 EnterpriseDB Corporation. All rights reserved. 23 © 2013 EDB All rights reserved 8.1. 23
Putting Containers Into Production
© 2016 EnterpriseDB Corporation. All rights reserved. 24
Bringing in new technology
Containers will run the same way everywhere Containers can discover exisPng infrastructure
© 2016 EnterpriseDB Corporation. All rights reserved. 25
Bringing in new technology
Begin leveraging containers in small ways. . .
Replace a single process (sogware build) Replace a single server (load balancer) Install a portable toolset (check out nsenter!) Replace a long command (generate cerPficates)
© 2016 EnterpriseDB Corporation. All rights reserved. 26 © 2013 EDB All rights reserved 8.1. 26
Closing Thoughts
© 2016 EnterpriseDB Corporation. All rights reserved. 27
Infrastructure needs to scale beyond managing VM’s Breaking apart applications into microservices helps View infrastructure as code Containers are just tar files Try them in a few small places and work your way up
A few general observaPons. . .
© 2016 EnterpriseDB Corporation. All rights reserved. 28
Performance Tuning ConsulPng Training & CerPficaPon Remote DBA Services
How can we help?
h_ps://enterprisedb.com/ahc
● Send email to [email protected] ● h_ps://www.enterprisedb.com/general-‐inquiry-‐form ● h_ps://www.enterprisedb.com/resources-‐community