Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Seven NoSQL Databases in a Week
Seven NoSQL Databases in a Week

Seven NoSQL Databases in a Week: Get up and running with the fundamentals and functionalities of seven of the most popular NoSQL databases

Arrow left icon
Profile Icon Sudarshan Kadambi Profile Icon Xun (Brian) Wu
Arrow right icon
€15.99 €23.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5 (6 Ratings)
eBook Mar 2018 308 pages 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Sudarshan Kadambi Profile Icon Xun (Brian) Wu
Arrow right icon
€15.99 €23.99
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5 (6 Ratings)
eBook Mar 2018 308 pages 1st Edition
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Seven NoSQL Databases in a Week

MongoDB

MongoDB is an open source, document-oriented, and cross-platform database. It is primarily written in C++. It is also the leading NoSQL database and tied with the SQL database in fifth position after PostgreSQL. It provides high performance, high availability, and easy scalability. MongoDB uses JSON-like documents with schema. MongoDB, developed by MongoDB Inc., is free to use. It is published under a combination of the GNU Affero General Public License and the Apache License.

Let's go through the MongoDB features:

  • Rich query support: We can query the database as we do with SQL databases. It has a large query set that supports insert, update, delete and select operations. MongoDB supports fields, range queries, and regular expressions. Queries also support the projection where they return a value for specific keys.
  • Indexing: MongoDB supports primary and secondary...

Installing of MongoDB

You can download the latest version of MongoDB here: https://www.mongodb.com/download-center#community. Follow the setup instructions to install it.

Once MongoDB is installed on your Windows PC, you have to create the following directory:

Data directory C:\data\db  

Once you have successfully installed MongoDB, you will be able to see the following executable:

We have to start the mongod instances to begin working with MongoDB. To start the mongod instance, execute it from the command prompt, as shown in the following screenshot:

Once mongod has started, we have to connect this instance using the mongo client with the mongo executable:

Once we are connected to the database, we can start working on the database operations.

MongoDB data types

Documents in MongoDB are JSON-like objects. JSON is a simple representation of data. It supports the following data types:

  • null: The null data type is used to represent the null value as well as a value that does not exist:
  • boolean: The boolean type is used to represent true and false values:
  • number: In MongoDB, the shell default supports 64-bit floating-point numbers. To process long and integer numbers, MongoDB provides NumberLong and NumberInt, which represent 4 bytes and 8 bytes, respectively.
  • string: The string data type represents the collection of characters. The MongoDB default supports UTF-* character encoding:
  • date: MongoDB stores dates in milliseconds since the epoch. The time zone information is not saved:
  • After inserting a date using the preceding way in the document, when we query using find it returns a document with...

Data models in MongoDB

The MongoDB collection does not enforce structure on the document. This allows the document to map to objects or entities easily. Each document can match a data field of the entity. In practice, documents in collections share the same structure.

When deciding on data modeling, we have to consider the requirements of the application, the performance characteristics of the database's design, and data retrieval patterns. When designing data models, we have to focus on the application's usage of data and the inherent structure of the data.

While deciding the data model, we have to consider the structure of the document and how documents relate to each other. There are two key data models that show these relationships:

  • The reference document data model
  • The embedded data model
...

Introduction to MongoDB indexing

Indexes allow efficient execution of MongoDB queries. If we don't have indexes, MongoDB has to scan all the documents in the collection to select those documents that match the criteria. If proper indexing is used, MongoDB can limit the scanning of documents and select documents efficiently. Indexes are a special data structure that store some field values of documents in an easy-to-traverse way.

Indexes store the values of specific fields or sets of fields, ordered by the values of fields. The ordering of field values allows us to apply effective algorithms of traversing, such as the mid-search algorithm, and also supports range-based operations effectively. In addition, MongoDB can return sorted results easily.

Indexes in MongoDB are the same as indexes in other database systems. MongoDB defines indexes at the collection level and supports...

Replication

A replica set is a group of MongoDB instances that store the same set of data. Replicas are basically used in production to ensure a high availability of data.

