BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

48

Transcript of BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Page 1: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.
Page 2: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

BISM:Multidimensional vs. TabularMarco RussoSenior ConsultantSQLBI

Page 4: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

What we’ll discuss

History recap & roadmapxVelocityPatterns comparisonConsiderations about porting/migrationWho wins?

Page 5: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

UDM was born in 2005

Once upon a time, there was UDMUnified Dimensional ModelOnly one BI data modeling tool

Page 6: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

2012: BI Semantic Model

There was UDM, now there is BISMBusiness Intelligence Semantic Model

Only one BI data modeling toolDivided in two flavors

TabularMultidimensional

Now there are two modeling techniquesUnder a single technology

Page 7: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

BI Semantic Model: Vision

BI Semantic Model

Data model

Business logic and queries

Data access ROLAP MOLAPxVelocityVertiPaq

DirectQuery

MDX DAX

Multi-dimensional

Tabular

Third-partyapplications

ReportingServices Excel PowerPivot

Databases LOB Applications Files OData Feeds Cloud Services

SharePointInsights

Power View

Page 8: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Tabular: the new kid in town

Part of the BISM visionSuper-duper fast xVelocity in-memory engineAmazing compression ratio of tablesBased on the relational data modelProgrammed with the new DAX languageWhen compared with OLAP

Quite always faster. Much fasterEasier to learn and use

Page 9: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Is This The Right Approach?

1. I am xVelocity, your new engine

2. Thou shalt have no other engine before me

Page 10: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Or is it Better to Investigate?

1. I have two engines now2. What are their strenghts?3. When should I choose one

against the other?

Page 11: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Analysis Services Server Mode

Choose server mode of Analysis ServicesDeploymentMode setting in msmdsrv.ini

0 – Multidimensional and Data Mining (default)1 – SharePoint2 – Tabular

Different icons in Object ExplorerSame code, different behaviorChoice at the INSTANCE levelTwo SSAS instances needed to use both

Page 12: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

What is xVelocity in-memory?

In-memory databaseBased on the relational methodologyColumn oriented databaseData is stored in a compressed format

Page 13: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Row Storage Layout

ID Name Address City State Bal Due

1 Bob … … … 3,000

2 Sue … … … 500

3 Ann … … … 1,700

4 Jim … … … 1,500

5 Liz … … … 0

6 Dave … … … 9,000

7 Sue … … … 1,010

8 Bob … … … 50

9 Jim … … … 1,300

1 Bob … … … 3,000

2 Sue … … … 500

3 Ann … … … 1,700

4 Jim … … … 1,500

5 Liz … … … 0

6 Dave … … … 9,000

7 Sue … … … 1,010

8 Bob … … … 50

9 Jim … … … 1,300

Nothing special here. This is the standard way database systems have been laying out tables on disk since the mid 1970s.Technically, it is called a “row store”

Customers Table

Page 14: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Column Storage Layout

ID Name Address City State Bal Due

1 Bob … … … 3,000

2 Sue … … … 500

3 Ann … … … 1,700

4 Jim … … … 1,500

5 Liz … … … 0

6 Dave … … … 9,000

7 Sue … … … 1,010

8 Bob … … … 50

9 Jim … … … 1,300

Tables are stored “column-wise” with all values from a single column stored in a single block

Customers Table

ID

1

2

3

4

5

6

7

8

9

Name

Bob

Sue

Ann

Jim

Liz

Dave

Sue

Bob

Jim

Address

City

State

Bal Due

3,000

500

1,700

1,500

0

9,000

1,010

50

1,300

Page 15: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Column vs Row Storage

Column StorageQuick access to a single columnTime needed to materialize rowsTrade CPU vs I/O

Row StorageQuick access to a single rowNo materialization neededTrade I/O vs CPU

Page 16: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Run Length Encoding (RLE)Quarter

Q1

Q1

Q1

Q1

Q1

Q1

Q2

Q2

Q2

Q2

Q2

Q2

Q2

Q2

Q2

Quarter Start Count

Q1 1 310

Q2 311 290

… … …

ProdID Start Count

1 1 5

2 6 3

… … …

1 51 5

2 56 3

ProdID

1

1

1

1

1

2

2

2

1

1

1

1

1

