2 Your first RavenDB application

 

In Chapter 1 we introduced RavenDB and the basic concepts required for working with it. We also learned about the basic building blocks required for writing a .NET application that uses RavenDB as its backing store – the DocumentStore and DocumentSession objects.

Now it is time to take off. In this chapter we are going to build our first RavenDB-driven application: an ASP.NET MVC 4 bookstore. It is going to be a rather simplistic version of a bookstore, which means we will only be implementing some basic screens for viewing and editing the store catalog. Although simplistic, it is going to be a fully working application which we can use to demonstrate how to build an application using RavenDB.

No ASP.NET MVC knowledge required!

You should be able to follow this chapter also if you are not familiar with ASP.NET MVC at all. While we will not be stumbling upon MVC concepts, or learn how to use it, and I will assume that you have some familiarity with ASP.NET MVC – this chapter intends to teach actual usage of RavenDB and just uses ASP.NET MVC as a context.

Only because ASP.NET MVC is the most commonly used technology for building web applications with .NET, we are going to use it in this chapter; however, you should be able understand the RavenDB concepts taught in the chapter without any MVC knowledge.

2.1   The Raven Bookstore

2.1.1   Planning the Model

2.1.2   Setting up

2.1.3   Session Management

2.2   Basic operations

2.2.1   Listing all books in the system

2.2.2   Adding new books

2.2.3   Viewing an existing book

2.2.4   Editing existing books

2.2.5   Deleting a book

2.3   Querying

2.3.1   Paging

2.3.2   Sorting results

2.3.3   Query statistics

2.3.4   Filtering

2.4   Deployment and Testing

2.4.1   Deployment options

2.4.2   Testing

2.4.3   Handling Model changes

2.5   Summary