Redundancy and data availability: because of replication, we have redundant data across the MongoDB instances. We are using replication to provide a high availability of data to the application. If one instance of MongoDB is unavailable, we can serve data from another instance. Replication also increases the read capacity of applications as reading operations can be sent to different servers and retrieve data faster. By maintaining data on different servers, we can increase the locality of data and increase the availability of data for distributed applications. We can use the replica copy for backup, reporting, as well as disaster recovery.

...

Sharding

Sharding is a methodology to distribute data across multiple machines. Sharding is basically used for deployment with a large dataset and high throughput operations. The single database cannot handle a database with large datasets as it requires larger storage, and bulk query operations can use most of the CPU cycles, which slows down processing. For such scenarios, we need more powerful systems.

One approach is to add more capacity to a single server, such as adding more memory and processing units or adding more RAM on the single server, this is also called vertical scaling. Another approach is to divide a large dataset across multiple systems and serve a data application to query data from multiple servers. This approach is called horizontal scaling. MongoDB handles horizontal scaling through sharding.

...

Installing of MongoDB


You can download the latest version of MongoDB here: https://www.mongodb.com/download-center#community. Follow the setup instructions to install it.

Once MongoDB is installed on your Windows PC, you have to create the following directory:

Data directory C:\data\db

Once you have successfully installed MongoDB, you will be able to see the following executable:

We have to start the mongod instances to begin working with MongoDB. To start the mongod instance, execute it from the command prompt, as shown in the following screenshot:

Once mongod has started, we have to connect this instance using the mongo client with the mongo executable:

Once we are connected to the database, we can start working on the database operations.

MongoDB data types


Documents in MongoDB are JSON-like objects. JSON is a simple representation of data. It supports the following data types:

  • null: The null data type is used to represent the null value as well as a value that does not exist:
  • boolean: The boolean type is used to represent true and false values:
  • number: In MongoDB, the shell default supports 64-bit floating-point numbers. To process long and integer numbers, MongoDB provides NumberLong and NumberInt, which represent 4 bytes and 8 bytes, respectively.
  • string: The string data type represents the collection of characters. The MongoDB default supports UTF-* character encoding:
  • date: MongoDB stores dates in milliseconds since the epoch. The time zone information is not saved:
  • After inserting a date using the preceding way in the document, when we query using find it returns a document with a date in the following format:

  • array: A set or list of values represents arrays. Also, multiple JSON objects represent an array of elements. The...
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Covers the basics of 7 NoSQL databases and how they are used in the enterprises
  • Quick introduction to MongoDB, DynamoDB, Redis, Cassandra, Neo4j, InfluxDB, and HBase
  • Includes effective techniques for database querying and management

Description

This is the golden age of open source NoSQL databases. With enterprises having to work with large amounts of unstructured data and moving away from expensive monolithic architecture, the adoption of NoSQL databases is rapidly increasing. Being familiar with the popular NoSQL databases and knowing how to use them is a must for budding DBAs and developers. This book introduces you to the different types of NoSQL databases and gets you started with seven of the most popular NoSQL databases used by enterprises today. We start off with a brief overview of what NoSQL databases are, followed by an explanation of why and when to use them. The book then covers the seven most popular databases in each of these categories: MongoDB, Amazon DynamoDB, Redis, HBase, Cassandra, In?uxDB, and Neo4j. The book doesn't go into too much detail about each database but teaches you enough to get started with them. By the end of this book, you will have a thorough understanding of the different NoSQL databases and their functionalities, empowering you to select and use the right database according to your needs.

Who is this book for?

If you are a budding DBA or a developer who wants to get started with the fundamentals of NoSQL databases, this book is for you. Relational DBAs who want to get insights into the various offerings of popular NoSQL databases will also find this book to be very useful.

What you will learn

  • Understand how MongoDB provides high-performance, high-availability, and automatic scaling
  • Interact with your Neo4j instances via database queries, Python scripts, and Java application code
  • Get familiar with common querying and programming methods to interact with Redis
  • Study the different types of problems Cassandra can solve
  • Work with HBase components to support common operations such as creating tables and reading/writing data
  • Discover data models and work with CRUD operations using DynamoDB
  • Discover what makes In?uxDB a great choice for working with
  • time-series data

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 29, 2018
Length: 308 pages
Edition : 1st
Language : English
ISBN-13 : 9781787127142
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Mar 29, 2018
Length: 308 pages
Edition : 1st
Language : English
ISBN-13 : 9781787127142
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 104.97
MySQL 8 Cookbook
€41.99
Seven NoSQL Databases in a Week
€29.99
Mastering PostgreSQL 10
€32.99
Total 104.97 Stars icon

