SlideShare a Scribd company logo
High Concurrency with Postgres
Bank of Brazil in real life
F´abio Telles Rodriguez
Timbira - The Brasilian Postgres Company
February 4, 2016
PGConf Russia
About me
F´abio Telles Rodrigues
Open software evangelist +15 years
PostgreSQL DBA +10 year
Contributor of the brazilian PostgreSQL community
Blog: http://savepoint.blog.br (Portuguese only)
@telles
Timbira
http://www.timbira.com.br
The Brasilian Postgres Company
Consulting / Development / Support
Partnership with software development companies
In-Company and On-Line training
About these talk
Outline
About Bank of Brasil
Multi Document Processing
Challenges
Adopted solutions
Bank of Brasil
Founded at 1808, oldest bank in Brazil
59% of shares belong to the government
The only bank that has branches in all Brazilian cities
more then 110.000 direct employees
Multi Document Processing app
Developed by Bull (now Atos)
Development started as a client/server application 15 years
ago
Mostly written in C++
Perform a decentralized dematerialization of documents
combined with a complex central processing of then
Each document have differentdiferent workflows
Multi Document Processing app
Documents are captured using scanners at branches
Local image recognition (reach about 85% of success)
Shipping images and meta data to a central point (images are
not stored inside database)
Central image recognition using third-party tools like ABBYY
and A2iA.
Manual image recognition
Other manual interactions like authorizations and deviations
Thousands of business rules for each document
Complex interaction with many legacy systems
Real life
6,364 branches
22,432 stations using application (will double by the end of
the year)
25 servers making central recognition
12 application servers
200 stations making manual recognition
Hundreds of leaders requesting reports on peak processing
One PostgreSQL database
The database
PostgreSQL 9.3
228 tables
23 triggers
17 sequences
402 functions
In a regular day
check clearing: 600,000 (2 milion in the busiest day)
escrow checks: 70,000
signature cards: 30,000
non financial documents: 50,000
Critical window between 4pm to 7pm
Growth of 10GB
80GB of archives generated
Challenges
High number of connections
Locks in processing queues
High number of transactions
Small processing window
Many heavy queries for reports
Need to keep the information for two years in the database
New features being implemented constantly
Adopted solutions
3 PgBouncer instances
Mencached + Listen / Notify to spread information across the
stations
Strict control of transactions
The queue for image recognition was implemented in memory
and integrated inside database with PL/Peru using sockets
Use of advisory locks in other queues
Memory adjustments for specifc users
Vaccum and fillfactor adjustments for speciic tables
Partition on 24 tables
Use of temporary tables and unlogged tables
Redesign critical process
Questions
Spasibo
Thank you
Obrigado
F´abio Telles Rodriguez
(telles@timbira.com.br)
http://www.timbira.com.br
Ad

Recommended

PPTX
The NoSQL movement @ DotNetToscana
Matteo Baglini
 
ODP
18.xml
Abhijeet Kadam
 
PPTX
Connected and continuous localization systems for content management systems
Tolga Secilmis
 
PPT
Tw Bizcases
Praveen Kumar Peddi
 
PDF
Construindo uma Intranet Corporativa utilizando Plone
menttes
 
PDF
MicroStrategy at Badoo
Francesco Mucio
 
PDF
Redis Day TLV 2018 - Redis & BioCatch
Redis Labs
 
PDF
Presto @ Treasure Data - Presto Meetup Boston 2015
Taro L. Saito
 
PDF
Innovate2014 ea 1833
Paulo Lacerda
 
PPT
Billions of Rows, Millions of Insights, Right Now
Rob Winters
 
PDF
What every managemenet accountants should know about the cloud by l iv watson
Workiva
 
PDF
Building Chatbots
Anurag Saran
 
PPT
Realtime search
罗磊 罗磊
 
PPTX
Big data architecture
Dr. Jasmine Beulah Gnanadurai
 
PDF
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
Shirshanka Das
 
