SlideShare a Scribd company logo
1 of 13
Download to read offline
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

Similar to High concurrency with Postgres

Innovate2014 ea 1833
Innovate2014 ea 1833Innovate2014 ea 1833
Innovate2014 ea 1833Paulo Lacerda
 
Billions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right NowBillions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right NowRob Winters
 
What every managemenet accountants should know about the cloud by l iv watson
What every managemenet accountants should know about the cloud by l iv watsonWhat every managemenet accountants should know about the cloud by l iv watson
What every managemenet accountants should know about the cloud by l iv watsonWorkiva
 
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop Shirshanka Das
 
[WSO2Con EU 2018] The Rise of Streaming SQL
[WSO2Con EU 2018] The Rise of Streaming SQL[WSO2Con EU 2018] The Rise of Streaming SQL
[WSO2Con EU 2018] The Rise of Streaming SQLWSO2
 
Processing 19 billion messages in real time and NOT dying in the process
Processing 19 billion messages in real time and NOT dying in the processProcessing 19 billion messages in real time and NOT dying in the process
Processing 19 billion messages in real time and NOT dying in the processJampp
 
In a typical organization, databases and communications technology a.pdf
In a typical organization, databases and communications technology a.pdfIn a typical organization, databases and communications technology a.pdf
In a typical organization, databases and communications technology a.pdflibowskymcinnisell69
 
Database Development
Database DevelopmentDatabase Development
Database Developmenthickam
 
E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres Regunath B
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Differencejeetendra mandal
 
OpenSource for Enterprise Business Presentation 010
OpenSource for Enterprise Business Presentation 010OpenSource for Enterprise Business Presentation 010
OpenSource for Enterprise Business Presentation 010Passapong Thaithatgoon
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Brian Brazil
 
How to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st centuryHow to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st centuryAli Dasdan
 
7_considerations_final
7_considerations_final7_considerations_final
7_considerations_finalJane Roberts
 
Quantifying Business Advantage: The Value of Database Selection
Quantifying Business Advantage: The Value of Database SelectionQuantifying Business Advantage: The Value of Database Selection
Quantifying Business Advantage: The Value of Database SelectionMongoDB
 

Similar to High concurrency with Postgres (20)

Innovate2014 ea 1833
Innovate2014 ea 1833Innovate2014 ea 1833
Innovate2014 ea 1833
 
Billions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right NowBillions of Rows, Millions of Insights, Right Now
Billions of Rows, Millions of Insights, Right Now
 
What every managemenet accountants should know about the cloud by l iv watson
What every managemenet accountants should know about the cloud by l iv watsonWhat every managemenet accountants should know about the cloud by l iv watson
What every managemenet accountants should know about the cloud by l iv watson
 
Building Chatbots
Building ChatbotsBuilding Chatbots
Building Chatbots
 
Realtime search
Realtime searchRealtime search
Realtime search
 
Big data architecture
Big data architectureBig data architecture
Big data architecture
 
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
Strata SG 2015: LinkedIn Self Serve Reporting Platform on Hadoop
 
[WSO2Con EU 2018] The Rise of Streaming SQL
[WSO2Con EU 2018] The Rise of Streaming SQL[WSO2Con EU 2018] The Rise of Streaming SQL
[WSO2Con EU 2018] The Rise of Streaming SQL
 
Processing 19 billion messages in real time and NOT dying in the process
Processing 19 billion messages in real time and NOT dying in the processProcessing 19 billion messages in real time and NOT dying in the process
Processing 19 billion messages in real time and NOT dying in the process
 
In a typical organization, databases and communications technology a.pdf
In a typical organization, databases and communications technology a.pdfIn a typical organization, databases and communications technology a.pdf
In a typical organization, databases and communications technology a.pdf
 
Database Development
Database DevelopmentDatabase Development
Database Development
 
E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres E commerce data migration in moving systems across data centres
E commerce data migration in moving systems across data centres
 
Blood bank report new
Blood bank report newBlood bank report new
Blood bank report new
 
Batch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing DifferenceBatch Processing vs Stream Processing Difference
Batch Processing vs Stream Processing Difference
 
Venugopal - BO Resume
Venugopal - BO ResumeVenugopal - BO Resume
Venugopal - BO Resume
 
OpenSource for Enterprise Business Presentation 010
OpenSource for Enterprise Business Presentation 010OpenSource for Enterprise Business Presentation 010
OpenSource for Enterprise Business Presentation 010
 
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)Prometheus for Monitoring Metrics (Percona Live Europe 2017)
Prometheus for Monitoring Metrics (Percona Live Europe 2017)
 
How to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st centuryHow to build and run a big data platform in the 21st century
How to build and run a big data platform in the 21st century
 
7_considerations_final
7_considerations_final7_considerations_final
7_considerations_final
 
Quantifying Business Advantage: The Value of Database Selection
Quantifying Business Advantage: The Value of Database SelectionQuantifying Business Advantage: The Value of Database Selection
Quantifying Business Advantage: The Value of Database Selection
 

More from Fabio Telles Rodriguez

Data Hero: Sua carreira na área de dados
Data Hero: Sua carreira na área de dadosData Hero: Sua carreira na área de dados
Data Hero: Sua carreira na área de dadosFabio Telles Rodriguez
 
Aplicações 10x a 100x mais rápida com o postgre sql
Aplicações 10x a 100x mais rápida com o postgre sqlAplicações 10x a 100x mais rápida com o postgre sql
Aplicações 10x a 100x mais rápida com o postgre sqlFabio Telles Rodriguez
 
Migre seu banco de dados para a nuvem. Pergunte-me como!
Migre seu banco de dados para a nuvem. Pergunte-me como!Migre seu banco de dados para a nuvem. Pergunte-me como!
Migre seu banco de dados para a nuvem. Pergunte-me como!Fabio Telles Rodriguez
 
Postgres Wonderland - Campus Party 2013
Postgres Wonderland - Campus Party 2013Postgres Wonderland - Campus Party 2013
Postgres Wonderland - Campus Party 2013Fabio Telles Rodriguez
 
Postgres Wonderland - PGDay Cascavél 2013
Postgres Wonderland - PGDay Cascavél 2013Postgres Wonderland - PGDay Cascavél 2013
Postgres Wonderland - PGDay Cascavél 2013Fabio Telles Rodriguez
 

More from Fabio Telles Rodriguez (20)

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

Recently uploaded

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Recently uploaded (20)

Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

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