2

2

2

Price

100

120

315

100

315

198

450

320

320

150

256

450

192

184

310

251

266

Price

100

120

315

100

315

198

450

320

320

150

256

450

192

184

310

251

266

RLE Compression applied onlywhen size of compressed datais smaller than original

Page 17: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

xVelocity Store

Dictionary EncodingQuarter

Q1

Q1

Q1

Q1

Q2

Q2

Q2

Q3

Q3

Q3

Q3

Q4

Q4

Q4

Q4

Only 4 values.2 bits are enough torepresent it

DISTINCT

Q.ID Quarter

0 Q1

1 Q2

2 Q3

3 Q4

Q.ID

1

1

1

1

2

2

2

3

3

3

3

4

4

4

4

R.L.E.

Q.ID Start Count

1 1 4

2 5 10

3 11 4

4 15 15

Page 18: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

xVelocity works only in-memory

Compressed dataMust fit in memoryOtherwise, it simply does not work

On the hardware side this meansVery fast CPUVery fast memoryDisks are not important at all

Page 19: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Which Server for SSAS?Feature Multidimensional Tabular

RAM Some (16/32 Gb) A lot (64/128 Gb)

RAM Speed Important Crucial

Number of cores 4/8/16 4/8/16

Core speed Less Important Crucial

Disk speed Very Important Useless

SSD Disk Usage Strongly recommended Useless

Network speed Important Important

Concurrency Pretty good Not enough experience…

Ideally, don’t use the sameserver for both

Page 20: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Main Limitations of Tabular

Database must fit in memoryMissing Features

No support for translationsNo concept of «Set»

MDX Script not availableOnly plain vanilla 1:M relationships

Page 21: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Distinct Count in Multidimensional

In Multidimensional they are a painDedicated measure groupPartitioning needed for performance

Based on the number of coresDesigned for the hardware

Poor processing performanceORDER BY during processingOn the fact table…

Page 22: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Distinct Count in Tabular

Simply… easy as you might wantDistinct Count on any columnDictionary encoding helps a lotIn-memory calculationsNo special processing for Distinct CountsNo partitioning neededNo special measure group

Page 23: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

What about aggregations?

Hard to designIf you don’t rely on the wizardWhich you should not!

Improvement on a subset of queriesNeed to check them periodicallyUsage Based Optimizations helps

But it is hard to manageIn Tabular? They are gone. No aggregation!

Page 24: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Leaf-Level Calculations

Several scenariosWeighted aggregationsCurrency conversion

Easy to compute in DAXMuch faster than MDXDon’t require changes in the data model

Page 25: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Snapshot Based Patterns

Snapshot-based analysis patterns:WarehouseBalance AccountPortfolioInsurance Policy

Page 26: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Snapshot Table

Dim_Date

PK ID_Date

Date Year Month Day

Fact_Movements

PK ID_Movement

FK1 ID_DateFK2 ID_Product Quantity

Dim_Product

PK ID_Product

Product

Snapshot

PK ID_Snapshot

FK1 ID_DateFK2 ID_Product Quantity

Page 27: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Warehouse Data Model

Dim_Date

PK ID_Date

Date Year Month Day

Fact_Movements

PK ID_Movement

FK1 ID_DateFK2 ID_Product Quantity

Dim_Product

PK ID_Product

Product

Page 28: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

MDX Query

WITH MEMBER MEASURES.Stock AS SUM ( NULL : [Date Order].[Calendar].CURRENTMEMBER, [Measures].[Quantity] )

SELECT Stock ON 0, NON EMPTY [Product].[Product].[Product].MEMBERS * [Date Order].[Calendar].[Month].MEMBERS ON 1FROM [Movements]

Page 29: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

DAX Query

Stock :=

CALCULATE( SUM (FactMovements[OrderQuantity]), FILTER( ALL (DimTime), DimTime[TimeKey] <= MAX(DimTime[TimeKey]) ) )

Page 30: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Snapshot Based Patterns in VertiPaq

Snapshot is almost always required in Multidimensional

Typical Pattern in Dimensional ModelingSnapshot can be avoided in Tabular

Dynamic calculation at a point-in-timeSmaller memory footprint, better performance and flexibility

Page 31: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Many-to-Many Relationships