Table of Contents

9 Chapters
Introduction to NoSQL Databases Chevron down icon Chevron up icon
MongoDB Chevron down icon Chevron up icon
Neo4j Chevron down icon Chevron up icon
Redis Chevron down icon Chevron up icon
Cassandra Chevron down icon Chevron up icon
HBase Chevron down icon Chevron up icon
DynamoDB Chevron down icon Chevron up icon
InfluxDB Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.5
(6 Ratings)
5 star 50%
4 star 0%
3 star 0%
2 star 50%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Nov 11, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
this expalins better understanding of nosql databases Mongo,cassandra.redis and Neo4j. all in one book will help started to choose which data base needs to be selected for what purpose.
Amazon Verified review Amazon
J. B. Barnes May 26, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have read several NoSQL books available for Amazon Kindle over the past week. This is far and away the most useful if you are researching which of the over 350 available NoSQL servers is right for you. Rather than speaking in generalities and only lightly touching specific products, the authors have decided to select seven popular and capable DB servers and go into great detail, giving you a real feel for how each one operates and where it excels and comes up short.One problem I have found with many NoSQL books is that the Kindle formatting is poor (with hundreds of times words are crammed together or extraneous spaces make reading a chore) or English is not the author's first language and he did not avail himself of a good editor. This book has multiple authors and the result is consistently polished. I did, however, find a few errors. This is to be expected from a brand new book (only two months old) and the errors were easily recognized. For example, in the MongoDB chapter, there are discrepancies between the discussion and actual query, where they don't agree on whether a person's age is being tested for 29 years or 30 years. In the DynamoDB chapter, valid characters are given for a string and I believe they included A-Z and z-z. Easy to catch and not a hindrance to understanding what they meant to say. Also, almost all the other NoSQL books I found were several years old. That's WAY too old for a subject as dynamic and quickly progressing as NoSQL.This book did an excellent job of detailing where specific DBs excel and fall short. After reading the various chapters, I was able to easily rule out a few of them (like the generally solid Cassandra) and hone in on what so far appears to be the best choice for the log data I intend to store: InfluxDB. I gained great respect for one I have heard a lot about, Redis, but learned that it is designed to keep all data in memory rather than on disk. This makes it an excellent choice for something like a web caching DB, but unusable for a database the size I will need. The book also confirmed that Amazon's DynamoDB would also be an acceptable choice for me, but would require more work on my part to make it do the job.For each of the seven DBs, the authors generally walk through installation and configuration, as well as database setup and queries. I thought this was best handled in the chapters on MongoDB and DynamoDB, as they went into more detail using examples of exactly how to write useful queries. So I new exactly what my queries would look like for each product. Where applicable, they included a lot of detail on data replication, fault tolerance, and discussed how these DBs work across multiple servers.A great book on what is a mysterious subject for many. I recommend starting with this book once you have done your initial research on NoSQL and understand the concepts. Once you are ready for solid DB suggestions, you can't beat this book.
Amazon Verified review Amazon
Amazon Customer May 22, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Yes, this book is very helpful. From experts to novices everyone can have this book as a quick reference.
Amazon Verified review Amazon
Shadab K. Feb 21, 2020
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
This book is only a decent overview of 7 NoSql DBs, certainly not worth 1700 odd bucks.
Amazon Verified review Amazon
Uwe Jun 04, 2019
Full star icon Full star icon Empty star icon Empty star icon Empty star icon 2
Mehrfach fällt mir Folgendes bei Büchern von PACKT auf:* Viele Giiederungsüberschriften, deren Größe bereits viel Papier füllt.* Schlecht redigierter Text, teilweise haben Textblöcke keinen Bezug zueinander.* Sehr teuer im Vergleich zum Inhalt.Leider fügt sich auch dieses Buch in diese Reihe. Die Abschnitte werfen mehr Fragen auf, als sie Probleme lösen. Selbst als Nachschlagewerk sind die Kapitel zu dürftig.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.