SlideShare a Scribd company logo
Banco de dados em Containers
Fernando IkePGConf.Brasil 2018
Cache/Buffer
Cache
An auxiliary memory from which high-speed retrieval is possible.
https://en.oxforddictionaries.com/definition/cache
Buffer
A temporary memory area in which data is stored while it is being processed or
transferred, especially one used while streaming video or downloading audio.
https://en.oxforddictionaries.com/definition/buffer
https://momjian.us/main/writings/pgsql/hw_performance/
Containers and Databases
Database cache
Filesystem cache
Disk cache
Store data (disk)
What’s is Virtual Machine?
“...an efficient, isolated duplicate of a real computer machine...”
Gerald Popek and Robert Goldberg
VM
Infrastructure
Hypervisor
App A
Artifact
Bin/Libs
App B
Bin/Libs
App C
Bin/Libs
Guest OS Guest OS Guest OS
What’s container?
Container is a type of virtualization, more common call
“operating-system-level virtualization”
Container
Infrastructure
Hypervisor
Docker
App A
Artifact
Bin/Libs
App B
Bin/Libs
App C
Bin/Libs
Ephemera
Ephemera (singular: ephemeron) are any
transitory written or printed matter not meant to
be retained or preserved
Stateless application
Applications don’t need to store anything in a persistent disk. Data
application are storage in other part of architecture system
Stateful application
Application that need to store “locally” data and
need to recover that easy after an “interruption”
Cap Theorem
Union filesystem
It allows files and directories of separate file systems, known
as branches, to be transparently overlaid, forming a single
coherent file system.
Container layers
Main filesytem for internal container data
AUFS
Overlayfs
Overlayfs2
Device-Mapper
Bind/Mount
Databases operation
Plan what type of workload to use
Maintain, organize and “improve” dataset together application
Install security fix releases
Archive “old” data (sanitize)
Upgrade Database version
Tuning OS, Database and Application
What’s means in OS
handle...
sysctl
/proc
/sys
limits
overcommit
What’s means in the PostgreSQL
Shared Buffers
WAL
Max_connections
Effective_cache_size
Checkpoint_segments
Random_page_cost
Container Volumes
They are a mechanism for persisting data generated and/or
used by container
Why to use PostgreSQL within containers
Lower footprint to start
Easy to change postgresql.conf and use git to have history change (tracking)
Less surface attack in the “application
Can “restrict” Linux Capabilities within container
“Small” database by microservice
Use always a Container Storage
Tips
One database per type of workload
Take care to restrict network, consider restrict database access only own
application
Push database log to Monitoring system/service
Clusters and data replication are more complex
Database use intensive CPU and IO, think if there is another service with the same
workload type
Database is prepare to support two version of application (Deploy strategies without
downtime)
version: "3"
services:
db:
image: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgress
- POSTGRES_DB=postgres
ports:
- "5433:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- postgres
volumes:
pgdata:
networks:
postgres:
Demo
Demo code
https://gist.github.com/fike/158204255cfbc368f36fad66ccd999a7
● Bruce Momjian - Performance tuning
● Docker Volumes
● Kubernetes Volumes
● Oxford Dictionaries
● Formal requirements for virtualizable third generation architectures - Gerald J. Popek and Robert P. Goldberg
● CAP Theorem and Distributed Database Management Systems
References
// http://www.10deploys.com
// fernando.ike@gmail.com
// https://twitter.com/fernandoike
// http://www.fernandoike.com
// https://www.linkedin.com/in/fernandoike/
Contacts

More Related Content

PDF
Ceph at salesforce ceph day external presentation
PPTX
Container Native Storage
PDF
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
PPTX
Azure intoduksjon for it pro 02 data protection public
PPT
StorageArchitecturesForCloudVDI
PDF
Alluxio Keynote at Strata+Hadoop World Beijing 2016
PDF
Container Attached Storage (CAS) with OpenEBS - Berlin Kubernetes Meetup - Ma...
PPTX
Microsoft Azure Storage Basics
Ceph at salesforce ceph day external presentation
Container Native Storage
GlusterFS Presentation FOSSCOMM2013 HUA, Athens, GR
Azure intoduksjon for it pro 02 data protection public
StorageArchitecturesForCloudVDI
Alluxio Keynote at Strata+Hadoop World Beijing 2016
Container Attached Storage (CAS) with OpenEBS - Berlin Kubernetes Meetup - Ma...
Microsoft Azure Storage Basics

What's hot (20)

