brentlightsey
brentlightsey

Reputation: 2066

How to Program Business Logic into an OLAP Cube?

We are seeking to build an OLAP cube from a relational DB. But the database contains only raw data. The "domain logic" such as calcuations, conditional logic, and custom aggregations (i.e., sum up all of the rows that meet these conditions and no other row exists such that blah blah blah) is all contained in .NET code. I would like values generated by that code to be included in the cube.

Question 1: What kind of architecture do you recommend to include domain logic in a cube? I would prefer NOT to...

Keeping my business logic in .NET code keeps in easy to maintain, scale, and test.

Question 2: Is this a good architecture?

Upvotes: 0

Views: 704

Answers (2)

Boyan Penev
Boyan Penev

Reputation: 854

I would say that it depends. Typically if you can avoid building any MDX calculations and just go with the option form your second question, you will end up with a fast cube. However, MDX is usually used because business calcs are done more easily than in .NET or SQL.

In general, some calcs are better off in .NET or SQL, while others are better than in MDX. In particular, low grain calcs working with detail level data are typically faster done before they get in the cube, while others, especially ones which work with aggregates, are faster and easier in SSAS.

Having said all this, if you already have it all implemented and you can easily use what you have I would not advise the replication of the business logic in SSAS even if it works on aggregates, unless you are experiencing specific issues. If it all works fine and you only need an OLAP layer, then there is nothing wrong with consuming the results from your calculations in SSAS - this could and would speed up the cubes as there will be no calcs done at runtime.

Upvotes: 2

Adrian K
Adrian K

Reputation: 10205

I think your approach as stated in Q2 is a good start. Assuming your business logic is in the application which accesses the raw data - expose that logic as services / APIs that the ETL can use to pull out the data out - doing the relevant calculations on the fly.

Upvotes: 0

Related Questions