PDF
[WSO2Con EU 2018] The Rise of Streaming SQL
WSO2
 
PDF
Processing 19 billion messages in real time and NOT dying in the process
Jampp
 
PDF
In a typical organization, databases and communications technology a.pdf
libowskymcinnisell69
 
PPT
Database Development
hickam
 
PDF
E commerce data migration in moving systems across data centres
Regunath B
 
DOCX
Blood bank report new
Armaan Pandita
 
PPTX
Batch Processing vs Stream Processing Difference
jeetendra mandal
 
DOC
Venugopal - BO Resume
Venugopal Duggirala
 
ODP
OpenSource for Enterprise Business Presentation 010
Passapong Thaithatgoon
 
PPTX
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Brian Brazil
 
PDF
How to build and run a big data platform in the 21st century
Ali Dasdan
 
PDF
OpenMetadata Spotlight - OpenMetadata @ Loggi by Erica Bertan
OpenMetadata
 
PDF
7_considerations_final
Jane Roberts
 
PDF
Data Hero: Sua carreira na área de dados
Fabio Telles Rodriguez
 
PPTX
Postgres level up
Fabio Telles Rodriguez
 

More Related Content

Similar to High concurrency with Postgres (20)

PDF
Innovate2014 ea 1833
Paulo Lacerda
 
PPT
Billions of Rows, Millions of Insights, Right Now
Rob Winters
 
PDF
What every managemenet accountants should know about the cloud by l iv watson
Workiva
 
PDF
Building Chatbots
Anurag Saran
 
PPT
Realtime search
罗磊 罗磊
 
PPTX
Big data architecture
Dr. Jasmine Beulah Gnanadurai
 
PDF
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
Shirshanka Das
 
PDF
[WSO2Con EU 2018] The Rise of Streaming SQL
WSO2
 
PDF
Processing 19 billion messages in real time and NOT dying in the process
Jampp
 
PDF
In a typical organization, databases and communications technology a.pdf
libowskymcinnisell69
 
PPT
Database Development
hickam
 
PDF
E commerce data migration in moving systems across data centres
Regunath B
 
DOCX
Blood bank report new
Armaan Pandita
 
PPTX
Batch Processing vs Stream Processing Difference
jeetendra mandal
 
DOC
Venugopal - BO Resume
Venugopal Duggirala
 
ODP
OpenSource for Enterprise Business Presentation 010
Passapong Thaithatgoon
 
PPTX
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Brian Brazil
 
PDF
How to build and run a big data platform in the 21st century
Ali Dasdan
 
PDF
OpenMetadata Spotlight - OpenMetadata @ Loggi by Erica Bertan
OpenMetadata
 
PDF
7_considerations_final
Jane Roberts
 
Innovate2014 ea 1833
Paulo Lacerda
 
Billions of Rows, Millions of Insights, Right Now
Rob Winters
 
What every managemenet accountants should know about the cloud by l iv watson
Workiva
 
Building Chatbots
Anurag Saran
 
Realtime search
罗磊 罗磊
 
Big data architecture
Dr. Jasmine Beulah Gnanadurai
 
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
Shirshanka Das
 
[WSO2Con EU 2018] The Rise of Streaming SQL
WSO2
 
Processing 19 billion messages in real time and NOT dying in the process
Jampp
 
In a typical organization, databases and communications technology a.pdf
libowskymcinnisell69
 
Database Development
hickam
 
E commerce data migration in moving systems across data centres
Regunath B
 
Blood bank report new
Armaan Pandita
 
Batch Processing vs Stream Processing Difference
jeetendra mandal
 
Venugopal - BO Resume
Venugopal Duggirala
 
OpenSource for Enterprise Business Presentation 010
Passapong Thaithatgoon
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Brian Brazil
 
How to build and run a big data platform in the 21st century
Ali Dasdan
 
OpenMetadata Spotlight - OpenMetadata @ Loggi by Erica Bertan
OpenMetadata
 