PDF
OpenNebula TechDay Boston 2015 - Future of Information Storage with ISS Super...
PPTX
SolidFire
PDF
Liquid: A Scalable Deduplication File System for Virtual Machine Images
PPTX
Replication and rebuild in cStor
PPTX
liquid a scalable deduplication file system for virtual machine images
PDF
Use Cases for Oacle Pluggable Databases in Development Environments
PPTX
State of the Container Ecosystem
PPTX
IMC Summit 2016 Breakout - Gordon Patrick - Developments in Persistent Memory
PPTX
IMC Summit 2016 Innovation - Girish Mutreja - Unveiling the X Platform
PPTX
OpenEBS hangout #4
PPTX
Primary Storage in CloudStack by Mike Tutkowski
PDF
Alluxio Use Cases at Strata+Hadoop World Beijing 2016
PPTX
WiredTiger Overview
PDF
MongoDB Evenings Boston - An Update on MongoDB's WiredTiger Storage Engine
PDF
A Technical Introduction to WiredTiger
PDF
Distributed storage system
PPTX
Survey of distributed storage system
PPTX
Hedvig & ClusterHQ - Persistent, portable storage for Docker
PPT
Caching fundamentals by Shrikant Vashishtha
PDF
OpenNebula TechDay Boston 2015 - Bringing Private Cloud Computing to HPC and ...
OpenNebula TechDay Boston 2015 - Future of Information Storage with ISS Super...
SolidFire
Liquid: A Scalable Deduplication File System for Virtual Machine Images
Replication and rebuild in cStor
liquid a scalable deduplication file system for virtual machine images
Use Cases for Oacle Pluggable Databases in Development Environments
State of the Container Ecosystem
IMC Summit 2016 Breakout - Gordon Patrick - Developments in Persistent Memory
IMC Summit 2016 Innovation - Girish Mutreja - Unveiling the X Platform
OpenEBS hangout #4
Primary Storage in CloudStack by Mike Tutkowski
Alluxio Use Cases at Strata+Hadoop World Beijing 2016
WiredTiger Overview
MongoDB Evenings Boston - An Update on MongoDB's WiredTiger Storage Engine
A Technical Introduction to WiredTiger
Distributed storage system
Survey of distributed storage system
Hedvig & ClusterHQ - Persistent, portable storage for Docker
Caching fundamentals by Shrikant Vashishtha
OpenNebula TechDay Boston 2015 - Bringing Private Cloud Computing to HPC and ...
Ad

Similar to Containers and Databases (20)

PDF
PostgreSQL High Availability in a Containerized World
PDF
EDB Postgres with Containers
 
PDF
Docker storage designing a platform for persistent data
PDF
PostgreSQL High Availability in a Containerized World
PPTX
DockerCon 18 docker storage
PDF
Docking postgres
PDF
System design handwritten notes guidance
PDF
System Design.pdf
PPTX
Big data and containers
PDF
Persistent storage with containers By Kaslin Fields
PDF
Strategies for Context Data Persistence
KEY
Grabbing the PostgreSQL Elephant by the Trunk
DOC
No sql exploration keyvaluestore
PDF
Let's Containerize New York with Docker!
PPTX
PostgreSQL and Linux Containers
PDF
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
PDF
a look at the postgresql engine
PPTX
What’s the Deal with Containers, Anyway?
PPTX
Running Highly Available Postgres Databases in Containers
 
PDF
Postgre sql linuxcontainers by Jignesh Shah
PostgreSQL High Availability in a Containerized World
EDB Postgres with Containers
 
Docker storage designing a platform for persistent data
PostgreSQL High Availability in a Containerized World
DockerCon 18 docker storage
Docking postgres
System design handwritten notes guidance
System Design.pdf
Big data and containers
Persistent storage with containers By Kaslin Fields
Strategies for Context Data Persistence
Grabbing the PostgreSQL Elephant by the Trunk
No sql exploration keyvaluestore
Let's Containerize New York with Docker!
PostgreSQL and Linux Containers
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
a look at the postgresql engine
What’s the Deal with Containers, Anyway?
Running Highly Available Postgres Databases in Containers
 
Postgre sql linuxcontainers by Jignesh Shah
Ad

More from Fernando Ike (20)

PDF
Arquitetura de Micro Serviços
PDF
(Quase) 10 anos de DevOps, e agora?
PDF
Infraestrutura Imutável - Agile Trends
PDF
Infraestrutura imutável - A base das aplicações na nuvem
PDF
DevOps Anti-Patterns - Campus Party
PDF
Blameless: A culpa não é sua
PDF
DevOps: A revolução ruidosa da TI
PDF
Docker Swarm Cluster
PDF
DevOps - Por onde começar
PDF
DevOps Anti-Patterns
PDF
A lista do PostgerSQL Brasil caiu?
PDF
Container revolucao
PDF
Akamai Cloud Security
PDF
Management 3.0 - a vida pós-agilidade
PDF
Docker na vida real
PDF
Devops
PDF
Docker e postgresql
PDF
Um milhao de usuários simultâneos
ODP
Banco caiu! E a gora?
PDF
Researching postgresql
Arquitetura de Micro Serviços
(Quase) 10 anos de DevOps, e agora?
Infraestrutura Imutável - Agile Trends
Infraestrutura imutável - A base das aplicações na nuvem
DevOps Anti-Patterns - Campus Party
Blameless: A culpa não é sua
DevOps: A revolução ruidosa da TI
Docker Swarm Cluster
DevOps - Por onde começar
DevOps Anti-Patterns
A lista do PostgerSQL Brasil caiu?
Container revolucao
Akamai Cloud Security
Management 3.0 - a vida pós-agilidade
Docker na vida real
Devops
Docker e postgresql
Um milhao de usuários simultâneos
Banco caiu! E a gora?
Researching postgresql

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation theory and applications.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
KodekX | Application Modernization Development
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Electronic commerce courselecture one. Pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation theory and applications.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
Spectral efficient network and resource selection model in 5G networks
KodekX | Application Modernization Development
Building Integrated photovoltaic BIPV_UPV.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Review of recent advances in non-invasive hemoglobin estimation
Dropbox Q2 2025 Financial Results & Investor Presentation
Advanced methodologies resolving dimensionality complications for autism neur...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

Containers and Databases