Edit

Share via


Why use Azure Cosmos DB for NoSQL for your AI applications?

Developers and architects face difficult challenges in understanding how they can use the capabilities brought by Generative-AI into their own businesses and workloads. One challenge includes understanding what technologies to use to build these types of applications. This article explains why users should use Azure Cosmos DB to build AI applications.

Azure Cosmos DB unifies multiple indexing, search, and query capabilities in a distributed, transactional NoSQL database. Azure Cosmos DB is a full-featured transactional database. Its indexing engine is highly configurable, letting you index JSON documents, vector representations and text and language-specific data all on the same data. Developers can combine scalar, range, and geospatial filters in a unified query syntax alongside similarity and keyword searches for a complete hybrid query capability in a single datastore. This hybrid capability makes it easier to build applications that need to retrieve data based on both semantic similarity and classical attribute searches. This also contrasts with specialized vector databases, which are optimized solely for similarity search.

Serverless and elastic scalability

Azure Cosmos DB provides multiple billing models; serverless, provisioned throughput, and provisioned throughout with autoscale.

Azure Cosmos DB is also a scale-out database with automatic scaling of throughput and storage. Automatic scaling is especially valuable for AI applications that can experience variable load patterns. This elasticity means that as your data volume or query complexity grows—whether in processing new embeddings or handling an increasing number of hybrid queries—Azure Cosmos DB can scale without compromising performance.

Single-digit latency and 99.999% availability

Azure Cosmos DB is designed as a globally distributed database that can replicate data to every region within Azure providing 99.999% availability guarantees. This replication also offers low-latency access regardless of where users or applications are located. For AI applications that may need to serve users worldwide, this means faster retrieval times and consistent performance.

Built on DiskANN

Vector search in Azure Cosmos DB is built on DiskANN, a graph-based indexing and search system that can index, store, and search large sets of vector data on relatively small amounts of computational resources. DiskANN stores highly compressed, vectors in memory, while storing the full vectors and graph structure in on-cluster, high-speed SSDs that constitute the backbone of Azure Cosmos DB data storage. DiskANN provides fast search, while maintaining accuracy under replaces and deletions. DiskANN also supports efficient query filtering via pushdown to the index to enable fast and cost-effective hybrid queries. DiskANN has been used successfully within Microsoft for years, and today it is part of crucial Microsoft applications such as web search, advertisements, and the Microsoft 365 and Windows copilot runtimes.

Seamless integration with Azure services

Azure Cosmos DB is a first-class citizen in the Azure ecosystem. It easily integrates with other Azure services (such as Azure Functions, Azure App Service, Microsoft Fabric and more), which is beneficial when building end-to-end AI solutions. This integration simplifies workflows and enables developers to incorporate advanced analytics, real-time dashboards, and further AI capabilities without data movement hassles.

Enterprise-grade security and compliance

For applications involving sensitive data or operating in regulated industries, Azure Cosmos DB offers enterprise-grade security, compliance, and robust data governance features. This helps ensure that your AI applications are not only powerful but also secure and compliant by design.

Multitenancy

Azure Cosmos DB provides a flexible and scalable foundation for building multitenant SaaS applications with support for various tenancy models, including partition key per tenant within shared containers, container per tenant, or dedicated accounts per tenant. This allows developers to balance isolation, performance, and cost based on requirements. Features like provisioned throughput, autoscaling, serverless configurations, and burst capacity enable dynamic resource scaling to accommodate varying tenant workloads. For enhanced security, Azure Cosmos DB offers customer-managed keys, ensuring data encryption tailored to individual tenant needs.