Book description
Create scalable applications by taking advantage of NoSQL document databases on the cloud with .NET Core
Key Features
- Work with the latest available tools related to Cosmos DB
- Learn to work with the latest version of the .NET Core SDK, C# and the SQL API
- Work with a database service that doesn't require you to use an ORM and provides flexibility
Book Description
Cosmos DB is a NoSQL database service included in Azure that is continuously adding new features and has quickly become one of the most innovative services found in Azure, targeting mission-critical applications at a global scale. This book starts off by showing you the main features of Cosmos DB, their supported NoSQL data models and the foundations of its scalable and distributed architecture. You will learn to work with the latest available tools that simplify your tasks with Cosmos DB and reduce development costs, such as the Data Explorer in the Azure portal, Microsoft Azure Storage Explorer, and the Cosmos DB Emulator.
Next, move on to working with databases and document collections. We will use the tools to run schema agnostic queries against collections with the Cosmos DB SQL dialect and understand their results. Then, we will create a first version of an application that uses the latest .NET Core SDK to interact with Cosmos DB. Next, we will create a second version of the application that will take advantage of important features that the combination of C# and the .NET Core SDK provides, such as POCOs and LINQ queries. By the end of the book, you will be able to build an application that works with a Cosmos DB NoSQL document database with C#, the .NET Core SDK, LINQ, and JSON.
What you will learn
- Understand the supported NoSQL data models and the resource hierarchy
- Learn the latest tools to work with Cosmos DB accounts and collections
- Reduce your development costs by working with the Cosmos DB Emulator
- Understand request units, automatic indexing, partitioning, and billing
- Build an application with C#, Cosmos DB, .NET Core SDK, and the SQL API
- Perform asynchronous operations with databases, and documents in C#
- Work with models, and customize serialization of LINQ queries
Who this book is for
This book is for C# developers. You do not require any knowledge of Azure Cosmos DB, but familiarity with the Azure platform is expected.
Table of contents
- Title Page
- Copyright and Credits
- Packt Upsell
- Contributors
- Preface
-
Introduction to NoSQL in Cosmos DB
- Making the paradigm shift to the NoSQL way
- Learning about the main features of Cosmos DB
- Understanding the supported NoSQL data models
- Using the appropriate API for each data model
- Diving deep into the Cosmos DB resource model
- Understanding the system topology NoSQL
- Learning about the resource hierarchy for each container
- Test your knowledge
- Summary
-
Getting Started with Cosmos DB Development and NoSQL Document Databases
- Provisioning a Cosmos DB account that uses the SQL API
- Understanding URIs, read-write and read-only keys, and connection strings
- Creating a new document database with the SQL API
- Creating a new collection
- Populating a collection with documents
- Understanding automatically generated key-value pairs
- Understanding schema-agnostic features
- Working with the web-based Azure Cosmos DB Explorer
- Using Azure Storage Explorer to interact with Cosmos DB databases
- Working with the Azure Cosmos DB Emulator
- Test your knowledge
- Summary
-
Writing and Running Queries on NoSQL Document Databases
- Running queries against a collection with different tools
- Understanding query results in JSON arrays
- Checking the request units spent by a query
- Working with schema-agnostic queries
- Using built-in array functions
- Working with joins
- Using array iteration
- Working with aggregate functions
- Test your knowledge
- Summary
-
Building an Application with C#, Cosmos DB, a NoSQL Document Database, and the SQL API
- Understanding the requirements for the first version of an application
- Understanding the main classes of the Cosmos DB SDK for .NET Core
- Creating a .NET Core 2 application to interact with Cosmos DB
- Configuring a Cosmos DB client
- Creating or retrieving a document database
- Querying and creating document collections
- Retrieving a document with an asynchronous query
- Inserting documents that represent competitions
- Calculating a cross-partition aggregate with an asynchronous query
- Reading and updating an existing document with a dynamic object
- Querying documents in multiple partitions
- Calling asynchronous methods that create and query dynamic documents
-  Test your knowledge
- Summary
-
Working with POCOs, LINQ, and a NoSQL Document Database
- Creating models and customizing serialization
- Retrieving a POCO with a LINQ asynchronous query
- Inserting POCOs
- Calculating a cross-partition aggregate with an asynchronous LINQ query
- Reading and updating an existing document with a POCO
- Querying documents in multiple partitions with LINQ
- Writing LINQ queries that perform operations on arrays
- Calling asynchronous methods that use POCOs to create and query documents
- Inspecting the SQL API queries that LINQ generates
- Test your knowledge
- Summary
-
Tuning and Managing Scalability with Cosmos DB
- Understanding request units and how they affect billing
- Dynamically adjusting throughput for a collection with the Azure portal
- Working with client-side throughput management
- Understanding rate limiting and throttling
- Tracking consumed request units with client-side code
- Understanding the options for provisioning request units
- Learning portioning strategies
- Deploying to multiple regions
- Understanding the five consistency levels
- Taking advantage of regional failover
- Understanding indexing in Cosmos DB
- Checking indexing policies for a collection with the Azure portal
- Test your knowledge
- Summary
-
Answers
- Chapter 1: Introduction to NoSQL in Cosmos DB
- Chapter 2: Getting Started with Cosmos DB Development and NoSQL Document Databases
- Chapter 3: Writing and Running Queries on NoSQL Document Databases
- Chapter 4: Building an Application with C#, Cosmos DB, a NoSQL Document Database, and the SQL API
- Chapter 5: Working with POCOs, LINQ, and a NoSQL Document Database
- Chapter 6: Tuning and Managing Scalability with Cosmos DB
- Other Books You May Enjoy
Product information
- Title: Guide to NoSQL with Azure Cosmos DB
- Author(s):
- Release date: September 2018
- Publisher(s): Packt Publishing
- ISBN: 9781789612899
You might also like
book
Cosmos DB for MongoDB Developers: Migrating to Azure Cosmos DB and Using the MongoDB API
Learn Azure Cosmos DB and its MongoDB API with hands-on samples and advanced features such as …
book
Microsoft Azure Cosmos DB Revealed: A Multi-Model Database Designed for the Cloud
Learn the main features of Azure Cosmos DB and how to use Microsoft’s multi-model database service …
book
Integrating Serverless Architecture: Using Azure Functions, Cosmos DB, and SignalR Service
Design, develop, build, and deliver an end-to-end serverless architecture by leveraging Azure services, frameworks, and tools. …
book
Mastering Azure Serverless Computing
Become an expert in implementing Azure Functions to work seamlessly with your serverless applications Key Features …