SlideShare a Scribd company logo
Tuning a database for millions of users
Chaowlert Chaisrichalermpol
Senior Solution Architect at IBM
Chaowlert
Chaisrichalermpol
DevelopDesign Monitoring
AGENDA
Set your expectation
DBA Developer
Today Topics
Scaling up to your first 10 million users
https://www.youtube.com/watch?v=Ma3xWDXTxRg
Tuning a database for millions of users
Tuning a database for millions of users
Tuning a database for millions of users
Tuning a database for millions of users
Tuning a database for millions of users
Why not we start with full architecture?
Should I use NoSQL?
- If you plan for 500,000 users in first year
- Lower cost storage, with no ACID features
required (ex. Logs)
Should I start with Microservices?
Monolith first if
- Bounded Context is still unclear
- No time for Microservices complexity
- No time for tooling
Understand Db Strength & Weakness
Strength
- Established technology
- ACID out of the box
- Integrated metrics
- Able to tune without effecting system
Weakness
- Db always be bottleneck
Scaling Db
> 100 users
- Scaling up
> 500,000 users
- Move some functionalities to NoSQL
- Caching
- Move expensive queries to read replica
> 1,000,000 users
- Async integration
- Apply microservices and split databases
- Db Partitioning
Develop Monitoring
AGENDA
Design
It’s all about Execution Plan
If you are Db Admin, let developers see
Execution Plan
Index basic
- Lookup time much faster (n vs log(n))
- Increase storage & modification time
- Recommended number of indexes are 10 for
read intensive, and 5 for write intensive
(http://www.youtube.com/watch?v=gOsflkQk
Hjg)
Index usage
- Avoid type conversion in where clause
- Avoid using function on indexed column
- Avoid OR
- Does column order matter?
Workshop 1 - Index
- Table scan & index scan means db will
search entire table
- Foreign key is good candidate for index
https://data.stackexchange.com/stackoverflow/query/2469/all
-my-badges
Workshop 2 – Include columns
- Key lookup means index need data from
main table
- You can add columns to index with include
to reduce key lookup
https://data.stackexchange.com/stackoverflow/query/7521/ho
w-unsung-am-i
Workshop 3 – Composite index
- Sort is a good candidate for index
https://data.stackexchange.com/stackoverflow/query/947/my
-comment-score-distribution
Workshop 4 – Merge duplicate index
- Index on columns A,B,C implies index on
A,B and index on A only
- Therefore, index A,B,C can be merge with
index A,B
https://data.stackexchange.com/stackoverflow/query/3160/jo
n-skeet-comparison
Workshop 5 – CTE
- Table variable is for a few rows
- Use CTE if table is consumed only once
https://data.stackexchange.com/stackoverflow/query/466/mo
st-controversial-posts-on-the-site
How to handle complex queries?
Synchronous
- Materialized view
- New table
- Use trigger to update
- Update to new table in the
same transaction
Asynchronous
- Cache
- Async integration
- Async stream
Consistency Latency
Develop Monitoring
AGENDA
Design
Monitor your indexes
- Missing indexes
- Unused indexes
- Merge duplicate indexes
Avoid local maxima
Tuning db Tuning app
Query statistics
- High worker time
- High logical read
- High total rows
- High elapsed time
- These are good candidates for precompute
or caching
Still local maxima?
Tuning db Tuning app Tuning infra
Tuning biz
Q & A
Send you CV & position to
chaowlert@th.ibm.com
THANK YOU

More Related Content

PPTX
Helm - Package manager in K8S
PDF
Index conf sparkml-feb20-n-pentreath
PDF
Apache Iceberg - A Table Format for Hige Analytic Datasets
PDF
Building Cloud Native Analytical Pipelines on AWS
PPTX
Data Warehouse Offload
PDF
Data Center Blueprints: Open Compute
PPTX
Introduction to GCP BigQuery and DataPrep
PDF
Redshift
Helm - Package manager in K8S
Index conf sparkml-feb20-n-pentreath
Apache Iceberg - A Table Format for Hige Analytic Datasets
Building Cloud Native Analytical Pipelines on AWS
Data Warehouse Offload
Data Center Blueprints: Open Compute
Introduction to GCP BigQuery and DataPrep
Redshift

Similar to Tuning a database for millions of users (20)

PPT
Designing, Building, and Maintaining Large Cubes using Lessons Learned
PDF
Data exposure in Azure - production use-case
PDF
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...
PDF
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
PPTX
Boosting the Performance of your Rails Apps
PPTX
Querying Druid in SQL with Superset
PPT
Top 10 Oracle SQL tuning tips
PDF
Trivadis TechEvent 2017 Oracle to My SQL Migration - Challenges by Robert Bia...
PDF
Gcp data engineer
PDF
Reduce planned database down time with Oracle technology
PDF
GCP Data Engineer cheatsheet
PPTX
SQL Server 2008 Development for Programmers
PDF
Improving Spark SQL at LinkedIn
PPTX
Presentación Oracle Database Migración consideraciones 10g/11g/12c
PDF
Modernizing your database with SQL Server 2019
PPTX
Performance Tuning Oracle's BI Applications
PDF
Democratization of NOSQL Document-Database over Relational Database Comparati...
PDF
Optimized cluster index generation
PDF
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
PDF
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
Designing, Building, and Maintaining Large Cubes using Lessons Learned
Data exposure in Azure - production use-case
Storage Optimization and Operational Simplicity in SAP Adaptive Server Enter...
Microsoft Azure Data Fundamentals (DP-900) Exam Dumps & Questions 2025.pdf
Boosting the Performance of your Rails Apps
Querying Druid in SQL with Superset
Top 10 Oracle SQL tuning tips
Trivadis TechEvent 2017 Oracle to My SQL Migration - Challenges by Robert Bia...
Gcp data engineer
Reduce planned database down time with Oracle technology
GCP Data Engineer cheatsheet
SQL Server 2008 Development for Programmers
Improving Spark SQL at LinkedIn
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Modernizing your database with SQL Server 2019
Performance Tuning Oracle's BI Applications
Democratization of NOSQL Document-Database over Relational Database Comparati...
Optimized cluster index generation
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
Ad

