1 / 43

Desain Data Warehouse (Dimensional Modelling )

Desain Data Warehouse (Dimensional Modelling ). Mendisain Sebuah Data Warehouse. Mendisain database untuk data warehouse adalah problem utama dalam mendisain data warehouse Ada dua pendekatan utama dalam perancangan data warehouse Pemodelan dan normalisasi entity relationship (ER)

rafael-duke
Download Presentation

Desain Data Warehouse (Dimensional Modelling )

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Desain Data Warehouse (Dimensional Modelling)

  2. Mendisain Sebuah Data Warehouse • Mendisain database untuk data warehouse adalah problem utama dalam mendisain data warehouse • Ada dua pendekatan utama dalam perancangan data warehouse • Pemodelan dan normalisasi entity relationship (ER) • Pemodelan berdimensi

  3. Perancangan Database MenggunakanPendekatan E-R yang Tradisional • Entities and Relationships • Aturan Normalisasi • Umumnya 3NF • Menjaga integritas database dengan menghindari anomalies • Pemikiran yang berbeda antara logical dan physical

  4. Contoh Normalisasi • Sebuah perusahaan manufaktur membuat produk dari beberapa komponen. Setiap produk mempunyai suatu nomor produk yang tersendiri, nama dan waktu perakitan. Semua komponen mempunyai nomor komponen tersendiri, diskripsi, kode supplier dan harga.

  5. Database Yang Sudah Dinormalisasikan • Product (ProductCode, Name, Time) • Parts (ProductCode, ComponentCode, Qty) • Component (ComponentCode, Description, Supplier, Cost) Parts Product Component

  6. Isi Database Ternormalisasi

  7. Conceptual Modeling of Data Warehouses • Modeling data warehouses: (Dimensional Modeling) • Star schema: A fact table in the middle connected to a set of dimension tables • Snowflake schema: A refinement of star schema where some dimensional hierarchy is normalized into a set of smaller dimension tables, forming a shape similar to snowflake • Fact constellations: Multiple fact tables share dimension tables, viewed as a collection of stars, therefore called galaxy schema or fact constellation

  8. item time item_key item_name brand type supplier_type time_key day day_of_the_week month quarter year location branch location_key street city province_or_street country branch_key branch_name branch_type Example of Star Schema Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales Measures

  9. supplier item time item_key item_name brand type supplier_key supplier_key supplier_type time_key day day_of_the_week month quarter year city location branch city_key city province_or_street country location_key street city_key branch_key branch_name branch_type Example of Snowflake Schema Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales Measures

  10. item time item_key item_name brand type supplier_type time_key day day_of_the_week month quarter year location location_key street city province_or_street country shipper branch shipper_key shipper_name location_key shipper_type branch_key branch_name branch_type Example of Fact Constellation Shipping Fact Table time_key Sales Fact Table item_key time_key shipper_key item_key from_location branch_key to_location location_key dollars_cost units_sold units_shipped dollars_sold avg_sales Measures

  11. Pendekatan Pada PerancanganData Warehouse • Ada banyak sekali pendekatan yang diajukan oleh para pengembang dan konsultan mengenai data warehouse • Ini harus diperhatikan sebagai satu kesatuan proses perkembangan data warehouse sepenuhnya

  12. Apa sebenarnya multi-dimensionaldatabase? • Suatu pendekatan pada perancangan database yang dapat memberikan database yang mudah dimengerti dan mudah dinavigasikan • Tujuannya adalah untuk mendorong pengertian, eksplorasi dan pembelajaran • Setiap nomor mempunyai satu set atribut yang terasosiasikan • Apa yang direpresentasikan, kapan dibuat, darimana datangnya, produk apa saja yang terkait, promosi apa, dll

  13. Multi-Dimensionality • Biasanya mengenai ruangan informasi dalam bentuk cubes atau hyper cubes atau n-cubes • Setiap atribut terkait dengan setiap nomor merepresentasikan suatu dimensi • Ukuran, waktu, tempat, produk, lokasi dll • Tampilan database yang dihasilkan mudah untuk dinavigasikan dan dipindahkan • Slice and dice • Report template

  14. Tahapan dalam Proses Disain 1. Memilih proses bisnis 2. Memilih inti dari fact table 3. Memilih dimensi 4. Memilih fact yang terukur (umumnya numeric, additive quantities) 5. Melengkapi tabel dimensi (Kimball, 1996)

  15. Tahapan Ekstra Dalam Proses Disain • Menentukan strategi untuk mengubah dimensi secara pelan-pelan • Membuat agregat dan komponen penyimpanan fisik lainnya • Menentukan waktu histori dari database • Menentukan tingkat keperluan data yang mana yang perlu diekstrak dan diload ke dalam data warehouse KimbalL (1996)

  16. Contoh: Usaha Retail • Perusahaan grocery besar dengan perkiraan 500 outlet • Setiap outlet mempunyai sekitar 60000 produk dalam tampilannya • SKU – Stock Keeping Unit • UPC – Universal Product Code

  17. Usaha Retail • Perlu untuk memaksimalkan keuntungan dan tetap menjaga stok agar tetap ada • Keputusan penting untuk masalah harga dan promosi • Tipe promosi adalah: • Discount harga sementara • Reklame surat kabar • Tampilan lemari dan lorong • Kupon

  18. Usaha Retail • Memilih Proses Bisnis • Pergerakan barang harian • Memilih inti dari tabel fact • SKU by store by promotion by day • Memilih dimensi • Waktu, Produk, Toko dan Promosi

  19. Dimensi Usaha Retail

  20. Usaha Retail • Memilih fact terukur

  21. Usaha Retail: Dimensi • Lengkapi tabel dimensi

  22. Usaha Retail: Dimensi Produk

  23. Usaha Retail: Dimensi Toko

  24. Usaha Retail: Dimensi Promosi

  25. Catatan Untuk Masalah Hierarchies • Hirarki yang jelas tidak diperlukan untuk mendukung drilling down • Detailnya sering harus disimpan secara eksplisit • Hirarki di dalam dimensi sangat penting • Memungkinkan untuk melakukan drill up dan drill down • Contoh: day, week, month, quarter, year • Hirarki independen yang berkelipatan

  26. More OLAP - Dimensional modeling www.cl.cam.ac.uk/Teaching/current/Databases/

  27. Conceptual Modeling of Data Warehouses Modeling data warehouses: dimensions & measures • Star schema: A fact table in the middle connected to a set of dimension tables • Snowflake schema: A refinement of star schema where some dimensional hierarchy is normalized into a set of smaller dimension tables, forming a shape similar to snowflake • Fact constellations: Multiple fact tables share dimension tables, viewed as a collection of stars, therefore called galaxy schema or fact constellation

  28. Star

  29. Star Schema

  30. Terms • Fact table • Dimension tables • Measures

  31. item time item_key item_name brand type supplier_type time_key day day_of_the_week month quarter year location branch location_key street city province_or_street country branch_key branch_name branch_type Another Star Schema Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales Measures

  32. Dimension Hierarchies sType store city region è snowflake schema è constellations

  33. Cube Fact table view: Multi-dimensional cube: dimensions = 2

  34. day 2 day 1 3-D Cube Fact table view: Multi-dimensional cube: dimensions = 3

  35. Aggregates • Add up amounts for day 1 • In SQL: SELECT sum(amt) FROM SALE • WHERE date = 1 81

  36. Aggregates • Add up amounts by day • In SQL: SELECT date, sum(amt) FROM SALE • GROUP BY date

  37. Another Example • Add up amounts by day, product • In SQL: SELECT date, sum(amt) FROM SALE • GROUP BY date, prodId rollup drill-down

  38. Aggregates • Operators: sum, count, max, min, median, ave • “Having” clause • Using dimension hierarchy • average by region (within store) • maximum by month (within date)

  39. rollup drill-down Cube Aggregation Example: computing sums day 2 . . . day 1 129

  40. Cube Operators day 2 . . . day 1 sale(c1,*,*) 129 sale(c2,p2,*) sale(*,*,*)

  41. Extended Cube * day 2 sale(*,p2,*) day 1

  42. day 2 day 1 Aggregation Using Hierarchies customer region country (customer c1 in Region A; customers c2, c3 in Region B)

  43. day 2 day 1 Pivoting Fact table view: Multi-dimensional cube:

More Related