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

More Related Content

PPTX
The NoSQL movement @ DotNetToscana
ODP
PPTX
Connected and continuous localization systems for content management systems
PPT
Tw Bizcases
PDF
Construindo uma Intranet Corporativa utilizando Plone
PDF
MicroStrategy at Badoo
PDF
Redis Day TLV 2018 - Redis & BioCatch
PDF
Presto @ Treasure Data - Presto Meetup Boston 2015
The NoSQL movement @ DotNetToscana
Connected and continuous localization systems for content management systems
Tw Bizcases
Construindo uma Intranet Corporativa utilizando Plone
MicroStrategy at Badoo
Redis Day TLV 2018 - Redis & BioCatch
Presto @ Treasure Data - Presto Meetup Boston 2015

Similar to High concurrency with Postgres (20)

PDF
Innovate2014 ea 1833
PPT
Billions of Rows, Millions of Insights, Right Now
PDF
What every managemenet accountants should know about the cloud by l iv watson
PDF
Building Chatbots
PDF
What companies do with Pharo (ESUG 2025)
PPT
Realtime search
PPTX
Big data architecture
PDF
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
PDF
[WSO2Con EU 2018] The Rise of Streaming SQL
PDF
Processing 19 billion messages in real time and NOT dying in the process
PDF
In a typical organization, databases and communications technology a.pdf
PPT
Database Development
PDF
E commerce data migration in moving systems across data centres
DOCX
Blood bank report new
PPTX
Batch Processing vs Stream Processing Difference
DOC
Venugopal - BO Resume
ODP
OpenSource for Enterprise Business Presentation 010
PPTX
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
PDF
How to build and run a big data platform in the 21st century
PDF
OpenMetadata Spotlight - OpenMetadata @ Loggi by Erica Bertan
Innovate2014 ea 1833
Billions of Rows, Millions of Insights, Right Now
What every managemenet accountants should know about the cloud by l iv watson
Building Chatbots
What companies do with Pharo (ESUG 2025)
Realtime search
Big data architecture
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
[WSO2Con EU 2018] The Rise of Streaming SQL
Processing 19 billion messages in real time and NOT dying in the process
In a typical organization, databases and communications technology a.pdf
Database Development
E commerce data migration in moving systems across data centres
Blood bank report new
Batch Processing vs Stream Processing Difference
Venugopal - BO Resume
OpenSource for Enterprise Business Presentation 010
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
How to build and run a big data platform in the 21st century
OpenMetadata Spotlight - OpenMetadata @ Loggi by Erica Bertan
Ad

More from Fabio Telles Rodriguez (20)

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

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Transform Your Business with a Software ERP System
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
System and Network Administraation Chapter 3
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
assetexplorer- product-overview - presentation
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
medical staffing services at VALiNTRY
PDF
Nekopoi APK 2025 free lastest update
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
top salesforce developer skills in 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PTS Company Brochure 2025 (1).pdf.......
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Transform Your Business with a Software ERP System
Softaken Excel to vCard Converter Software.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
CHAPTER 2 - PM Management and IT Context
Design an Analysis of Algorithms II-SECS-1021-03
System and Network Administraation Chapter 3
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Understanding Forklifts - TECH EHS Solution
assetexplorer- product-overview - presentation
How to Choose the Right IT Partner for Your Business in Malaysia
Adobe Illustrator 28.6 Crack My Vision of Vector Design
medical staffing services at VALiNTRY
Nekopoi APK 2025 free lastest update
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Wondershare Filmora 15 Crack With Activation Key [2025

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 (telles@timbira.com.br) http://www.timbira.com.br