Friday, July 11, 2008

OLAP component: Mondrian+JPivot or Flex OLAPDataGrid ?

Recently I've been spending a few hours digging into OLAP cube components (a special table to analyse large and multi-dimmentionnal data in Business Intelligence). I wanted to produce a nice demo with an OLAP cube plugged to the OpenERP (by far the best open source ERP) database.

I actually saw a guy demoing such an OLAP Flex component along with Openbravo ERP (looking nice but the details were provided): http://opensourceerpguru.com/
Anyway I just wanted to achieve the same but using OpenERP (I feel much more comfortable with it's elegant and efficient architecture, not to tell about the features nor the business model) this time and eventually JRuby on Rails, my best Swiss knife to pull the data to the OLAP viewer.

So at first I've been stunned by the OLAP Flex component (called OLAPDataGrid) . It looks really nicer than the old fashion Mondrian JPivot. So I decided to give it a try. First time with Flex and back to the half open source crapp since long ago. So I had to follow all the Adobe crapp flow: create a fucking account, read all their commercial crapp, agree with their whatever license and finally download the stuff and start playing with it. Then I remarked that all my FlexBuilder nice OLAP samples were coming with a "Flex Data Vizualisation Trial" watermark. OK, time to remeber, FlexBuilder is not open source yet, so let's go with the Flex SDK, back to the Adobe legacy crapp, download again and try again (I heard that the SDK was open source, or sort of).

Then I tried to compile my mxml component with the following command line:

flex_sdk_3/bin$ ./mxmlc /home/rvalyi/DEV/olap_test/src/olap.mxml
Loading configuration file /home/rvalyi/Desktop/flex_sdk_3/frameworks/flex-config.xml
/home/rvalyi/DEV/olap_test/src/olap.mxml(162): Error: Could not resolve to a component implementation.

id="myMXMLCube"

/home/rvalyi/DEV/olap_test/src/olap.mxml(195): Error: Could not resolve to a component implementation.


WTF ???

Googled the error message and got the official answer from an Adobe employee on a forum here: http://www.codeverge.net/item.aspx?item=101509

The OLAPDatagrid component is available only in the Flex Builder Professional
version. For the first problem, the one where you are building a Flex + LCDS
2.5.1 project, the answer is that the LCDS 2.5.1 doesn't include the
OLAPDatagrid component and that is way you are getting the errors on runtime.


You f****** b*st*rds! you got me! So that how I lost a few hours trapped by the Adobe half open source policy, go hell!

Mondrian or Flex OLAPDataGrid?
Well, back to Mondrian and JPivot...

OK, for sure Mondrian and JPivot aren't really something optimal and I feel more like it's a bloated non HTTP compliant piece of code, but hey it's free and it just works. So until Tiny.be release their awesome open source "TinyBI framework" (for October?) I'll stick with it. I'll hardly try Flex and Flash again, I promise.

Finally I should say that I really don't know anyway how that Flex component would deal with a large database as it seems it's an in memory client side OLAP solution only. Even if it were to change, I'm not sure I would feel comfortable in feeding the right data pieces as the OLAP component requires them and finally all the existing samples don't come with drill down, slicer and rotation widgets, so I'm not sure how easily one can interact with the cube.

May this post save your time.

4 comments:

Cosma said...

Hi Raphael,

just a note: the Adobe OLAP solution, bundled with the non-free FlexBuilder professional, is made up of different pieces:

1) an olap engine that runs in the Flash virtual machine, that allows you to define measures (facts) and dimension and create a in-memory aggregated cube.

2) a query API that allows you to query this cube in a programmatic way (non-mdx).

3) a visualization component, the OLAPDataGrid, that you can use to display the result of an olap query.

The component are designed to be interchangeable pieces, so you can use your server-side implementation of the olap engine, wrap the results in objects that implements the flex olap API and feed it to the OLAPDataGrid for visualization, or you can use the provided engine but design your own visualization component.

This said, I must admit that performance won't allow you to create cubes using datasets larger then some thousands rows with the built-in engine (number of dimensions and measures will also affect this limit), and the display component (OLAPDataGrid) suffers very much when you put too much elements "ON COLUMNS", while it performs pretty well with high row count - probably because it extends directly from a plain data grid component, and is very optimized just for "vertical" sets.

Anyway, I think Flex as a whole is a great product and a joy to work with :)

Regards,
Cosma

Craig Petty said...

Yes, JPivot is ugly. The Flex component looks better, but it does the aggregation in the client.

My jaw dropped a couple of weeks ago when I ran across openi. After watching their demo, I was so excited about that I installed Mondrian and openi. Pretty painless (if anything involving Mondrian could be called painless).

In any case, google openi and try the demo at their site. Its open source.

Prashant said...

Is there any way to call Mondrian in Flex . In one sample I have seen fc:XMLAService and fc:ASCUBE , do you any idea about it .Please help me

vgt said...

Hey Raphael,
I have somehow missed your post and lost considerable amount of my time and hardwork on what you rightly called as "half open source" Adobe stuff. I too promise never look at that glaring stuff unless somebody ready to shell out license costs upfront :-)
Appreciations for your efforts,
Thanks,
Vijay Thatte