Skip to content

資料模型(Data Modeling)

設計 => ER models, 正規化, Primary Key, 時區, Index 一致性 => ACID, Race condition, isolation level Backup Migration

設計

需求 - 商業 - 資料量級 - 安全

收集與梳理資訊 - 現場使用的人 - 現有表單(invoices, timesheets, surveys) - 現有資料系統

what kinds of data the database will include where that data comes from how it will be used

ERD Primary Key Cardinality

Index B+ Tree => 只有最下面的節點有資料,其它上面的節點只存索引

Clustered Index => 在innodb中, 它就是這份資料實際上儲存的結構(B+ Tree)

Secondary Index => 可以自行建立的索引, 最基本使用 secondary Index 的步驟, 至 secondary Index 尋找 PK, 再至 clustered Index 取得完整資料

看看候選欄位的基數大小, 基數就是指這個欄位的值的可能性

SELECT COUNT(DISTINCT {field}/COUNT(*))
一般索引(覆蓋索引) 連合索引 : 常常需要與其它欄位一起查詢,適合建立。但是要注意先後順序,基本最常查詢的與基數高的適合放最左邊 前綴索引 : 這種大致上用在如果要針對某段文字進行前綴搜尋的情況

Redis

ElasticSearch

Hadoop ecosystem

Dbeaver