Converting the RavenDB Northwind database to a more denormalized form

In a previous blog post I demonstrated how to denormalize the RavenDB sample database and use the DenormalizedReference<T> and INamedDocument types from the RavenDB documentation to make life really sweet. That leaves us with one small problem and that is that the original sample database doesn’t work with our improved document design. With the sample database, small as it is, loading all document as a dynamic type, converting them and saving them would be easy enough but in a real database that would not be practical. So lets look at a better solution fixing the database.   Updating the database … Continue reading Converting the RavenDB Northwind database to a more denormalized form

Denormalizing data in RavenDB

One of the things with RavenDB, or NoSQL document databases in general, is that you don’t do joins to combine data. Normally you try to model the documents you store in such a way that the data you need for most common actions is stored in the document itself. That often means denormalizing data. When you first get started with document databases that feels strange, after all with relational databases we are taught to normalize data as much as possible and not repeat the same values. Where normalizing data is great for updates and minimizing the size of databases it … Continue reading Denormalizing data in RavenDB

The RAW stack and filtering movies by genre

One of the options on the movie list was a set of buttons with each movies genres. This list is nice to see what a movie is about but also rather useful to filter movies on. It turns out filtering documents on one or more tags in a collection of tags is rather easy to do using RavenDB.   Using RavenDB’s LuceneQuery RavenDB uses Lucene for it’s indexing capabilities making it very capable for querying. Originally we where using the standard RavenDB query capability but now we will switch to using the LuceneQuery(). Form the AngularJS client we can pass … Continue reading The RAW stack and filtering movies by genre

Paging data using AngularJS and RavenDB in the RAW Stack

So far loading and displaying some movies data has been pretty simple and straightforward. However something that was not immediately apparent was that not all movies in the database where shown. When opening the movies list there where just 128 movies visible and that was not all there was to show. In fact I have used the Rotten Tomatoes API to preload the database with more than 1000 movies and even though I never added a filter anywhere most of these didn’t show up. So what is going on?   RavenDB = Safe by default RavenDB really is an awesome … Continue reading Paging data using AngularJS and RavenDB in the RAW Stack

Using dependency injection with WebAPI in the RAW stack

In the previous blog post we added some unit tests that tested the WebAPI and also included the RavenDB storage behind it. As I explained the recommendation is not to use fakes or mocks but just to use the in memory variant of RavenDB during testing. However the WebAPI controller used a static RavenConfig.Store property to get to the RavenDB database. And that is the kind of hard coupling we would prefer not to have even if we don’t need to create a fake for our tests.   Adding Ninject to do our server side dependency injections There are many … Continue reading Using dependency injection with WebAPI in the RAW stack

Unit testing the WebAPI controller and RavenDB database in the RAW stack

In the previous post we added unit tests for the AngularJS code running on the client. And while these tests are important there is more to test. After all the client side code depends on a server side WebAPI controller and a RavenDB database. In this post we are going to add unit tests for those two.   To inject or not to inject dependencies Normally when one class depends on another it is best to use dependency injection to get one to use another. And the dependency is then based around interfaces so a dependency can be faked during … Continue reading Unit testing the WebAPI controller and RavenDB database in the RAW stack

Creating a basic skeleton with the RAW stack

When I start with a new stack one of the first things I always do is create a really simple app to do something sort of meaningful. So lets do that with the RAW stack.   Just as a reminder the RAW stack is a combination of RavenDB, AngularJS and WebAPI. These three technologies combined make a pretty awesome combination for a developer wanting to make smart client side web applications and is using .NET on the server.   As the demo application I will be building is all about movie reviews and rentals lets start my a very minimalistic, … Continue reading Creating a basic skeleton with the RAW stack

Introducing the RAW stack

With this post I am introducing the RAW stack. Why the RAW stack? Well it is kind of the equivalent of the MEAN stack. Not that there is anything wrong with the MEAN stack, quite the opposite, but being a .NET developer I really like to keep using .NET where it’s strengths lie and where it is suitable. Now there are plenty of places where it isn’t but C# on the server is still quite awesome.   So what is the RAW stack? Basically the RAW stack consists of three parts. RavenDB AngularJS WebAPI   Why these three? RavenDB Well … Continue reading Introducing the RAW stack

Introducing the LearningLine

Recently we have been working on something new at DevelopMentor for online teaching. I still really like teaching in the classroom and I think that this is a great environment to learn new material. But it is also a very expensive and not very scalable way of learning. It typically means being away from the office for a week at a time and that can be hard on the business and on your colleagues.   And while the classroom is a great place to learn that will do you little good if you can’t go there. So we are starting … Continue reading Introducing the LearningLine