What is difference between horizontal and vertical partitioning...
What is difference between horizontal and vertical partitioning...
Horizontal and vertical partitioning are two techniques used in databases to distribute data across multiple tables or databases, which are key strategies for managing large datasets and improving performance, scalability, and manageability.
Horizontal Partitioning (Sharding):
Users
with columns UserID
, Name
, Country
, you might divide this table into multiple tables based on Country
. For example, all users from the USA in one table, users from the UK in another, and so on. Each partitioned table has the same columns (UserID
, Name
, Country
), but only a portion of the rows.Vertical Partitioning:
Users
table example (UserID
, Name
, Country
), in vertical partitioning, you might split this into two tables: One table with UserID
and Name
, another table with UserID
, Country
. The UserID
column is common in both tables and acts as a link between them.expert
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào