Getting Started with Microsoft Cosmos DB Using C# Cloud Database Support for .NET Applications

  • Kevin McDonnell

Your browser needs to be JavaScript capable to view this video

Try reloading this page, or reviewing your browser settings

You're watching a preview of subscription content. Log in to check access

This video introduces Cosmos DB and highlights the benefits that using Cosmos DB can bring to your applications and clients. Watching this video helps to increase your toolbox of knowledge around Azure and build your skills on this important cloud platform. Examples in the video are built in C#, the language from which Cosmos DB is most commonly used. A running example throughout the video demonstrates the basics of entering data, querying and updating data, deleting data, and working with the Cosmos DB change feed.

What You Will Learn

  • Understand Cosmos DB and when it should be used

  • Become familiar with the different APIs that are available

  • Create a new service in Azure in support of a Cosmos DB database

  • Develop applications locally using C# and the Table API

  • Create a database and add data to it

  • Query, update, and delete data as needed

  • React to events and streaming data with the change feed

Who This Video Is For

Developers with knowledge of C#, but who have not used Cosmos DB before and who would like to know more about it and the scenarios in which Cosmos DB is useful. For developers who have come from a relational database background and want to understand how Cosmos DB can be used differently from the relational databases to which they are accustomed.

This video introduces Cosmos DB and highlights the benefits that using Cosmos DB can bring to your applications and clients. A running example throughout the video demonstrates the basics of entering data, querying and updating data, deleting data, and working with the Cosmos DB change feed.

About The Author

Kevin McDonnell

Kevin McDonnell is a solutions architect for CPS. He is based in the UK and has spent the last 20 years working with Microsoft technologies across a variety of organizations. He has worked extensively across the Azure stack for the last five years and has built several applications using Cosmos DB for UK companies to make the most of the scale and performance available from Microsoft Azure and its Cosmos DB database platform.

 

About this video

Author(s)
Kevin McDonnell
DOI
https://doi.org/10.1007/978-1-4842-6020-3
Online ISBN
978-1-4842-6020-3
Total duration
1 hr 2 min
Publisher
Apress
Copyright information
© Kevin McDonnell 2020

Related content

Video Transcript

[MUSIC PLAYING]

Hello, and welcome to this video on getting started with Cosmos DB using C#.

You’re likely watching this as you use C# and have heard about Cosmos DB, the globally distributed, multi-modal database service that is one of the Azure services. Or you’ve been asked to use it and want to find out more. Have you wondered why you wouldn’t just use SQL or MySQL instead? Are you worried that all the SQL language you know will be wasted. This video will help guide you through an introduction to using Cosmos DB. It will highlight the key benefits that it can bring to your toolbox and knowledge around Azure while demonstrating how to use C# to interact with the data.

First, a little about me. I’ve been working with Microsoft products since I graduated back in 2002, first spending 15 years in financial services before moving to a consulting role where I’m currently with CPS, a Microsoft gold partner based in the UK, developing solutions for a wide range of different clients from county councils and charities to financial services and pharmaceuticals.

I was attracted to Cosmos DB when it’s released because of the potential for global scale and performance, allowing me to focus on the business logic instead of worrying too much about indexing and space on a database. It’s not always as perfectly simple as that, as I’ll cover in another video, but it’ll hugely reduce the amount that I need to work closely with a dedicated DBA while still handling millions of records. Let’s look into what this video will cover.

To kick off, I will cover an overview of what Cosmos DB is and the scenarios you would look to use it. One of the benefits is the multi-modal nature, where you can utilize models like MongoDB and Gremlin to fit the needs of your application. But this won’t just be a long PowerPoint presentation, and I will get into some demos of how to create the service in Azure and the options you’ll be asked about before moving on to the code and how you can work on your local dev machine.

Looking at the code, it then won’t matter for a while if you’re working locally or online against Azure as we look into how to create a database on your service, add some data to it, query it, and then show you how to update and delete that data. All this will be with a sample application that will track taxi journeys through a REST API written in ASP.NET MVC.

We’ll also cover the important leads to use the change feed before going in to understand the cost model for Cosmos. To wrap that all up, I’ll cover a summary as well as point you in the direction to find out more.