Pengantar
Data
Warehouse
dan OLAP
Agenda
• Pengertian
data warehouse
• Model data multidimensi
• Operasioperasi dalam OLAP
• Arsitektur data warehouse
• Kegunaan data warehouse
Apa itu Data Warehousing?
• Data warehouse adalah koleksi dari data yang
subjectoriented
, terintegrasi,
timevariant
, dan
nonvolatile
, dalam mendukung proses pembuatan
keputusan.
• Sering diintegrasikan dengan berbagai sistem
aplikasi untuk mendukung pemrosesan informasi
dan analisis data dengan menyediakan platform
untuk
historical data
.
•
Data warehousing
: proses konstruksi dan
penggunaan
data warehouse
.
Data warehouse subject oriented
• Data warehouse diorganisasikan di seputar subjek
subjek utama seperti customer, produk, sales.
• Fokus pada pemodelan dan analisis data untuk
pembuatan keputusan, bukan pada operasi harian
atau pemrosesan transaksi.
• Menyediakan sebuah tinjauan sederhana dan ringkas
seputar subjek tertentu dengan tidak
mengikutsertakan data yang tidak berguna dalam
proses pembuatan keputusan.
Data warehouse terintegrasi
• Dikonstruksi dengan mengintegrasikan banyak
sumber data yang heterogen.
– relational database, flat file, online transaction
record
• Teknik
data cleaning
dan
data integration
digunakan
– Untuk menjamin konsistensi dalam konvensi
konvensi penamaan, struktur pengkodean, ukuran
ukuran atribut dll diantara sumber data yang
berbeda.
• Contoh: Hotel price: currency, tax, breakfast
covered, dll.
– Data dikonversi ketika dipindahkan ke
warehouse
.
Data Warehouse—Time Variant
• Data disimpan untuk menyediakan
informasi dari perspektif
historical
, contoh
510 tahun yang lalu.
• Struktur kunci dalam
data warehouse
– Mengandung sebuah elemen waktu, baik secara
ekspisit atau secara implisit.
– Tetapi kunci dari data operasional bisa
mengandung elemen waktu atau tidak.
Data Warehouse — NonVolatile
•
Data warehouse
adalah penyimpanan data yang
terpisah secara fisik yang ditransformasikan dari
lingkungan operasional.
•
Data warehouse
tidak memerlukan pemrosesan
transaksi, recovery dan mekanisme kontrol
konkurensi.
• Biasanya hanya memerlukan dua operasi dalam
pengaksesan data, yaitu
initial loading of data
dan
OLAP (online analitical processing)
• OLAP adalah operasi basis data untuk
mendapatkan data dalam bentuk kesimpulan
dengan menggunakan agregasi sebagai
mekanisme utama.
• Ada 3 tipe:
–
Relational
OLAP (ROLAP):
–
Multidimensional
OLAP (MOLAP)
–
Hybrid
OLAP (HOLAP)
membagi data antara tabel
relasional dan tempat penyimpanan khusus.
Data Warehouse vs. Operational DBMS
• OLTP (online transaction processing)
– Major task of traditional relational DBMS – Daytoday operations: purchasing, inventory, banking, manufacturing, payroll, registration, accounting, etc.• OLAP (online analytical processing)
– Major task of data warehouse system – Data analysis and decision making• Distinct features (OLTP vs. OLAP):
– User and system orientation: customer vs. market – Data contents: current, detailed vs. historical, consolidated – Database design: ER + application vs. star + subject – View: current, local vs. evolutionary, integrated – Access patterns: update vs. readonly but complex queriesOLTP vs. OLAP
OLTP OLAP
users clerk, IT professional knowledge worker
function day to day operations decision support
DB design applicationoriented subjectoriented
data current, uptodate detailed, flat relational isolated historical, summarized, multidimensional integrated, consolidated
usage repetitive adhoc
access read/write
index/hash on prim. key lots of scans
unit of work short, simple transaction complex query
# records accessed tens millions
#users thousands hundreds
DB size 100MBGB 100GBTB
Dari tabel dan spreadsheet
ke Kubus Data
• Data warehouse didasarkan pada model data multidimensional, dimana data dipandang dalam bentuk kubus data
• Kubus data, seperti sales, memungkinkan data dipandang dan dimodelkan dalam banyak dimensi
– Tabel dimensi, seperti item (item_name, brand, type), or time(day, week, month, quarter, year)
– Tabel fakta mengandung measures (seperti dollars_sold) dan merupakan kunci untuk setiap tabeltabel dimensi terkait.
• nD base cube dinamakan base cuboid. 0D cuboid merupakan
cuboid pada level paling tinggi, yang menampung ringkasan data dalan level paling tinggi, dinamakan apex cuboid. Lattice dari cuboidcuboid membentuk sebuah data cube.
Cube: A Lattice of
Cuboids
all
time
item
location supplier
time,item time,location time,supplier item,location item,supplier location,supplier time,item,location time,item,supplier time,location,supplier item,location,supplier time, item, location, supplier
0D(apex) cuboid
1D cuboids
2D cuboids
3D cuboids
4D(base) cuboid
Pemodelan Konseptual Data Warehouse
•
Star schema
: Sebuah tabel fakta di tengahtengah
dihubungkan dengan sekumpulan tabeltabel dimensi.
•
Snowflake schema
: perbaikan dari skema star ketika
hirarki dimensional dinormalisasi ke dalam sekumpulan
tabeltabel dimensi yang lebih kecil
•
Fact constellations
: Beberapa tabel fakta dihubungkan ke
tabeltabel dimensi yang sama, dipandang sebagai
kumpulan dari skema star, sehingga dinamakan skema
galaksi atau
fact constellation
.
Contoh Skema Star
time_key day day_of_the_week month quarter year
time
location_key street city province_or_street countrylocation
Sales Fact Table
time_key
item_key
branch_key
location_key
units_sold
dollars_sold
avg_sales
Measures
item_key item_name brand type supplier_typeitem
branch_key branch_name branch_typebranch
Contoh skema Snowflake
time_key day day_of_the_week month quarter yeartime
location_key street city_keylocation
Sales Fact Table
time_key
item_key
branch_key
location_key
units_sold
dollars_sold
avg_sales
Measures
item_key item_name brand type supplier_keyitem
branch_key branch_name branch_typebranch
supplier_key supplier_typesupplier
city_key city province_or_street countrycity
Contoh Fact Constellation
time_key day day_of_the_week month quarter year time location_key street city province_or_street country location Sales Fact Table time_key item_key branch_key location_key units_sold dollars_sold avg_sales Measures item_key item_name brand type supplier_typeitem
branch_key branch_name branch_type branch Shipping Fact Table time_key item_key shipper_key from_location to_location dollars_cost units_shipped shipper_key shipper_name location_key shipper_type shipperHirarki Konsep: Dimensi (Lokasi)
all
Europe
North_America
Mexico
Canada
Spain
Germany
Vancouver
M. Wind
L. Chan
...
...
...
...
...
...
all
region
office
country
Toronto
Frankfurt
city
Tampilan datawarehouse dan
hirarki
Specification of hierarchies
• Schema hierarchy
day < {month < quarter;
week} < year
• Set_grouping hierarchy
{1..10} < inexpensive
Data Multidimensional
• Sales volume sebagai fungsi dari product,
month, dan region
Produc
t
Re
gion
Month
Dimension: Product, Location, Time
Hierarchical summarization paths
Industry Region Year
Category Country Quarter
Product City Month Week
Office Day
Contoh Kubus Data
Total annual sales
of TV in U.S.A.
Date
Pr
od
uc
t
C
ou
ntr
y
sum
sum
TV
VCR
PC
1Qtr
2Qtr 3Qtr
4Qtr
U.S.A
Canada
Mexico
sum
Cuboid yang terkait dengan
kubus
all
product
date
country
product,date product,country date, country
product, date, country
0D(apex) cuboid
1D cuboids
2D cuboids
Browsing kubus data
• Visualization
• OLAP capabilities
Operasioperasi OLAP
• Roll up (drillup): summarize data – by climbing up hierarchy or by dimension reduction • Drill down (roll down): reverse of rollup – from higher level summary to lower level summary or detailed data, or introducing new dimensions • Slice and dice: – project and select • Pivot (rotate): – reorient the cube, visualization, 3D to series of 2D planes. • Other operations – drill across: involving (across) more than one fact table – drill through: through the bottom level of the cube to its backend relational tables (using SQL)Ilustrasi
• Ilustrasi untuk operasioperasi pada data multidimensi
.
Rancangan Data Warehouse: Business
Analysis Framework
• Four views regarding the design of a data warehouse
–
Topdown view
• allows selection of the relevant information necessary for the
data warehouse
–
Data source view
• exposes the information being captured, stored, and
managed by operational systems
–
Data warehouse view
• consists of fact tables and dimension tables
–
Business query view
• sees the perspectives of data in the warehouse from the view
of enduser
Proses Perancangan Data Warehouse
• Topdown, bottomup approaches or a combination of both
– Topdown: Starts with overall design and planning (mature) – Bottomup: Starts with experiments and prototypes (rapid)• From software engineering point of view
– Waterfall: structured and systematic analysis at each step before proceeding to the next – Spiral: rapid generation of increasingly functional systems, short turn around time, quick turn around• Typical data warehouse design process
– Choose a business process to model, e.g., orders, invoices, etc. – Choose the grain (atomic level of data) of the business process – Choose the dimensions that will apply to each fact table record – Choose the measure that will populate each fact table record