Free Sample
+ Collection

RavenDB 2.x Beginner’s Guide

Beginner's Guide
Khaled Tannir

For .NET developers who want to acquire document-oriented database skills, there is no better introduction to RavenDB than this book. It covers all the bases in a user-friendly style that makes learning fast and easy.
$29.99
$49.99
RRP $29.99
RRP $49.99
eBook
Print + eBook

Want this title & more?

$16.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781783283798
Paperback356 pages

About This Book

  • Build high performance NoSQL .NET based applications with step-by-step practical examples
  • Master advanced RavenDB indexes and queries
  • Create objects in .NET and map them to RavenDB

 

Who This Book Is For

If you are a .NET developer, new to document-oriented databases, and you wish to learn how to build applications using NoSQL databases, then this book is for you. Experience with relational database systems will be helpful, but not necessary.

Table of Contents

Chapter 1: Getting Started with RavenDB
Understanding the basics of NoSQL Databases
What is RavenDB?
From relational databases to RavenDB
Why RavenDB?
How RavenDB works?
Anatomy of a Document
The JSON format
Downloading and installing RavenDB
Time for action – downloading and installing RavenDB
Running RavenDB server in the Console mode
Time for action – exploring the Start.cmd file
Time for action – launching RavenDB in the Console mode
Time for action – creating a new database and adding sample data
Time for action – shutting down RavenDB
Summary
Chapter 2: RavenDB Management Studio
Introducing the RavenDB Management Studio
Management Studio's multi-databases feature
Time for action – creating a new database
Management Studio's Documents screen
Time for action – creating your first document
Time for action – loading a document
Time for action – searching for a document
Time for action – exporting documents to a CSV file
Time for action – adding a custom metadata key
Management Studio's Collections screen
Time for action – modifying a document
Management Studio's Indexes screen
Time for action – creating an Index
Time for action – querying an Index
Time for action – editing an Index
Time for action – querying an Index
Time for action – creating a Dynamic Query
Management Studio's Patch screen
Time for action – patching a document
Management Studio's Tasks screen
Time for action – importing external data using a CSV file
Management Studio's Alerts screen
Management Studio's Logs screen
Time for action – exploring the Logs screen
Viewing the database settings
Time for action – viewing the database's active bundles
Time for action – opening the System database's Settings page
Bundles
Time for action – enabling the Periodic Backup feature
Doing more with the Management Studio
Time for action – customizing the columns
Time for action – copying the data document to the clipboard
Time for action – deleting a database using the Management Studio
Summary
Chapter 3: RavenDB.NET Client API
The RavenDB .NET Client API
Setting up your development environment
Time for action – installing NuGet Package Manager
Creating a simple application
Time for action – adding RavenDB Client to a Visual Studio project
Connecting to RavenDB
Time for action – connecting to RavenDB
Loading a document
Time for action – loading a document
Inserting a new Document
Time for action – inserting a new document
Updating a document
Time for action – updating a document
Deleting a document
Time for action – deleting a document
Querying a documents collection
Time for action – querying a documents collection
Summary
Chapter 4: RavenDB Indexes and Queries
The RavenDB indexes
RavenDB Map/Reduce implementation
RavenDB dynamic indexes
Time for action – querying a dynamic index
Time for action – querying a temporary index
Time for action – managing temporary indexes
RavenDB static indexes
Time for action – defining a Map function for an index
Time for action – adding a Reduce function to an index
Time for action – adding a TransformResults to the index
RavenDB stale indexes
Time for action – checking for stale index results
Time for action – explicitly waiting for a non-stale index result
Summary
Chapter 5: Advanced RavenDB Indexes and Queries
The RavenDB AbstractIndexCreationTask class
Creating indexes using the AbstractIndexCreationTask class
Time for action – creating indexes using AbstractIndexCreationTask class
Time for action – creating indexes using the ResultReduce class
Time for action – using the TransformResults function
Creating multimap indexes
Time for action – creating multimap indexes
Full-text and exact matching search
Time for action – creating a full-text searching index
Time for action – creating multifields searching index
Time for action – using a custom analyzer
Paging a query's results
Time for action – paging a query's results
Summary
Chapter 6: Advanced RavenDB Document Capabilities
RavenDB attachments
Time for action – using attachments to store images
Time for action – retrieving stored attachments
Time for action – retrieving and updating anattachment's metadata
Handling documents relationships
Time for action – using Include to reduce query calls
Time for action – indexing related documents
Patching documents
Time for action – applying a ScriptedPatchRequest
Time for action – using PatchRequest to add a new field to a document
Summary
Chapter 7: RavenDB Administration
RavenDB configuration options
Time for action – optimizing RavenDB performances
Backing up RavenDB databases
Time for action – backing up the World database
Time for action – backing up the World database using Management Studio
Restoring RavenDB databases
Time for action – restoring the World database using the command line
Time for action – restoring the World database using Management Studio
Exporting and importing RavenDB databases
Time for action – exporting the World database using Smuggler
Time for action – importing the World database using Smuggler
RavenDB server bundles
Time for action – creating a master to slave database replication
Time for action – replicating to Microsoft SQL Express
Time for action – authenticating and authorizing
Enabling RavenDB logging
Time for action – enabling RavenDB logging
Upgrading the RavenDB server
Time for action – upgrading the RavenDB server
Summary
Chapter 8: Deploying RavenDB
RavenDB deployment strategies
Running RavenDB as a Windows Service
Time for action – running RavenDB as a Windows Service
Time for action – uninstalling the RavenDB service
RavenDB and IIS
Time for action – running RavenDB from an IIS virtual directory
Time for action – running RavenDB as an IIS application
RavenDB Embedded mode
Time for action – running RavenDB in Embedded mode
Time for action – running RavenDB inmemory
Summary
Chapter 9: Scaling-out RavenDB
What is scaling-out?
RavenDB sharding
Time for action – preparing RavenDB for sharding
Time for action – implementing RavenDB sharding (the blind mode)
Time for action – implementing RavenDB sharding (the smart mode)
Mixing sharding and replication
Summary
Chapter 10: RavenDB Profiling
What is profiling?
Time for action – enabling the RavenDB profiler
Time for action – running the RavenDB visual host
RavenDB workload simulator/stress tests
Summary
Chapter 11: RavenDB HTTP API
The RavenDB HTTP API
Understanding REST
Anatomy of the RavenDB REST request URL
The RESTClient tool
Time for action – downloading and launching the RESTClient tool
The GET request
Time for action – performing a GET request
The PUT request
Time for action – granting access to perform a PUT request
Time for action – performing a PUT request
The POST request
Time for action – performing a POST request
The PATCH request
Time for action – performing a Patch request
The DELETE request
Time for action – performing a Delete request
Getting multiple documents with a single request
Time for action – getting multiple documents within a single request
Querying an Index
Time for action – querying an Index
Summary
Chapter 12: Putting It All Together
A word about ASP.NET MVC
Application architecture key concepts
Creating an ASP.NET MVC 4 project with RavenDB
Time for action – creating the World ASP.NET MVC application
Time for action – adding the World application's Models
Time for action – adding the Controllers
Time for action – adding the Views
Time for action – launching the World application
Doing more with the World application
Time for action – creating indexes automatically
Time for action – the paging query <Country>() result
Time for action – creating the Country master/details View
Time for action – implementing the Search view
Summary
Chapter 13: Pop Quiz Answers
Chapter 3, RavenDB.NET Client API
Chapter 4, RavenDB Indexes and Queries
Chapter 5, Advanced RavenDB Indexes and Queries
Chapter 7, RavenDB Administration
Chapter 9, Scaling-out RavenDB
Chapter 11, RavenDB HTTP API

