Indexes in RavenDB
Whenever you search for documents in RavenDB you are using an index. Therefore indexes are a topic you must understand to effectively use RavenDB. The algorithm behind is Map/Reduce and was explained in an earlier post.
Whenever you search for documents in RavenDB you are using an index. Therefore indexes are a topic you must understand to effectively use RavenDB. The algorithm behind is Map/Reduce and was explained in an earlier post.
Indexes are a very important part of RavenDB. Without them you couldn’t find your documents. But before I can show how they are created and used I have to explain the Map/Reduce algorithm. Map/Reduce is used for processing large amounts of data and was invented at Google. You can find many explanations and even more formulas on Map/Reduce, but I found them always hard to understand and it took me a long time to recognize the benefit of this algorithm. Therefore I try a simple (and most likely not 100% correct) explanation.
If you use RavenDB in your application you may find the one or other bottleneck. In that case the book "RavenDB High Performance" from Brian Ritchie (@brian_ritchie) may be a good read for you. It is full of practical advice about optimizing your application and getting the most out of RavenDB.
Yesterday I was at the Soft-Shake conference in Geneva to speak about RavenDB. Soft-Shake is a multi-disciplinary conference with a wide range of topics. In 9 parallel tracks you could see presentations about agile software development, functional programming, Big Data, Java, Microsoft and many more. The mixture of different technologies and languages was refreshing and I hope more conferences will adapt this pattern.
Documents are the most important part of a document oriented database like RavenDB. Without those documents you can't do anything. To know how to design them is therefore a skill you really must learn to work effectively with RavenDB.
The good news first: Most of the things you know on how to build software and model your classes can be reused. It even gets easier as soon as you no longer try to represent the world as a series of rows.
RavenDB is not only useful when you have a .Net project. When you can send a HTTP-Request you have all you need. The HTTP API provides all of the daily used commands in a web friendly way. There are however some commands that are not fully supported. Should you need them you can always fall back to the RavenDB Studio and execute them there.
The four basic operations of persistent storage are CRUD (Create, Read, Update and Delete). With those operations you can manage the full lifecycle of an object from its creation till you destroy it. In RavenDB you can use the .Net Client or the HTTP API. Today we will use C# and a Console Application to manipulate the documents.
Refactoring is a technique I often use but know I still have a lot to learn, especially when I see a presentation like Therapeutic Refactoring. So I was very excited when the organizers of the Barcelona Ruby Conference announced the pre-conference workshop "Refactoring Rails Applications" by JumpstartLab. It may sound strange to attend a refactoring workshop in such a beautiful city like Barcelona, but you should give it a try.
There are many ways to install RavenDB. Depending on your needs you can run it in the embedded mode, as a standalone server or integrate it into your ASP.Net application. When trying something new I like to start with a known working state. Therefore I recommend using the standalone installation of the RavenDB server for the first steps. Starting with RavenDB 2.5 there is an installer that helps you with the installation.
RavenDB is a very powerful and capable database that let you store documents. Over the next few weeks I will present you what I like so much about RavenDB, how you can use it and how NoSQL can change the way you think about the persistence layer.