MVC4+RavenDb Avoiding Quick Start Pitfalls


Coming from a SharePoint (library/list/caml) or SQL Server table point of view you typically construct end-user content based on normalized, or semi-normalized data formed from tables/libraries/lists of rows and columns. This is wonderful for adhoc reporting or creating new content pages from queries (or other middle tier magic programming). Once that data is “formed” you can display it directly or add to business objects having the “same shape” as the data for further processing.

A few words on this approach – data coming from a SQL store will be processed based on a query that defines its ultimate purpose. This is fine for queries that must change often, such as a reporting application, and you have no substantial processing time constraints. However, for OLTP and other system elements that tend to use the same (unchanging) queries against raw data the adhoc nature of these queries adds a layer of unnecessary processing. This processing would be avoided if the data was already stored in the same “shape” as the original query. To say this another way, if the database preserved the hierarchical relationship between data elements and stored these elements together as a single document, blob, or class you could simply choose the proper index and pull the data out in a single “highly atomic” transaction. The document would naturally map into business logic objects (or better yet – be hydrated into the actual object). This is also referred to as the NoSQL approach.

RavenDb is a database that captures data as documents. A NoSQL document database. The documents are formed by declaring classes in code and persisting those classes in its database. The concept has been around for a while – the key distinctions here are that objects are persisted using JSON syntax and directly executable by JavaScript (more or less). This means a modern web application can very easily take advantage of this style of storage and offers the programmer a virtually no impedance mismatch between the client and server – its easy to program.

MVC is a perfect technology playground for testing the waters with RavenDb. I decided to construct a sample application using MVC 4 (currently in beta). So this post is a simple quick start that emphasizes a couple of tips… this point install MVC 4 into Visual Studio 2010, Create an MVC 4 Project.

Tip 1: In NuGet (GUI version shown below) – search online using term, “RavenDb”. If you are on a development server you should choose the first option for these reasons:

  1. This is a stable version of RavenDb for use with MVC4 (as far as I can tell so far). Later (unstable) versions of RavenDb throw JSON exceptions (in my experience). I had to uninstall the later versions and add this one into my project. Lesson learned.
  2. Unless you’re building a true embedded version of your application – which is certainly possible – you would likely use a hosting providers RavenDb database instance provided via a unique port number (in my case its http://dev:8080 on my development server)

Tip 2:

If you find yourself installing from the NuGet command line in Visual Studio 2010 using this command Install-Package RavenDB -Pre  you probably installed some ill-tempered version. To fix this simply issue this statement Uninstall-Package RavenDb –RemoveDependencies 

Now, go back into the GUI package manager and click install as shown in this image (the first package on the list). You are ready to configure RavebDb


Tip 2: Be sure you have an instance of the RavenDb running on its default port within your development server. This operation is completely independent of your project. To install a running instance on your development database follow these steps:

  1. Locate the downloaded package from your solutions pagages folder. I found mine located in the directory [solution name]\packages\RavenDB.1.0.701 (your version may vary)
  2. Navigate to the \server folder and execute this command
  3. Raven.Server.exe /install see this link

Verify that the service instance is started in your Windows Service administration panel


In your browser, navigate to http://localhost:8080 and see the administrative screen is functional. Also, install Silverlight (as that is used by RavenDb for the page) 


You are ready to “rock-and-roll”!

Tip 3: Back to MVC, the following link provides the essential information to “rewire” your MVC project for use with RavenDb

Once you have the MVC Controllers inheriting from the RavenDB base controller you can wire up some views for testing.

My next RavenDb post will be on working with JavaScript and Views

That’s it for now – Cheers!

PS: I will resume my tutorial on building SharePoint 2010 Service Applications soon… 


Big Data – Doing the Research

Nope, I’m not an expert here but I keep seeing this phrase “big data” thrown around (very much like the term “cloud”) and these terms are often left open to interpretation. My advice is to spend a few minutes and research these (especially if you’re a decision maker listening to market hype).
The most succinct definition of “big data” IMHO is simply this: large datasets that require substantial resources to conduct ETL/simulation/analysis in a timely fashion. That’s it.

What I think people (including myself) can get hung up on are the ancillary associations with big data such as business intelligents (BI), storage architecture/availability, and parallelism among others. All of these will factor into purchase decisions. However, ancillary associations should not be grouped together or mixed in with the basic definition of “big data”.

For example, the decision to purchase a BI solution depends on how much pre-processed information (structure) you end up with at the end of your ETL process or simulation. Lower end BI solutions may be perfectly fine in this case. Disk performance versus cost is not part of the “big data” definition as such but remains a substantial factor in evolving a workable solution (ex: comparing IO costs between solid state disks versus magnetic platters). This next link is an interesting presentation related to the pharmaceutical industry on the choice of database software. Highly recommended even if you may not agree with everything said.



Another way I see “big data” is simply how much are you willing to spend to reach your goal. It’s old school thinking but fits nicely here. The difference now is that allied technologies that handle “big data” have only recently evolved into more cost friendly solutions.

Also see

Still confused, this is a fun (and basic) video that talks about what big data is about:

Big data purchase decisions may include solutions for processing massive amounts of “social” data, examples



Background Information:

That’s it…Cheers!

2012, Year of the SPDragon


This my latest installment of SPDragon – Now with SharePoint 2010 Web Parts!!!



Media Credits:

chooyutshing via photopin cc cyndy666 via photopin cc Francesco Muratori via photopin cc tonbabydc via photopin cc Kyle Taylor, Dream It. Do It. World Tour via photopin cc Dave Morrow’s Custom Creations via photopin cc Sprengben [why not get a friend] via photopin cc Stuck in Customs via photopin cc Jakob Montrasio via photopin cc


Artist/Composer: yuanji-chen
Keywords: Chinese; Folk Electrical; China-wave

Creative Commons license: Public Domain

On Building a Custom Service Application for SharePoint 2010 – Part 9:


I added a new post to my little service application series:

You can also find the series at the following link —– at this stage I am provisioning a database for the demo service application



Will work in Office365!!

Tonight I thought I’d post my latest personal project called SPDragon – its a pure HTML version of Xaptic (my Silverlight Widget Library). Its still in early development but its going very well and I’m learning and having lots of fun.

This version of my widget library can use SPServices by Marc Anderson or the client object model, or anything JavaScript and HTML. Because this is pure HTML I can also host Silverlight widgets as well as flash – so I’m much happier now SmileI added a little background music for dramatic effect.

Let me know if you like it or want to offer some suggestions – feedback welcome



I thought I’d show you how the data is being stored in SharePoint – adding components is as simple as adding HTML and an icon to lists behind the scenes

Page Definition (trivial)


Catalog of widgets (as many as you want)


The pages behind the scenes