What You Will Learn

  • Get RavenDB up and running on your local machine or server, and discover the RavenDB Management Studio
  • Interact with RavenDB using the .NET Client API and REST HTTP API
  • Map .NET objects to RavenDB documents
  • Create and query dynamic indexes, and single-map and multi-map static indexes
  • Implement map/reduce to process large datasets
  • Learn and implement paging, exact matching, and full-text search queries
  • Host RavenDB within IIS and run it as a Windows service or in embedded mode
  • Secure RavenDB using a replication bundle and optimize it with sharding

 

In Detail

RavenDB is a second generation document database written in .NET, offering a flexible data model designed to address requirements coming from real-world systems. It is different from the other document databases around, as with RavenDB you can get up and running in a few minutes, and that includes grasping all the basics. It allows you to build high-performance, low-latency applications with ease and efficiency.

RavenDB 2.x Beginner’s Guide introduces RavenDB concepts and teaches you everything, right from installing RavenDB, to creating documents, and querying indexes. This book will help you take advantage of powerful, document-oriented NoSQL databases and build a solid foundation on which you can create your .NET applications.

This book presents RavenDB, the .NET document-oriented NoSQL database, through a series of clear and practical exercises that will help you to take advantage of this database server.

The book starts off with an introduction to RavenDB and its Management Studio. You will then move ahead and learn how to quickly and efficiently build high performance, NoSQL document-oriented .NET applications using the .NET client API or the HTTP REST API. Next, Dynamic and static indexes that use map/reduce to process datasets are covered. You will then see how to create and query these indexes, with the help of detailed examples. You will also learn how to deploy your RavenDB server in a production environment and how to optimize and secure it.

With numerous practical examples, RavenDB 2.x Beginner’s Guide teaches you everything you need to know for building high performance .NET document-oriented NoSQL databases.

Authors

Read More