Solution: Partition and Normalize

Let’s learn how to solve the antipattern by partitioning and normalizing.

There are better ways to improve performance if a table gets too large instead of splitting the table manually. These include horizontal partitioning, vertical partitioning, and using dependent tables.

Most database brands can handle many more tables and columns than we would need if we were to use a sensible database design. If we feel that we might exceed the maximum, it’s a clear sign that we need to rethink our design.

Using horizontal partitioning

We can gain the benefits of splitting a large table without facing any drawbacks by using a feature that is called horizontal partitioning or sharding. We define a logical table with some rules for separating rows into individual partitions, and the database manages the rest. Physically, the table is split, but we can still execute SQL statements against the table as though it were whole.

Get hands-on with 1200+ tech skills courses.