Database partitioning - Horizontal vs Vertical - Difference between Normalization and Row Splitting?

前端 未结 4 1741
有刺的猬
有刺的猬 2021-01-30 04:01

I am trying to grasp the different concepts of Database Partitioning and this is what I understood of it:

Horizontal Partitioning/Sharding: Spl

4条回答
  •  迷失自我
    2021-01-30 04:39

    The difference between Normalization and splitting lies in the purpose of doing so.

    The main purpose of Normalization is to remove redundant data Where as The purpose of Row splitting is to separate less required data.

    eg:- Suppose you have a table All_Details with columns- id , Emp_name, Emp_address, Emp_phNo ,Emp_other_data, Company_Name , Company_Address , Company_revenue.

    Now if you want to normalize the table you would create two new table Employee_Details and Company_Details and keep a foreign key of company_id in table Employee_Details. this way redundant company data will be removed .

    Now lets talk about row splitting. Say even after normalization you are only accessing employee_name and emp_phNo but you are not accessing emp_address and emp_other_data so frequently. So to improve performance you split the Employee_Details table into two table . table1 containing the frequently needed data( employee_name and emp_phNo ) and table2 containing the less frequently needed data( Emp_address, Emp_other_data) . Both table will have same unique_key column so that you can recreate any row of table Employee_Details with unique_key. This can improve your system performance drasticaly.

提交回复
热议问题