123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> General >> View Article

Database Sharding

Profile Picture
By Author: scalebase
Total Articles: 1
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

Database Sharding is a popular concept used for scaling databases. Basically, it means that instead of storing data in one database, you distribute the application data across multiple databases. Why would you want to do that? Simply put, Database Sharding is the #1 way to scale your database. It’s done by many SaaS companies, the most popular web sites out there, and even big enterprises.

What is Sharding

Horizontal partitioning is a database design principle whereby rows of a database table are held separately, rather than splitting by columns (as for normalization). Each partition forms part of a shard, which may in turn be located on a separate database server or physical location.

But I think the best explanation uses an example, so let’s take the following table:

This is a small table containing a list of customers. Every database out there can handle such a table. But what will happen if instead of 7 rows the table has to store 7 million rows? Now, theoretically, this should be supported. But usually there will be lots of operations on such a large table – so we have many read and ...
... write operations on this table every second. Now, “At Scale, Everything breaks” (as Google VP Engineering, Urs Hölzle, says here). So our nice customer table will probably become a bottleneck. Why? Because it doesn’t fit in the database server cache anymore, because of database isolation management, and for other reasons, all of which cause the database to crawl under load.

Welcome to Sharding. If we take the customers table, and split it to 4 different databases, each database will contain 1.75 million rows. That’s still a lot – but less than 7 million rows. This will result in improved database performance.

Sharding Complexities

Sharding is great. However, writing sharding code is difficult. It requires you to rewrite most of your Data Access Layer from scratch. And while it’s difficult to do when you write your own SQL code, it’s even more complex when using O/R mapping tools, as most are not “sharding oriented”.

But even after writing the initial sharding code, you might run into issues. For instance, a common problem occurs when scaling requires adding more shards. Usually, internally written sharding code supports a fixed number of shards, and adding shards requires massive code rewrites – as well as the major downtime required when moving data from one shard to another.

Other parts of the infrastructure also change when using a sharded database. For example, the reporting application must now be aware of the sharding logic, since you want to collect data from multiple databases rather than just one. And if the reporting application is an off-the-shelf product, you’re out of luck. You’ll have to write the reporting application from scratch.

Backup is an issue. Database Administration is an issue. And more complexities just continue to pop up.

So Database Sharding. is a great solution for Database scaling, but it’s complex and costly. Unfortunately, most of the costs are hidden and only come up after the initial sharding is performed.

Total Views: 63Word Count: 509See All articles From Author

Add Comment

General Articles

1. How Tourism Businesses Can Attract More Travelers Through Online Marketing
Author: Bloom Agency

2. How Digital Marketing Helps Tourism Businesses Grow Online
Author: Bloom Agency

3. On & On Diabalife
Author: sandip gurav

4. 3 Bhk Flats In Zirakpur: Is It Right For Your Family?
Author: General

5. Cism Exam Requirements: Eligibility, Experience, And Certification Guide
Author: Cert Grow

6. Pourquoi Choisir Des Voyages Organisés En Odisha Pour Découvrir L’inde Authentique ?
Author: UTTAM

7. Best Ai Floor Plan Generator Tools For Creating Custom House Plans
Author: venkateshvenky432

8. Pen-210 Wireless Vulnerability Assessment Training
Author: Oscptraining Seo

9. Jungle Book Online Vs Lotus365 And Diamond Exchange Comparison Guide 2026
Author: Cricket Exchange Insights

10. Kv School Uniform Price: A Guide For Parents And Bulk Buyers
Author: Nitin Bhandari

11. Spearmint Oil Supplier: What Bulk Buyers Should Check Before Ordering
Author: Nitin Bhandari

12. Top Fencing Material Distributors In Andhra Pradesh For Bulk Requirements
Author: venkateshvenky432

13. Innovative Marketing Ideas To Increase Student Admissions
Author: Bloom Agency

14. Grow Your Education Business With Effective Student Recruitment Strategies
Author: bloom agency

15. Chamber Rental For Ev Supplier Qualification: Meeting Oem Deadlines Without Capex Delay
Author: indeecon

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: