Real-Time Cube (RTC) Aggregation – Thoughts and Code (Rx)


I’ve spent a bit of time thinking about in-memory cubes since my last posting. The net out is the following that shows a hierarchical tree holding the dimensions, coupled with leaf nodes that support the measures. Similar to WPF and the logical tree/visual tree, the in-memory cube has a dimension/aggregator tree – there can be n dimension trees within the cube. The aggregator tree leverages Rx to satisfy a number of requirements:

  1. Allow notification of updates
  2. Measure storage
  3. Support dynamic aggregations – as previously posted

I also want to to satisfy the requirements of:

  1. RTC built on top of a distributed cache
  2. RTC probably wants to leverage a database as backing storage (risk warehouse)

Which leads to this random thought process:

Given the above, from a RTC perspective I want to add measures for various dimensions, observe at various levels, and aggregate. So taking the above thoughts, I want to maybe do something like this:

            _cube = new RTC<int>(configuration);

            _cube.Add(1, new RTCLocation("region|london.desk1.book1","product|fx"));
            _cube.Add(2, new RTCLocation("region|london.desk1.book2","product|fx"));
            _cube.Add(3, new RTCLocation("region|london.desk1.book3","product|swap"));
            _cube.Add(4, new RTCLocation("region|london.desk2.book4","product|swap"));
            _cube.Add(5, new RTCLocation("region|london.desk2.book5","product|fx"));
            _cube.Add(6, new RTCLocation("region|london.desk2.book5","product|fx"));

            var resultfx = _cube.GetValues(new CubeLocation("region|london", "product|fx"));
            var resultswap = _cube.GetValues(new CubeLocation("region|london", "product|swap"));

            var q = (from fx in resultfx.Scan((value, acc) => acc + value)
                     from swap in resultswap.Scan((value, acc) => acc + value)
                     select fx + swap).Replay(1);
            q.Connect();
            q.Subscribe(val => Console.WriteLine("Total {0}", val));
About these ads

~ by mdavey on March 22, 2010.

One Response to “Real-Time Cube (RTC) Aggregation – Thoughts and Code (Rx)”

  1. [...] the measure at the intersection of several hierarchies).  Anyway, I’m not going to go into any more depth as far as the nitty-gritty of the coding is concerned, but here are a few interesting [...]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 616 other followers

%d bloggers like this: