Azure Cosmos DB, a globally distributed database
docs.microsoft.com
docs.microsoft.com
https://techcrunch.com/2017/05/10/with-cosmos-db-microsoft-w...
Hope Cosmos team releases a whitepaper on their experiences with the language. I'd heard snatches of gossip here and there that TLA+ was used inside Cosmos, but no concrete details.
edit: apparently there's also a video of Lamport talking about this https://www.youtube.com/watch?v=L_PPKyAsR3w
> Leslie Lamport the Turing Award winner whose work underpins many of these concepts (and who also wrote the LaTeX document preparation system) and who joined Microsoft Research in 2001
Quote about TLA+:
> As Shukla noted, though, his idea here was to build a database system that could last decades. To do this, he also brought in Lamport to teach the team TLA+. Lamport has long had a special interest in how developers spec out their applications. TLA+ is essentially a formal language for doing just that. “When we started out in 2010, we wanted to build a system — a lasting system. This was the database of the future for Microsoft,” Shukla told me. “We try to apply as much rigor to our engineering as we possibly can. […] TLA+ has been wonderful in getting that level of rigor in a team of engineers to set the bar high for quality.” TLA+, Lamport noted, allows you to do the high-level design of a system in a completely formal way — and because it’s done formally, it can be checked for correctness, too (and to be fair, AWS and others also use TLA+ to spec out their distributed systems). “I don’t want to give the impression that TLA+ is great and I’m brilliant. It’s great because it’s almost entirely based on mathematics,” Lamport added.
Background: Dr. Leslie Lamport's work has been a constant source of inspiration for the Cosmos DB team. A few of the engineers on the team had learnt TLA+ initially on their own and started seeing its benefits. Subsequently, other members of the team started applying it as well. Leslie had also taught a fantastic class on TLA+ (across Microsoft), which engineers on the Cosmos DB team attended. It was a wonderful, once in a lifetime opportunity for the team to learn TLA+ from Leslie.
To be clear, Leslie personally didn't write any of the TLA+ specs for Cosmos DB. It was Cosmos DB engineers who wrote the TLA+ specs to specify & verify the design (incl. consistency models). The net result is that TLA+ made Cosmos DB a more robust system, which is crucial to offer strict and comprehensive SLAs encompassing availability, consistency, throughput and latency at the 99th percentile. Further, writing TLA+ specs for the five consistency models which we have exposed (as well as many that we have experimented, internally) enabled us to precisely define the semantics for each of the consistency models. This in-turn enables developers building apps on top of Cosmos DB, to rely on the well-defined semantics.
Hope this is helpful.
Still hope you write a whitepaper. The AWS paper is super valuable when making the case for TLA+ use in industry.
Also, if they're atomic, are they optimistic or pessimistic transactions? Also if they're atomic, does that mean queries done on the write server? (My understanding is that readonly transactions on read-replicas are not supported, or at least they weren't under DocDB).
Any lay-programmer insight into what's going on under the hood, or at least performance/atomicity implications, without giving up too much proprietary info, would be appreciated.
Impressive SLA to guarantee, I'm curious if this will hold up in all random customer workloads that are coming, e.g. updating a lot of fields in a large document (or just a very large insert).
i.e. 1 KB item; Same Azure region;
This now seems more plausible.
One thing I'm curious about is if they tested load on a single partition, or if they only tested latencies for random access.
[0] i.e. If I somehow pick keys which are on the same partition.
(I don't know a ton about either technology, please correct me if I'm wrong)
Here's a link for anyone who would like to vote for this feature. https://feedback.azure.com/forums/263030-documentdb/suggesti...
https://docs.microsoft.com/en-us/azure/documentdb/documentdb...
"Azure Cosmos DB accounts that are configured to use strong consistency cannot associate more than one Azure region with their Azure Cosmos DB account."
https://cloud.google.com/spanner/docs/instance-configuration
Are y'all doing encryption in the D/C, or just on the WAN? If you're doing it on the WAN, any luck using MACSEC?
It seems like a "just throw all your data in this" kind of database, probably intended for everything but core application relational data (so, good for analytics, messaging, etc).
It sounds like the atom-record-sequence model at the heart of it is pretty key, but there's not a lot in the article about what that is and how it works. Is this a well-understood data structure used elsewhere?
The project seems very ambitious, and I could see it being used pretty heavily at a lot of companies. Thoughts?
One more thing, as someone who went from DocumentDb to Azure Storage (Tables) back in April 2016 because of the higher price, slower queries, and scalability problems, is there anything that may make Cosmos DB a better option?
[1] https://www.microsoft.com/en-us/research/publication/corfu-a...
The database engine design is inspired on LLAMA http://db.disi.unitn.eu/pages/VLDBProgram/pdf/research/p853-..., Bwtree - > https://pdfs.semanticscholar.org/7655/9c6cc259c6ab5baf7bd19d.... and schema-agnostic indexing techniques -> http://www.vldb.org/pvldb/vol8/p1668-shukla.pdf. Please note that these papers are significantly behind the current state of the implementation. The most crucial aspect that these papers dont cover is the integration of the database engine with the larger distributed system components of Cosmos DB including the resource governance, partition management, and the implementation of replication protocol /consistency models etc. Our goal is to publish all of the design specifications including TLA+ specs over time.
Azure Cosmos DB offers 5 well-defined consistency models for you to choose from, so that you can choose the right tradeoffs for a given application or scenario. This way, you aren't stuck choosing between the hard extremes of Strong and Eventual consistency.
See: https://docs.microsoft.com/en-us/azure/documentdb/documentdb...
See (1) https://docs.microsoft.com/en-us/azure/documentdb/documentdb... and (2) https://docs.microsoft.com/en-us/azure/documentdb/documentdb... (also check out the references at the end of the page)
https://docs.microsoft.com/en-us/azure/documentdb/documentdb...
It's not that I don't appreciate the option. This seems far closer to what DocumentDB should have been earlier on. Though tbh, I think Storage Tables are already pretty useful.
[1] https://docs.microsoft.com/en-us/azure/cosmos-db/introductio...
Your Table Storage queries should be really fast with Cosmos DB since, Cosmos DB supports efficient indexing and query.
to name a few
It's a strange thing, but almost all new database technologies seem to leave search as an afterthought for some later day instead of starting on day one with the assumption that "it's all about search".
A database system that doesn't support rich search capabilities is restricted to very limited types of applications.
Often search is left unimplemented for years, or perhaps never implemented.
If free text search is such a hard problem then you'd think that would be even more reason to start with solving that toughest of all problems. If it's a really hard problem then it will be even harder to retrofit later into some system that is already architected and built.
A light spanking for the architect. No search would have been a thorough spanking.
Nothing you say will convince me that it's just a super easy dance in the daisies to "just do X" or "just do Y" and suddenly its database search heaven.
Database application architects need to wise up that the world revolves around search - built in, not add on.
Cosmos DB has tight integration with Azure Search, to the point that you can choose to extend your Cosmos DB to Azure Search with a few clicks right from the portal to allow for full text search over this content.
You can learn more about how to do this at these two links: https://azure.microsoft.com/en-us/blog/adding-search-to-docu...
https://docs.microsoft.com/en-us/azure/search/search-howto-i...
Liam
Azure Cosmos DB has been many years in the making. Azure Cosmos DB started as “Project Florence” in late 2010 to address developer the pain-points faced by large scale applications inside Microsoft. Observing that the challenges of building globally distributed apps are not a problem unique to Microsoft, in 2015 we made the first generation of this technology available to Azure developers in the form of DocumentDB. Since that time, we’ve been steadily adding new capabilities both in the database engine as well as, larger distributed system components. Azure Cosmos DB is the result. It is the next big leap in globally distributed, at scale, cloud databases. As a part of this release of Azure Cosmos DB, DocumentDB customers, with their data, are automatically Azure Cosmos DB customers. They now have access to the new system and capabilities offered by Azure Cosmos DB today as well as, as we keep evolving the service.
The database engine design is inspired on LLAMA http://db.disi.unitn.eu/pages/VLDBProgram/pdf/research/p853-..., Bwtree - > https://pdfs.semanticscholar.org/7655/9c6cc259c6ab5baf7bd19d.... and schema-agnostic indexing techniques -> http://www.vldb.org/pvldb/vol8/p1668-shukla.pdf. Please note that these papers are significantly behind the current state of the implementation. The most crucial aspect that these papers dont cover is the integration of the database engine with the larger distributed system components of Cosmos DB including the resource governance, partition management, and the implementation of replication protocol /consistency models etc. Our goal is to publish all of the design specifications including TLA+ specs over time.
Needs to be updated since Spanner was released
Thats sounds less then optimal. :)
Do you see many use cases where there is no need for backup to protect against accidental deletion, overwriting, deletion by application vulnerabilities and so on?
As far as I understood the backup docs, I should contact Microsoft Support within 8 hours if any of those things happens. Is that still correct? What if we don't notice the issue until 7 days later?
When I've asked they have been referring to replication and to call them if we accidentally lose data. But we need to contact them within two hours otherwise it's too late. And of course Azure Support never responds that quickly when I submit a case to them.