7_considerations_final
Jane Roberts
 

More from Fabio Telles Rodriguez (20)

PDF
Data Hero: Sua carreira na área de dados
Fabio Telles Rodriguez
 
PPTX
Postgres level up
Fabio Telles Rodriguez
 
PDF
Explain this!
Fabio Telles Rodriguez
 
PDF
Aplicações 10x a 100x mais rápida com o postgre sql
Fabio Telles Rodriguez
 
PDF
Novidades do PostgreSQL 10
Fabio Telles Rodriguez
 
PDF
Migre seu banco de dados para a nuvem. Pergunte-me como!
Fabio Telles Rodriguez
 
PDF
Trabalhando com Logs no PostgreSQL
Fabio Telles Rodriguez
 
PDF
PostgreSQL Rock Star
Fabio Telles Rodriguez
 
PDF
Oracle x PostgreSQL
Fabio Telles Rodriguez
 
PDF
PostgreSQL Wonderland TDC-SP 2015
Fabio Telles Rodriguez
 
PDF
Trabalhando com Logs no PostgreSQL
Fabio Telles Rodriguez
 
PDF
Postgres Big data
Fabio Telles Rodriguez
 
PDF
Postgres Chainsaw Massacre
Fabio Telles Rodriguez
 
PDF
Postgres Tuning
Fabio Telles Rodriguez
 
PDF
Postgres Wonderland - PGDay CE2013
Fabio Telles Rodriguez
 
PDF
Postgres Wonderland - Campus Party 2013
Fabio Telles Rodriguez
 
PDF
Alta Concorrência com Postgres
Fabio Telles Rodriguez
 
PDF
Alta Concorrência com Postgres
Fabio Telles Rodriguez
 
PDF
Postgres, a "Metamorfose Ambulante"
Fabio Telles Rodriguez
 
ODP
Postgres Wonderland - PGDay Cascavél 2013
Fabio Telles Rodriguez
 
Data Hero: Sua carreira na área de dados
Fabio Telles Rodriguez
 
Postgres level up
Fabio Telles Rodriguez
 
Explain this!
Fabio Telles Rodriguez
 
Aplicações 10x a 100x mais rápida com o postgre sql
Fabio Telles Rodriguez
 
Novidades do PostgreSQL 10
Fabio Telles Rodriguez
 
Migre seu banco de dados para a nuvem. Pergunte-me como!
Fabio Telles Rodriguez
 
Trabalhando com Logs no PostgreSQL
Fabio Telles Rodriguez
 
PostgreSQL Rock Star
Fabio Telles Rodriguez
 
Oracle x PostgreSQL
Fabio Telles Rodriguez
 
PostgreSQL Wonderland TDC-SP 2015
Fabio Telles Rodriguez
 
Trabalhando com Logs no PostgreSQL
Fabio Telles Rodriguez
 
Postgres Big data
Fabio Telles Rodriguez
 
Postgres Chainsaw Massacre
Fabio Telles Rodriguez
 
Postgres Tuning
Fabio Telles Rodriguez
 
Postgres Wonderland - PGDay CE2013
Fabio Telles Rodriguez
 
Postgres Wonderland - Campus Party 2013
Fabio Telles Rodriguez
 
Alta Concorrência com Postgres
Fabio Telles Rodriguez
 
Alta Concorrência com Postgres
Fabio Telles Rodriguez
 
Postgres, a "Metamorfose Ambulante"
Fabio Telles Rodriguez
 
Postgres Wonderland - PGDay Cascavél 2013
Fabio Telles Rodriguez
 
Ad

Recently uploaded (20)

PPTX
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
PPTX
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
PPTX
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
PDF
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
PDF
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
PDF
Building Geospatial Data Warehouse for GIS by GIS with FME
Safe Software
 
PDF
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
PPTX
declaration of Variables and constants.pptx
meemee7378
 
