Thursday, May 1, 2014

Modern BI

While I'm still an infant when it comes to using BI technology, being a software architect for many years has given me insight into the changing BI landscape. Facebook's Bryan Brandow explains how they opted for a more agile/exploratory model based on SQL and Tableau. Threre's a new player in town with a similar agile approach, Looker.  While weaker in visual aspects, Looker seems stronger in the modelling and reuse areas, allowing you to quickly define new reusable models based on existing data. Taking advantage of the power available in modern databases, Looker simplifies the BI stack in an appealing manner.  While we're still putting together our data warehouse, I'm very much looking forward to playing with Looker to see what it has to offer.

Wednesday, February 12, 2014

Dynamic JSON Deserialization

I recently ported some code from JsonFx to Newtonsoft's Json.Net to improve deserialization performance dramatically. JsonFx was deserializing to dynamic objects quite well, and when I tried to use Json.Net, I kept running into various problems.  The main difficulty was that it deserialized to JValue objects by default and before passing these into methods they needed to be cast or the data referenced through the .Value properties.  I wanted to just access the data directly as before without having to jump through extra hoops.  While I got close a few times, there was always some problem that kept confounding me.  I finally figured out the right incantation to deserialize to ExpandoObjects and I thought I'd share it here since I could not find this when I was searching.

JsonConvert.DeserializeObject(data, typeof(ExpandoObject), new ExpandoObjectConverter());

The following code which looks similar didn't work for me because the data didn't always represent an object.  It was sometimes a list or a primitive.

JsonConvert.DeserializeObject<ExpandoObject>(data, new ExpandoObjectConverter());