Hey friends! As we all know
Azure Cosmos DB is a globally
distributed database service for
building highly available
scalable and fast applications.
And here's one of the things
that I really love about it.
There's always something new to
discover my good friend Kirill
Gavrylyuk is back once again
to give me an update on two
exciting new things, something
called autopilot and -- pause for
effect -- a free tier
offering. Today on Azure
Friday.
Hey it's Azure Friday. I'm Scott
Hanselman, with Kirill Gavrylyuk. We're
talking about Cosmos. The
February update. It's 2020 or
well into the year now, and
Cosmos DB continuing to kick
butt all over the earth globally
distributed database. What is
autopilot. It's great to be
here. Scott thank you for having
us and 1st I'm going to talk
about autopilots. This is a way
to configure your container or
database in Cosmos DB to
automatically and instantly
scale throughput capacity,
depending on your needs really
so for example, and it's a
common. It's been a common
challenge where folks let's say.
I want to move among Adib
application right. We support
magpi it works. Let's say you've
tested it seems like working I
want to move.
How much are use?
Do I need to provision. I
literally have that problem
'cause. I've got an application.
My blood sugar management system
uses Mongo does a little post
every few seconds maybe a few
seconds maybe a couple of
minutes but I run reports?
And the argues that I will need
to do my regular kind of
heartbeat are going to be very
different than these massive
data analysis. Things I'm going
to do once or twice so I want to
scale up. But I have to do it.
Manually now exactly and you
don't know how much I guess.
And many, many people do it. In
fact, most people do because
it's such a It's a saying that
only Cosmos. DB Hassan so
autopilot takes this question
out of the equation you walk
into Cosmos. DB and here I have
a mongo DB API account OK. I'm
going to create a new database
as you know, and we recommend to
everyone. If you don't want to
pay too much with Cosmos. DB you
always provision throughput at
the database level right right.
So so that all your collections
share. The same capacity type
some name and.
I can now choose.
Autopilot mode, I can choose
manual mode. I can provision.
These are use if I know what I'm
talking about and I know how
much I need but I don't know
either. I don't know what I'm
talking about or or I don't know
the capacity I need. And I
choose how much what is the
limits of what I don't want to
exceed an the usual answer to
this question I look at the
pricing page. How many are user?
How much are use our OK and then
I don't want to exceed I don't
want to pay more than $50 right
ever. Just when I reach that
limits just stop and tell me
that I'm asking for too much so.
Let's say. I don't want ever
exceed $4000? What this will do
is it will always keep you at
400 or use and all these scale
up if you really need to only if
your workload really needs to
it'll scale you up immediately
and instantly scale. It down
really don't have to do anything
you don't have to do anything
change my code. Nope, well
that's right actually alright so
here I have one of the examples
where this is handy is let's
say. I want to move my data
using mongo inputs right. This
is a tool that none of us in
Microsoft ever wrote or
contributed to Mongo. DB import
an I want but it's a standard
way of ingesting smaller scale
databases smaller databases into
one and it works with Cosmos. DB
Hmong API, so here I have.
Mongga birds and I pointing it
at my account the ones that I
showed you. And I have it.
I'm giving you password secrets,
etc. And I'm say I'm pointing at
the database called provisioned
OK. My database called
provisioned is configured with
thousand or use.
Let's say I don't know what
those are user 4, but I choose
thousand. I like the number.
Maybe it's enough. Yeah, you got
$2 a day so you're good so let's
run it and see what happens and
the amount of data. We're
inserting is not that high maybe
couple 10s, maybe 20,000 records
or something like that OK.
This tool immediately starts
airing out with 16500. What does
it mean? Why is it airing out so
if you're actually getting
insert errors right now 'cause
it's trying to insert as fast as
it can exactly because it thinks
OK. This is among running on the
VM somewhere and the faster it
responds to me is the faster I'm
going to push. Oh, it doesn't
throttle. It just goes as fast
as and when Cosmos DB sends
back. Hey, you're doing, too
fast. We are sending that
response very fast.
Is it big very fast shouldn't
the mango application learn to
back off? But this manga
application was written against
Mongo DB. You can't blame it. It
was written against the mongo DB
server. And so it's kinda weird
state, maybe some of the
documents made it some didn't.
Maybe not exactly so.
And I cannot edit the code maybe
I could probably get its own
GitHub. I could teach you to
retry but why instead what I'm
going to do is I'm going to
point it at autopilot an
autopilot databases configured
with maximum 4000. I use but it
will stay at 400 unless it needs
to move up.
Right. And so now.
I'm going to point it at
autopilot? How do I know if
four thousands enough if it
goes as fast as possible?
Is there an upper limit?
There, I mean, it's the upper
limit is controlled in case of
Mongo. DB imported controlled by
how much capacity you have on
the client. Oh, I see so this is
pushing it as fast as your
laptop can for exactly exactly
and so. Let's do it, so again.
It's the same line item except
I changed instead of database
permissions. I'm pointing at
autopilot alright.
And now it's drops
and then goes again.
And it keeps going.
You don't get these scaling up
an it's as fast as your laptop
can throw it exactly just for
them just for the time being,
it scaled up and then it's
immediately skills down.
And so overtime what I'm doing
is I'm actually saving money.
I'm paying much less than 1000.
I use right because you're going
to pay a little bit, for this,
but then you'll go away. It will
be done and you're going to pay
the minimum. Then it will drop
back down to the minimum
threshold 400. And so this is
just one example in generally
good rule of thumb if you know
exactly how much I use first. If
you really understand what the
user and you know exactly you
read the documentation and you
know exactly how much are use
your application needs and you
have control over over
application then. If you know
exactly what it needs provisions
throughput is always cheaper
because you provision capacity.
Of course were given to you were
giving it to your cheaper, but
if you don't know.
Autopilot will always be.
More cost effective.
So that successfully did
30,000 or 45,000 documents
and that's working correctly
and it's right here.
And do people just have that now
that's in preview, but people
can go and just find that when
they already have a Mongo,
Indiana. Mongo instance already
have a Cosmos instance, perhaps
using mongo, they can go and do
that right away. And it's It's
available, the only reason it's
preview right now. We only
supported for new collections
and databases by the time we GA
will enable it to existing
collections or existence as
well. I see we're still working
on you can see saw we only have
a few set of Max or use
available. This will by the
time. This episode airs will
support arbitrary setting. How
much Max or use you can do will
add a lot more bells and
whistles, you can potentially
auto increase Max just with some
delay. I have to bring hardware
right right you can do lots of
things, but it's instant. If you
set auto pilot. You will never
see 429 unless you exceed that
Max Absolute, Massachusetts. The
429 client excuse errors. Yeah,
that's why we call it autopilot.
It is not like out of scaling
VMS autoscaling sites. There is
no delay. We're not looking at
any metrics. We're handling it
right ones request comes in
right with a VM or an Azure app
service. It reaches a threshold.
There's a threshold that has
been passed, and then there's a
moment and then it goes, and
scales up or scales out and it's
like could be seconds could be a
minute. You don't know depending
on what you're using exactly so
autopilot is not auto scale is
better. It's instant. That's why
OK so that solves the problem
for me. That's good to know
another problem that I've had is
I love Cosmos, but for little
stuff for my little project here
like I just. I know that it's
$24.00 a month, which is great
for enterprises. I don't have
$24.00 a month. For every little
toy website that I'm making how
can I love Cosmos, but not want
to spend $20 every time I make a
website and I want a database
and I tell you for the past 3
years. It was my goal to my
personal goal to get cosmos. DB
somehow free addition, so you
don't have to. Scratch your head
is like well, I don't want to
pay $24.00. If I don't even know
whether my app will succeed
yeah? Why should I so.
Very I'm pretty excited to
announce that we are offering
free cheering Cosmos DB. It's
available now and you any
subscription. You have is
entitled for up to 400 R use
capacity whether it's
provisioned or autopilot or
multi master you get 400 or use
included free of charge
perpetually perpetually. This is
part of the free offering so I
go to azure.com/free which is a
list of all of the great free
offerings this is one of them.
It's even more so it's more like
free website, so irrespective.
What type of your subscription
is you may have any subscription
well basically go subscription.
Whatever offer whatever like app
service has free and shared and
basic and Whatnot. This is a new
tier. This is a new cheer. This
is a free tier in Cosmos. DB
available for any subscription
type and you get up to 5
gigabytes of Cosmos. DB SSD
storage and up to 400. I use
free of charge perpetually.
I'm just thinking right now, I
might be able to move my
diabetes system over tonight. I
think so, and the reasons at
this possible is not only we do
that. We also we used to have
this limit that. You have to
have at least 100 or use
provision per collection in a
database, yeah, see everyone
organizes their mongo databases
differently, and some people
have everything in one
collection. I happen to have 7
or 8 collections with a very
small. I think I've got 500 MB
total across a bunch of but
they're logically oriented
collections and Cosmos is
original per collection. Pricing
model didn't match. My usage
model exactly and even when we
announced Provisioning
throughput at the database
level. Initially, we have said
yes. You can share but if you
have 10 collections. You should
have at least 1000 are you
supervision. As a database so
this 100 are used for limited
collection against this are you
is resource unit, or like it's
like Yeah, but rest unit. I just
don't know exactly what are you?
Is yet it's a currency? I'm not
yet familiar with so until you
spend time with Cosmos and get a
feeling of what and are you
feels like you won't know
whether 400 or 1000 or 10,000 is
what your app needs so we had a
moving that limit it doesn't
matter how many collections. You
have in the database love it.
You can provision 400 or use.
Across the collection across all
collections in your database
right. You have 400 or use. Your
not paying for it and I'm love
it because it's free and
included. This is going to open
things up for hobbyists for
people trying things out, but
were kicking the tires. I think
so. And, of course. This is
available. In addition to all
the other free benefits that we
have as part of the Cosmos DB.
Can I autopilot a free where I
will occasionally pay for that
reporting that I do every once
in awhile? Yes, so that's that's
a good thing cool thing where
you can configure free tier.
Foreign auto pilot for another
pilot database. And then you
will pay only for the Delta.
That's hot that's really cool
because again I've got a little
heartbeat in a very small couple
100 MB of data to manage my
blood sugar, but then I run
reports and when I do. I want
them now in currently on my
Mongo hosted system running in
Azure under a partners
subscription. I have to wait
because it's so slow to run
these reports, and I love the
idea that I could spike.
You have the full power of
Cosmos. Give me that data
quickly and then go back to my
free tier at the end and you
only pay for that spike. I love
it. I love it. I want it. Can I
have it? Yes, now that this
aired this is happening so if
you are watching this show you
have these great features too.
Like we heard about autopilot
happening for new stuff and
being going into existing
databases. Soon, an the free
tier available now, so be sure
to check that out, fantastic
always lovely to see you.
Talking about Cosmos with such
passion, on Azure Friday, thank
you. Scott I always love to be
here. Thank you for having me go
and check it all out. So many
great things happening with
Cosmos DB and I'm learning all
about it today on Azure Friday.
