Azure Cosmos DB goes serverless

Azure’s Cosmos DB is one of the platform’s foundations, powering many of its key services. Designed from the ground up as a distributed database, it implements a set of different consistency models allowing you to trade off between performance and latency for your applications. Then there are its different models for working with data, from familiar NoSQL and SQL APIs, to support for Mongo DB’s API, to the Gremlin graph database query engine.

There’s enough in Cosmos DB to support most common cloud development scenarios, giving you a consistent data platform that can share data on a global scale. Microsoft often describes it as a “planetary-scale database,” a fitting description.

The serverless alternative to provisioned throughput

For all the benefits, Cosmos DB does have some downsides; not least its cost. Although there is a relatively limited free option, running it at scale can be expensive, and you need to take that into account when building applications around it. Budgeting for Cosmos DB request units is a complex process that’s hard to get right the first time, especially when you factor in scaling, either manually or automatically.

Microsoft has run a preview of a serverless option for Cosmos DB for a while now, based on its core SQL API. It’s an interesting alternative to the traditionally provisioned option. It only charges you when it runs a request and suspends your instance when there’s nothing happening. There will be additional latency in database operations, as your instance needs to spin up when it’s been suspended. Of course there’s a charge for storage, but that’s the same with any Azure database. The initial trial has now been expanded to all of the Cosmos DB APIs, with general availability not too far in the future.

Adding a serverless option to Cosmos DB makes a lot of sense for many types of workloads where you’re getting requests in small numbers and in batches. For a small workload with an irregular pattern of operations, a consumption-based pricing model makes a lot of sense—and can save a considerable amount of money over the long term as there is no commitment to provisioned throughput.

Costs are low: You pay $0.282 per serverless request unit, for as many as a million RUs in a billing cycle. If you need a more reliable server you can set up an availability zone, though this increases costs by 1.25x. That’s still a reasonable deal, and what you lose in predictability, you gain in lower costs. Storage costs remain the same for both manual and automatic provisioned throughput.

Copyright © 2020 IDG Communications, Inc.

Source link