PDF
Heat Treatment Process Automation in India
Reckers Mechatronics
 
PDF
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
PPTX
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
PDF
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
PDF
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
PDF
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
PPTX
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
PPT
Complete Guideliness to Build an Effective Maintenance Plan.ppt
QualityzeInc1
 
PDF
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
PDF
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
PDF
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
PDF
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
ERP Systems in the UAE: Driving Business Transformation with Smart Solutions
dheeodoo
 
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
Digital Transformation: Automating the Placement of Medical Interns
Safe Software
 
Building Geospatial Data Warehouse for GIS by GIS with FME
Safe Software
 
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
declaration of Variables and constants.pptx
meemee7378
 
Heat Treatment Process Automation in India
Reckers Mechatronics
 
On-Device AI: Is It Time to Go All-In, or Do We Still Need the Cloud?
Hassan Abid
 
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
University Campus Navigation for All - Peak of Data & AI
Safe Software
 
Why Edge Computing Matters in Mobile Application Tech.pdf
IMG Global Infotech
 
AI for PV: Development and Governance for a Regulated Industry
Biologit
 
Complete Guideliness to Build an Effective Maintenance Plan.ppt
QualityzeInc1
 
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Ad

High concurrency with Postgres

  • 1. High Concurrency with Postgres Bank of Brazil in real life F´abio Telles Rodriguez Timbira - The Brasilian Postgres Company February 4, 2016 PGConf Russia
  • 2. About me F´abio Telles Rodrigues Open software evangelist +15 years PostgreSQL DBA +10 year Contributor of the brazilian PostgreSQL community Blog: http://savepoint.blog.br (Portuguese only) @telles
  • 3. Timbira http://www.timbira.com.br The Brasilian Postgres Company Consulting / Development / Support Partnership with software development companies In-Company and On-Line training
  • 4. About these talk Outline About Bank of Brasil Multi Document Processing Challenges Adopted solutions
  • 5. Bank of Brasil Founded at 1808, oldest bank in Brazil 59% of shares belong to the government The only bank that has branches in all Brazilian cities more then 110.000 direct employees
  • 6. Multi Document Processing app Developed by Bull (now Atos) Development started as a client/server application 15 years ago Mostly written in C++ Perform a decentralized dematerialization of documents combined with a complex central processing of then Each document have differentdiferent workflows
  • 7. Multi Document Processing app Documents are captured using scanners at branches Local image recognition (reach about 85% of success) Shipping images and meta data to a central point (images are not stored inside database) Central image recognition using third-party tools like ABBYY and A2iA. Manual image recognition Other manual interactions like authorizations and deviations Thousands of business rules for each document Complex interaction with many legacy systems
  • 8. Real life 6,364 branches 22,432 stations using application (will double by the end of the year) 25 servers making central recognition 12 application servers 200 stations making manual recognition Hundreds of leaders requesting reports on peak processing One PostgreSQL database
  • 9. The database PostgreSQL 9.3 228 tables 23 triggers 17 sequences 402 functions
  • 10. In a regular day check clearing: 600,000 (2 milion in the busiest day) escrow checks: 70,000 signature cards: 30,000 non financial documents: 50,000 Critical window between 4pm to 7pm Growth of 10GB 80GB of archives generated
  • 11. Challenges High number of connections Locks in processing queues High number of transactions Small processing window Many heavy queries for reports Need to keep the information for two years in the database New features being implemented constantly
  • 12. Adopted solutions 3 PgBouncer instances Mencached + Listen / Notify to spread information across the stations Strict control of transactions The queue for image recognition was implemented in memory and integrated inside database with PL/Peru using sockets Use of advisory locks in other queues Memory adjustments for specifc users Vaccum and fillfactor adjustments for speciic tables Partition on 24 tables Use of temporary tables and unlogged tables Redesign critical process
  • 13. Questions Spasibo Thank you Obrigado F´abio Telles Rodriguez ([email protected]) http://www.timbira.com.br