>> Hey folks. You know that Azure Cosmos DB team
is constantly delivering
new features and improve capabilities for this
globally distributed highly scalable database service.
So we tried to check in with them periodically to stay up to date.
My friend, Kirill, is back once again to show us what's new
in Azure Cosmos DB today on Azure Friday.
[MUSIC].
Hey, I'm Scott Hanselman and it's Azure Friday.
We're here with Kirill Gavrylyuk talking
about what's new in Cosmos.
There's always tough and new in Cosmos.
You ship like you just ship, ship, ship.
ship. Great stuff. Every month there's something
great happening in Cosmos DB.
>> We try to keep up with our customers.
>> Yeah.
>> They keep us on our toes.
And it's really great to be here because
we did a lot of updates that.
We haven't talked about them at your show at all.
So, a number of things.
Number one, as we've mentioned in another episode,
believe in love at first sight.
So we've invested heavily in SDKs.
>> Yeah.
>> We think that if, you know, features are great,
but if you don't have a good developer experience,
features are not very useful.
We've recorded an episode about JavaScript SDK,.NET SDK.
We're doing the same work for Java SDK and Python SDK,
revamping all of them.
A number of breaking changes,
but hopefully they're worth it.
So we've talked about.NET SDK which is now a more intuitive,
more idiomatic, more modern, testable performance.
We've talked about JavaScript SDK on the other episode.
For example, here, I have a TodoApp,
yet another one using the new Cosmos JavaScript SDK.
It's a isomorphic SDK.
So you can use it on the server.
You can use it on the client.
Just same SDK.
>> Really? Ooohhh.
>> It supports Promises,
it supports a ton of new JavaScript features.
Much easier to use,
much easier to quote and what's really exciting today,
just a month ago or less we announced core support.
Support for accepting requests across domain.
So now you can talk from this app,
as you can see, directly to the service.
Without having to go through any intermediary.
>> Exactly.
>> We have the securities.
An interesting question. We have it worked out,
we have a resource token support.
So you can get a temporary token from your app and then
your client can talk securely directly to the database.
>> Wow.
>> A ton of people do this.
We know if there is a successful service Firebase
that specializes exactly on it.
So you can see a number of things here.
Clouds, you can read,
you can write, you can query.
Something very close to my heart
is you can do onUpdates so you can read changes.
You can subscribe to changes from
the database and get called back when the changes arrived.
You get notified all the way back on the client.
All the way back to the client. That's cool.
We're getting pretty close to building a real time
JavaScript only apps with
the database that is by far more performant,
more scalable than annual social [inaudible] all day.
>> Wow, you promise?
>> Yeah. Good one.
So, the way you set up CORS, you go right here.
So here I have kirill-loves-fidays.
My little Web app, yet another TodoApp.
Of course it is scalable, world-scale TodoApp.
It's world scale and it works across all regions.
>> Awesome.
>>> As far as you want it.
The way to gives this app access to your database is by adding
its origin to your database account in the CORS menu item.
>> Very important, Cross-Origin Resource Sharing. Super important.
>> From there on, you're good to
go and you can talk to your database.
Number two, we do want folks to be efficient,
to feel Cosmos DB is friendly.
Cosmos DB is a very highly performance service,
so sometimes it can get expensive.
We don't want folks to pay more than they really need.
So we've done a number of updates including lowering the price
for databases with multiple collections
25 times. So now, you can create-
>> Twenty-five times cheaper?
>> It's 25 times cheaper.
We think that it's a good present for you here.
>> Well, I've told you before,
I tried to run different things in
Cosmos and you've been very kind to help me run
some of my blood sugar information to
the Mongo front end for Cosmos and it's worked great.
But it has been for small projects that I work on.
Cost-prohibitive to be frank.
>> And we felt it and we took it to heart.
It was not an easy change,
but we've made two features available.
One of them is now you can create databases.
>> Okay.
>> And provision throughput on
a database and have
as many collections as you want in the database.
>> Oh, I see. So rather than per
collection pricing which was difficult for me
because my particular application had like 17 collections.
>> Yeah.
>> You make a logical database that contains collection.
>> Yeah, and for some scenarios,
per collection pricing is better
because you want to isolate that collection.
Better take one million requests
per second and no one should mess with it.
>> Exactly.
>> But sometimes we have 100 collections and we don't
particularly care about each individual in isolation.
We just want the entire database to be performed.
>> That's my scenario.
>> So you can provision our throughput on the database and
we've lowered it down so you can create a database.
It's $24 a month and you can
create multiple collections in it and work with it.
>> This is going to be perfect for me.
You've just literally saved me money as I stand here.
Always try. I appreciate that.
>> It is you and many of our customers.
Another important thing is when you
develop and test with Cosmos DB,
I don't think you want to pay at all.
>> Yeah. I want to be frank.
>> I wouldn't want to pay.
>> I don't know if I would say that publicly,
but yeah, that's true.
Anytime anything is free, it's better.
>> And it makes sense, right?
Because you're not earning money yet.
You're not running in production, why should you pay.
So there are a number of ways how you can achieve this.
>> Okay.
>> We have an emulator which you can download.
You can get it in a container and
run it in the container or you can talk to it remotely,
host it on a VM or you can run it locally.
>> Really?
>> It's a great tool.
It's a high fidelity emulator.
It reuses at lot of the same shared code based,
and so you can get exact behavior
down to it's telling users you don't have
capacity in some region occasionally.
>> That's great.
>> The emulator is available container and we added
this cool Azure DevOps extension that allows you
to add into your pipeline "Run My Test" on
the simulator and this extension deploys simulator on a container,
gives you the connection string.
Azure DevOps runs this test-
>> That's huge.
>> - and then scraps without [inaudible]
>> Because I put all my things on Azure DevOps now,
but I have to have a separate Azure Cosmos DB instance
just to exist for the purposes of
integration testing. And now that goes away.
>> Exactly and it's free.
You're just running it on
Azure DevOps and we use this in our own development.
Into all of SDKs,
I built and tested continuously CI runs against this.
>> Wow.
>> In fact, we're using Azure DevOps now for
CI because it's actually better.
>> Yeah. That's great.
>> Of course we have a free sandbox.
Try Cosmos DB. If you want to just try it out,
play with it, which is pretty big.
>> I'm already mentally configuring some Kubernetes stuff
with Azure Cosmos running through my tent for my dev and test.
>> We think that this combination enables you
this really accordingly in a medium of pay as you go experience.
You don't want to pay unless you actually make sense for you.
>> Right, you pay for the value.
>> We agree and we tried to make it better and better for you.
Finally, we've talked a lot
about global distribution of Cosmos DB.
It would not be a Cosmos DB Azure
Friday if we didn't talk about global distribution.
>> Sure.
>> The important part is that we've
enabled strong consistency mode.
Something that most folks
understand because that's how
we've learned when we went to school,
that everything is consistent.
It's very hard to write apps when things are not consistent.
Strong consistency, very convenient programming model and it's
available now for multi-region deployments.
So I can go and I can make
my customers DB data available in any number of regions.
And then I can go to default consistency menu and enable strong.
We have some visualizations
that help you understand what does it mean.
>> And by the way, these visualizations.
I saw these recently, they're fantastic.
>> I, thank you.
>> They make a lot of sense. People should check this out.
You've always had some really great things in your Azure plate.
>> Thank you. I think this explains
much better than five pages of documentation.
>> Well the fact that reads are
guaranteed to see the most recent write,
that is how we learned and it's
the most intuitive way things should work.
And the fact that it's simply
a configuration option now, it's amazing.
>> But of course it's a trade off.
So you can go and you can choose among
these five settings which consistency model you like,
which is better in terms of cost versus performance
versus where's there's consistency equation.
That's it. Lots and more and more updates coming.
Please stay tuned and we definitely are going to be back.
>> So people should check out the other episodes
that we've done in Azure Friday on Cosmos DB.
We talk about all the different front ends on it,
on talking to it as if it's Mongo,
talking to it as if it's Gremlin,
talking to it in different ways.
The fact that there's an emulator for you to try
locally developed Cosmos DB on
an airplane and then deploy when you're
back and landed and then put it out into multiple regions,
it's just a glorious and fantastic database.
I appreciate you coming by.
>> Thank you.
>> I am learning all about the great new stuff in
Cosmos DB today on Azure Friday.
[MUSIC]