More from Chaowlert Chaisrichalermpol (8)

PPTX
Front end development
PPTX
Introduction to Azure Machine Learning
PPTX
Mobile app on Azure
PPTX
PPTX
DevRock #01 What's new ASP.net 5
PPT
PPTX
Azure Introduction
PPTX
Windows Azure Storage – Architecture View
Front end development
Introduction to Azure Machine Learning
Mobile app on Azure
DevRock #01 What's new ASP.net 5
Azure Introduction
Windows Azure Storage – Architecture View
Ad

Recently uploaded (20)

PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Essential Infomation Tech presentation.pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
medical staffing services at VALiNTRY
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Nekopoi APK 2025 free lastest update
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Essential Infomation Tech presentation.pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PTS Company Brochure 2025 (1).pdf.......
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Upgrade and Innovation Strategies for SAP ERP Customers
medical staffing services at VALiNTRY
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
How to Migrate SBCGlobal Email to Yahoo Easily
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
VVF-Customer-Presentation2025-Ver1.9.pptx
How to Choose the Right IT Partner for Your Business in Malaysia
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
How Creative Agencies Leverage Project Management Software.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Nekopoi APK 2025 free lastest update
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf

Tuning a database for millions of users

  • 1. Tuning a database for millions of users Chaowlert Chaisrichalermpol
  • 2. Senior Solution Architect at IBM Chaowlert Chaisrichalermpol
  • 4. Set your expectation DBA Developer Today Topics
  • 5. Scaling up to your first 10 million users https://www.youtube.com/watch?v=Ma3xWDXTxRg
  • 11. Why not we start with full architecture?
  • 12. Should I use NoSQL? - If you plan for 500,000 users in first year - Lower cost storage, with no ACID features required (ex. Logs)
  • 13. Should I start with Microservices? Monolith first if - Bounded Context is still unclear - No time for Microservices complexity - No time for tooling
  • 14. Understand Db Strength & Weakness Strength - Established technology - ACID out of the box - Integrated metrics - Able to tune without effecting system Weakness - Db always be bottleneck
  • 15. Scaling Db > 100 users - Scaling up > 500,000 users - Move some functionalities to NoSQL - Caching - Move expensive queries to read replica > 1,000,000 users - Async integration - Apply microservices and split databases - Db Partitioning
  • 17. It’s all about Execution Plan If you are Db Admin, let developers see Execution Plan
  • 18. Index basic - Lookup time much faster (n vs log(n)) - Increase storage & modification time - Recommended number of indexes are 10 for read intensive, and 5 for write intensive (http://www.youtube.com/watch?v=gOsflkQk Hjg)
  • 19. Index usage - Avoid type conversion in where clause - Avoid using function on indexed column - Avoid OR - Does column order matter?
  • 20. Workshop 1 - Index - Table scan & index scan means db will search entire table - Foreign key is good candidate for index https://data.stackexchange.com/stackoverflow/query/2469/all -my-badges
  • 21. Workshop 2 – Include columns - Key lookup means index need data from main table - You can add columns to index with include to reduce key lookup https://data.stackexchange.com/stackoverflow/query/7521/ho w-unsung-am-i
  • 22. Workshop 3 – Composite index - Sort is a good candidate for index https://data.stackexchange.com/stackoverflow/query/947/my -comment-score-distribution
  • 23. Workshop 4 – Merge duplicate index - Index on columns A,B,C implies index on A,B and index on A only - Therefore, index A,B,C can be merge with index A,B https://data.stackexchange.com/stackoverflow/query/3160/jo n-skeet-comparison
  • 24. Workshop 5 – CTE - Table variable is for a few rows - Use CTE if table is consumed only once https://data.stackexchange.com/stackoverflow/query/466/mo st-controversial-posts-on-the-site
  • 25. How to handle complex queries? Synchronous - Materialized view - New table - Use trigger to update - Update to new table in the same transaction Asynchronous - Cache - Async integration - Async stream Consistency Latency
  • 27. Monitor your indexes - Missing indexes - Unused indexes - Merge duplicate indexes
  • 28. Avoid local maxima Tuning db Tuning app
  • 29. Query statistics - High worker time - High logical read - High total rows - High elapsed time - These are good candidates for precompute or caching
  • 30. Still local maxima? Tuning db Tuning app Tuning infra Tuning biz
  • 31. Q & A
  • 32. Send you CV & position to chaowlert@th.ibm.com