顯示具有 relation 標籤的文章。 顯示所有文章
顯示具有 relation 標籤的文章。 顯示所有文章

2016年8月22日 星期一

shema design



RDBMS 

is the basis for SQL, and for all modern database systems like MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access. A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model as introduced by E. F. Codd.


Advantage of DocumentBD: 

左圖用了5個 Table 才能表達所需的資料結構, 右圖只需要 2 個Table 加上4個embed 的資料就能表達資料結構


設計時需要考慮到的因素:


  • 訪問模式決定了 schema 設計 (例如: Product -> Brand ; 同樣 Brand -> Product )
  • 數據庫讀寫操作的比例以及是否需要重點優化某一方的性能 (例如: 多數用戶先從 user 開始進行查詢)
  • 查詢和更新的操作類型
  • 數據生命周期和文檔的增長率


數據對像之間存在 3 種類型的關系


  • 1-1
  • 1-n
  • n-n


資料庫正規化