Turbonomic

 View Only

IBM Turbonomic Optimization of Azure Cosmos DB Service

By Ryan Saul posted Fri March 29, 2024 11:30 AM

  

Introduction

Database as a service (DBaaS) is growing at an alarming rate with users taking advantage of this service model in the public cloud. DBaaS is a cloud computing managed service offering that provides access to a database without requiring the setup of physical hardware, the installation of software or the need to configure the database.

Turbonomic continues to help clients optimize as many cloud services as possible, including various Database services. Turbonomic supports Database as a service (DBaaS) optimization offering for AWS and Azure. Focusing on Azure, Turbonomic offers optimization for Azure databases such as SQL DBs (vCore and DTU), Azure Synapse (Data Warehouse), and now as of December 2023, Turbonomic offers optimization for Azure Cosmos DB.

What and How?

Azure Cosmos DB is a fully managed (No-SQL) platform-as-a-service (PaaS) for modern app development.

The key benefit is that developers can continue to build their applications using popular APIs but get all the benefits of a fully managed and globally distributed database system.

 

Reference: https://azure.microsoft.com/en-us/blog/a-technical-overview-of-azure-cosmos-db/

To deploy Cosmos DB, you create a Cosmos DB account in an Azure resource group in your subscription, and then create databases and containers within that account. 

An account is an entity that manages databases and containers (document collections).

A database is a group of containers (document collections) and is similar to a namespace. Cosmos DB databases are managed through accounts.

In Azure Cosmos DB, containers are entities that store data on one or more partitions. Containers are grouped using databases and managed through accounts.

Note: The phrase “container” within a Cosmos DB account has nothing to do with native Kubernetes terminology (think of it more as tupperware where you store food, but the food is stored data such as JSON sitting in a container and the Tupperware is a database).

The below reference helps map Cosmos DB terminology and the Turbonomic supply chain.  

Additionally, you can view the supply chain for Cosmos DB architecture in Turbonomic.

 

 

Optimization

Before jumping into how Turbonomic can optimize this service, we will discuss how this database service measures performance.

Cosmos DB uses Request Unit (RU) which is a performance currency abstracting the system resources such as CPU, IOPS, and memory that are required to perform the database operations supported by Azure Cosmos DB (think of this as comparable to other Azure database measured units such as DTU and DWU). Whether the database operation is a write, point read, or query, operations are always measured in RUs.

How does Turbo optimize Cosmos DB databases and document collections?

Turbonomic optimizes databases and containers. It uses percentile calculations to measure Request Unit (RU) utilization for these entities and then recommends actions to scale RUs to optimize performance and costs. Turbonomic now generates scale, reconfigure, and delete actions for Cosmos DB. To execute actions, update the service principal for Turbonomic with the required permissions, https://www.ibm.com/docs/en/tarm/8.11.6?topic=azure-reference-permissions.

  •      As of Turbonomic release v8.10.7, Turbonomic can scale document collections with standard (manually provisioned) dedicated throughput. It uses percentile calculations to measure RU utilization and then recommends actions to scale RUs up or down to optimize performance and costs. 
  •      As of Turbonomic release v8.11.4, Turbonomic can now recommend removing unused provisioned throughput that is assigned to an Azure Cosmos database to help reduce your cloud expenses. A reconfigure action will be generated in Turbonomic. To remove this resource, reconfigure the database from Azure.
  •      As of Turbonomic release v8.11.6, to help reduce your cloud expenses, Turbonomic can now recommend deleting an Azure Cosmos database with provisioned throughput but without any underlying document collection (container). This action can be executed in Turbonomic manually or automatically.

o   This action can be executed in Turbonomic manually or automatically. You can disable the generation of delete actions in custom policies for select databases or the default database policy (for a global effect).

Points to consider:

  •      As of Turbonomic release v8.11.6, the platform tracks savings associated with scale and delete actions in the cloud savings charts.
  •      Turbonomic will not recommend delete actions on DBs without provisioned throughput.
  •      Turbonomic discovers but does not scale databases without provisioned throughput.
  •      Turbonomic does not generate action with autoscaling throughput/RUs.
  •      Currently, Turbonomic does not have generate scale and delete actions on Multi-AZ, Multi-Region Cosmos DB entities.
  •      For scale down actions, Turbonomic will never recommend scaling below the minimum RU value calculated by Azure or configured in a database policy.
  •      An account has a total throughput limit that represents capacity, but actual throughput (measured in Request Units or RUs) is provisioned at the database or container (document collection) level.

Note: Cosmos DB scale actions can be taken at any time without disruption to the end user!

Turbonomic’s Cosmos DB database and document collection scale recommendations are non-disruptive and reversible. This should give users confidence and trust in taking these actions to continue to optimize this database service without mitigating performance.

*To clarify, Cosmos DB delete actions are in fact disruptive and non-reversible. 

Non-Disruptive - The end user will not notice any downtime during the action execution.

Reversible - These actions can be reversed in the CSP, if the IT admin needs to revert changes.

 

 

API Support

Azure Cosmos DB’s database engine currently supports DocumentDB SQL, MongoDB, Azure Table Storage, and Gremlin graph query API.

The design also enables natively supporting popular database APIs for data access and query.

You will see below; the UI lists an API Type filter to give users the ability to search for Cosmos DB databases and document collections. To help you with optimization recommendations, Turbonomic users can create group and policies for Cosmos DB databases or document collections based on the API Type filter.

 

Turbonomic Group and Policy Creation

Below lists the Turbonomic group(s) and policy type(s) you can create for Cosmos DB and filter options the user has when creating a group of Cosmos DB databases or document collection(s).

Group Type: Database or Document Collection

Group Filter Type:

-API Type (MongoDB, Gremlin, Cassandra, NoSQL, Table)

-Configured Throughput

-Database Server

-Throughput Autoscaling (Enabled/Disabled)

-Throughput Type (Dedicated/Shared)

-Pricing Model – RU, DWU, DTU, vCore (Database Group creation only)

             

Policy Type: Database or Document Collection

Conclusion

Are you currently optimizing Azure Cosmos DB?

Do you see performance issues with these databases?

Are you overprovisioning these resources and losing money?

If any of these questions strike you, upgrade to Turbo version 8.10.7 or higher and enjoy the benefit of letting Turbonomic do its thing, helping you take optimization and automation to the next level!

References:

IBM Turbonomic Azure Cosmos DB Service Optimization Documentation: https://www.ibm.com/docs/en/tarm/8.11.6?topic=resources-support-azure-cosmos-db

Microsoft Cosmos DB Overview: https://azure.microsoft.com/en-us/blog/a-technical-overview-of-azure-cosmos-db/ 

1 comment
34 views

Permalink

Comments

Thu April 04, 2024 10:13 AM

Very interesting content! Looking forward to seeing a demo in the nearest future.