• Complain

Christian Amor Kvalheim - The Little Mongo DB Schema Design Book

Here you can read online Christian Amor Kvalheim - The Little Mongo DB Schema Design Book full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2015, publisher: CreateSpace Independent Publishing Platform, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Christian Amor Kvalheim The Little Mongo DB Schema Design Book
  • Book:
    The Little Mongo DB Schema Design Book
  • Author:
  • Publisher:
    CreateSpace Independent Publishing Platform
  • Genre:
  • Year:
    2015
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

The Little Mongo DB Schema Design Book: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "The Little Mongo DB Schema Design Book" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

The Little MongoDB Schema Design Book, covers the fundamentals off Schema design with MongoDB, as well as several useful Schema design patters for your applications.

I wrote this book to be a helpful and concise guide to MongoDB Schema design, as well as a repository to look up specific MongoDB Schema patterns. This book came around, due to my experiences teaching people about using MongoDB for application development. It tries to cover essential information that you can apply to your own applications.

We cover a lot of different aspects of Schema Design in this book. These include.

  • Schema Basics including one to one, one to many and many to many relationships
  • Embedding versus linking
  • Bucketing Strategy
  • Understanding the MongoDB MMAP and WiredTiger storage engine
  • MongoDB Indexes
  • The Metadata Schema Pattern
  • Time Series Schema Pattern
  • Queues Schema Pattern
  • Nested Categories Schema Pattern
  • Account Transactions Schema Pattern
  • Shopping Cart Schema Pattern with and without product reservation
  • A Theater Ticket Reservation Schema Pattern
  • An Embedded Array Cache Schema Pattern
  • An Internationalization Schema Pattern
  • Sharding

The book aims to provide developers with a deep but concise understanding of how to efficiently work with MongoDB.

Christian Amor Kvalheim: author's other books


Who wrote The Little Mongo DB Schema Design Book? Find out the surname, the name of the author of the book and a list of all author's works by series.

The Little Mongo DB Schema Design Book — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "The Little Mongo DB Schema Design Book" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
The Little Mongo DB Schema Design Book
Christian Kvalheim

This book is for sale at http://leanpub.com/mongodbschemadesign

This version was published on 2015-10-09

This is a Leanpub book Leanpub empowers authors and publishers with - photo 1

* * * * *

This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.

* * * * *

2014 - 2015 Christian Kvalheim

ISBN for EPUB version: 978-1-943846-77-1

ISBN for MOBI version: 978-1-943846-77-1

Table of Contents
Guide
Introduction

One of the questions that comes up very often from new users of MongoDB and document databases is how to do schema design. The concepts of embedding and linking documents combined with many years of working with relational models means there is a learning process involved in moving to a document database.

As the product has matured over time, some patterns of schema design have emerged. This book is an attempt to distill that knowledge into actionable information you can use for your own applications.

We will cover basics of MongoDB schema design, how MongoDB works under the covers and look at a series of schema design patterns that aim to solve specific issues that you might run into while working on your application.

That said, this is not the end all of schema design for MongoDB. If you come up with other brilliant schema design patterns feel free to drop me an email at christkv@gmail.com or send me a tweet to@christkv

I hope you enjoy the book and find the information useful.

Christian Amor Kvalheim

Schema Basics

Before exploring the more advanced schemas in this book its important to revisit schema basics. In this chapter we will explore the basic relationships from traditional relational databases and how they relate to the document model in MongoDB.

We will start with a look at the One-To-One (1:1) relationship then moving on to the One-To-Many (1:N) and finally the Many-To-Many (N:M).

One-To-One (1:1)

The 1:1 relationship describes a relationship between two entities. In this case the Author has a single Address relationship where an Author lives at a single Address and an Address only contains a single Author.

A One to One Relational ExampleThe 11 relationship can be modeled in two ways - photo 2A One to One Relational Example

The 1:1 relationship can be modeled in two ways using MongoDB. The first is to embed the relationship as a document, the second is as a link to a document in a separate collection. Lets look at both ways of modeling the one to one relationship using the following two documents:

Model
An example User document
1{2name:"Peter Wilkinson",3age:274}
An example Address document
1{2street:"100 some road",3city:"Nevermore"4}
Embedding

The first approach is simply to embed the Address document as an embedded document in the User document.

An example User document with Embedded Address
1{2name:"Peter Wilkinson",3age:27,4address:{5street:"100 some road",6city:"Nevermore"7}8}

The strength of embedding the Address document directly in the User document is that we can retrieve the user and its addresses in a single read operation versus having to first read the user document and then the address documents for that specific user. Since addresses have a strong affinity to the user document the embedding makes sense here.

Linking

The second approach is to link the address and user document using a foreign key.

An example User document
1{2_id:1,3name:"Peter Wilkinson",4age:275}
An example Address document with Foreign Key
1{2user_id:1,3street:"100 some road",4city:"Nevermore"5}

This is similar to how traditional relational databases would store the data. It is important to note that MongoDB does not enforce any foreign key constraints so the relation only exists as part of the application level schema.

Embedding Preferred

In the one to one relationship Embedding is the preferred way to model the relationship as its more efficient to retrieve the document.

One-To-Many (1:N)

The 1:N relationship describes a relationship where one side can have more than one relationship while the reverse relationship can only be single sided. An example is a Blog where a blog might have many Comments but a Comment is only related to a single Blog.

A One to Many Relational ExampleThe 1N relationship can be modeled in several - photo 3A One to Many Relational Example

The 1:N relationship can be modeled in several different ways using MongoDB. In this chapter we will explore three different ways of modeling the 1:N relationship. The first is embedding, the second is linking and the third is a bucketing strategy that is useful for cases like time series. Lets use the model of a Blog Post and its Comments.

Model
An example Blog Post document
1{2title:"An awesome blog",3url:"http://awesomeblog.com",4text:"This is an awesome blog we have just started"5}

A Blog Post is a single document that describes one specific blog post.

Some example Comment documents
1{2name:"Peter Critic",3created_on:ISODate("2014-01-01T10:01:22Z"),4comment:"Awesome blog post"5}67
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «The Little Mongo DB Schema Design Book»

Look at similar books to The Little Mongo DB Schema Design Book. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «The Little Mongo DB Schema Design Book»

Discussion, reviews of the book The Little Mongo DB Schema Design Book and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.