Not so bad in MultidimensionalCritical issue: size of bridge tableHard to optimizeBad usage of aggregations

Not available in Tabular as part of the data modelBut great support in DAX and VertiPaq!Amazingly fast performance

Page 32: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Tool Dimensions

Common SSAS techniqueOne tool dimensions modifies calculationsFrequently used for the time dimensionTechnique based on

[Measures].CurrentMemberSCOPE statement

Features not available in DAX…Complex DAX code needed to solve it

Page 33: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Parent / Child Hierarchies

Multidimensional supports P/C hierarchiesBut they are slowThus, you naturalize them

Tabular supports only naturalized hierarchiesThey are standard hierarchiesAnd they are fast

HideMemberIf property not availableCan be created using DAXNot an easy task, but it works just fine

Page 34: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Unary Operators

Multidimensional supports unary operatorsFrequently used on P/C hierarchiesPretty slow calculations

Used on financial cubesOn pre-aggregated dataProvide a very nice user experience

No support in Tabular for unary operatorsUse DAX to implement themFormulas tend to be very complex

Page 35: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Custom Rollups

Unary operators on steroidsData driven calculations

Pretty slow, but they workAgain, on small financial cubesOr to implement currency conversion

No support in TabularData-driven cannot be implemented in DAXBut currency conversion can run faster

Page 36: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

MDX Script is not Available

Usages of MDX ScriptSimple calculationsMore complex SCOPESEntire business logic

Should you store business logic in MDX?No, reallySometimes it is necessaryAnd DAX is not the best option

Anyway, try to move business logic in ETL

Page 37: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Hierarchy Usage

Hierarchies in MultidimensionalOne of the modeling pillarsE.g. «Ratio To Parent»

Hierarchies in TabularCollection of columnNo function to handle them in DAXRatio to parent is pretty hard

Not a big issue, after allUsers will adapt to the limitation

Page 38: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Should I Migrate My Solutions?

Not necessarilyDifferent modeling options

Calculated columnsComplex Relationships in DAX

Different calculation techniquesEvaluation Contexts

Migrating means building a new project

Page 39: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

And the winner is….

Magic consultant’s answer: it dependsTabular is not the new UDM

It is one of the flavors of BISMSide by side with Multidimensional

DAX is easier to learn and to useDifferent modeling techniques

Page 40: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

FAQ and Other Tips

Should I migrate from Multidimensional to Tabular?No

I already have Multidimensional cubes and I know MDX

Continue using Multidimensional by defaultConsider Tabular for specific data marts / reports / calculations

I am new to Analysis ServicesStart with Tabular, it’s easier to learn, but check requirements first

Page 41: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

What’s the Best Choice Based on Requirements?

Choose Multidimensional:Support Translations within the data modelCalculations strongly depend on hierarchies

Consider Tabular:Several Distinct Count measures on large tablesComplex many-to-many calculations with large bridge tablesPartition a dimensionNOTE: you have to buy enough RAM

Page 42: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Call to Action for Tabular

Learn DAXSeriously, learn it!DAX is not easy, but it is simple!

Learn different modeling techniquesSpend time to get acquainted with this new kidBuild some prototypes

Don’t make a porting, build a new projectLearn to think in DAX

Page 43: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Related Content

DBI305 Developing and Managing a BI Semantic Model in Analysis Services

DBI413 Many-to-Many Relationships in BISM Tabular

DBI62-HOL Optimizing a MS SQL Server 2012 Tabular BI Semantic Model

Page 45: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Resources

Connect. Share. Discuss.

http://europe.msteched.com

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources for IT Professionals

http://microsoft.com/technet

Resources for Developers

http://microsoft.com/msdn

Page 46: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Evaluations

http://europe.msteched.com/sessions

Submit your evals online

Page 47: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS

PRESENTATION.

Page 48: BISM: Multidimensional vs. Tabular Marco Russo Senior Consultant SQLBI.

Who’s Speaking?

BI Expert and ConsultantFounder of www.sqlbi.com

Problem SolvingComplex Project AssistanceDataWarehouse Assesments and DevelopmentCourses, Trainings and Workshops

Book WriterMicrosoft Business Intelligence PartnerSSAS Maestro – MVP – MCP