[MUSIC].
>> Hey everyone. My name is Meredith Moore
and I'm a PM on the Azure Cosmos DB team.
In this session, we'll be discussing
Azure Cosmos DB for NoSQL API,
formerly the SQL API.
I'll highlight some of the NoSQL APIs unique capabilities
before showing you how you can get
started for free and under five minutes.
If that sounds good to you,
what is Azure Cosmos DB?
Commonly it can be described as
a multi-model database service globally
distributed with SLA back speed at any scale and availability.
But for today's session we'll define it as
Microsoft's fast distributed database
supporting both NoSQL and
relational workloads at any scale. Let's dive in.
Perhaps you're wondering what I mean by NoSQL.
Well, NoSQL can be explained as
non-relational and horizontally scalable.
Let's explore this further,
starting with horizontally scalable.
Unless your workload is very small
with a low amount of data and requests,
your data will likely be stored on a number of
different physical servers or
partitions within something we call a container.
Now in Cosmos we abstract all this away.
But under the hood,
you're reading and writing data in and out of
Cosmos across a cluster of servers.
This is better known as scale out,
and it's how we achieve
horizontal scalability, enabling unlimited storage.
When you need more storage,
we just add more servers
to your cluster to give you what you need.
Additionally, when you need more throughput,
then your clusters are capable of providing,
we can add more servers and
compute to meet your throughput requirements.
The second feature to introduce is non-relational.
What does that even mean?
You probably already know that when you
work with relational databases,
you can set relational constraints between
the different types of entities in the database.
This lets you do things like set up foreign keys between
your entities and do join operations across your dataset.
Cosmos DB for NoSQL does not have relational constraints.
Why is this so?
At a high level,
it's because Cosmos is horizontally scalable and
your data will likely be spread across multiple servers,
tens, hundreds, maybe even thousands,
depending on your storage and throughput requirements.
Technically it's not a possible to enforce
relational constraints across a cluster of servers.
But doing so would have an enormous impact
on the performance and availability of your database.
Because Cosmos DB for NoSQL is designed
to provide predictable performance,
we do not provide a way to declare relational constraints.
Now is Cosmos DB for NoSQL suitable for relational workloads?
Why? Yes. If you think about it,
most of the real-world use cases we're
dealing with are more or less relational.
But because Cosmos DB for NoSQL
doesn't let you define relational constraints,
we have to use different techniques to
show how the entity types are related.
The most important thing is that this is not the
same as modeling data on a relational database.
All of the best practices for
common relational databases do not work with NoSQL,
and many of them might even be anti-patterns.
Now that you have a good understanding of
NoSQL and that it's horizontally scalable,
offering unlimited storage and throughput,
and that it's non-relational offering flexible schema,
let's get started with using Azure Cosmos DB for NoSQL.
It's incredibly easy to start for free on a single instance
and grow to any scale without changing your app.
You can try out Cosmos DB for free for 30 days without
any commitment using aka.ms/trycosmosdb,
and you'll have the option to extend or
upgrade within your trial period.
This is perfect if you just want to kick the tires of it,
maybe you have an app that you want to build
or you want to try out a hackathon project.
I'll demo for you how you can get started with
sample data in just five minutes.
As I mentioned earlier,
Cosmos DB is a multi-model database with support for MongoDB,
Apache Cassandra, Postgre SQL,
which enables open source developers to use
Postgre SQL data in Azure, Cosmos DB.
If I navigated to others,
I can select the table API for applications where in
an Azure table storage or the Gremlin Graph API.
I'm going to use the Cosmos DB for NoSQL API.
This is a document data model.
A document can be any structured datatype,
but JSON is commonly used and JSON is what supported natively.
You can also use SQL syntax to query your items.
All I need to star is to sign in with my Microsoft account.
If you don't have one,
you'll just be asked to create one right away using
an e-mail address and creating a password,
or you can sign in with your GitHub.
The whole process takes less than a minute.
No long sign-up,
no credit card, no commitment.
The account was created for me in seconds.
Now I can go and open it up in
the Azure portal where I land in Data Explorer.
This is a tool I can use to interact with my data.
Right away you can get started with some sample data,
or perhaps I prefer to connect to my database,
or maybe I want to complete one of our learning modules first.
I'm new, so I want to start with
sample data and I launch quickstart.
It's going to walk me through creating a database
and how to use Data Explorer.
Its name to my database,
it's set my throughput.
Since I'm just getting started,
it's recommending to share the throughput across
my containers I create within my database.
By selecting autoscale, it will automatically scale up
to the max request units I've set, which is 1,000.
I can change these configurations after creation.
There's a lot of helpful information about
throughput and autoscale and request units in our Cosmos DB docs.
My container is named and the partition key is set.
The partition key is the name of the property Cosmos DB will use
to decide which logical partition my data should go to.
You can think about this as an address to route your data.
Now I'm ready to get started.
Within a minute my database will be created.
Now you have a mindful moment to relax,
take a few breaths or stretch while the creation is happening.
Great. My database is ready.
I can view data under items.
I can also view them using the filter function.
Maybe I have my own data that I want to add.
This is where I can upload JSON and this is where I
can select to run a SQL query or I can use the filter function.
Remember that I said you can change the throughput configurations.
Well, here's where you can set that.
This is the thing that we're going to cut out right here.
I'll just skip to the next one.
Lastly, I can connect to my app using my connection string.
Or if I don't have an app,
I can get started with a sample app
using one of these languages here.
When I'm ready to upgrade or extend my trial,
I can do so by selecting the upgrade banner,
and I'll do that here in overview.
I'll first need to sign into
my account or create a new Azure account.
Then once I've done that and created
my Azure Cosmos DB for NoSQL account,
then I simply can find my connection string,
paste that in here and move my data over.
We can move all of your sandbox data into your production.
Now you know how to create
your own Azure Cosmos DB account with sample data in minutes.
Please do so at aka.ms/trycosmosdb.
Thank you so much and enjoy the conference.
[MUSIC]