Azure Cosmos DB: A Scalable, Globally Distributed NoSQL Database
What is Azure Cosmos DB?
Azure Cosmos DB is a fully managed NoSQL, relational, and vector database that delivers single-digit millisecond response times, automatic scalability, and guaranteed performance at any scale.
What is NoSQL?
NoSQL databases are flexible, scalable databases that handle various data formats like documents or key-value pairs, unlike traditional SQL databases with fixed schemas.
Key Features:
Concept related to Cosmos DB:
Database: Each account can contain one or more Databases. A database is a logical unit of management for containers in Azure Cosmos DB for NoSQL.
Containers: Containers are the core units of scalability in Cosmos DB, where the provision throughput and settings are managed like indexing and time-to-live (TTL) policies.
Items: It refers to the documents stored within containers in JSON format. Cosmos DB supports these JSON documents natively and ensures atomicity in write operations.
Partition Keys: Every container requires a partition key, which Cosmos DB uses to logically partition data for scalability and performance.
Partitioning and Horizontal Scaling: Azure Cosmos DB scales using partitioning, which divides data into logical partitions based on a partition key. For example, if UserID
is the partition key, items with different UserID
values are grouped into separate logical partitions. These logical partitions are then distributed across physical partitions, which manage the actual data and throughput.
Indexing in Azure Cosmos DB: Cosmos DB automatically indexes all properties of items without requiring schema management. It also can customize indexing policies to include or exclude specific paths.
Azure Cognitive Search: Azure Cognitive Search is designed to work with both structured and unstructured data. It supports indexing and searching over a wide variety of data types.
For more in-depth details, please explore the Azure Cosmos DB Page.
What is SQL?
Azure SQL Database is a fully managed relational database service that offers high availability, security, and performance. Includes built-in intelligence, advanced security, automatic backups, and scaling capabilities.
Use Cases and Applications:
When to Use SQL:
When to Use CosmosDB:
Comparison:
Type of Database:
- SQL: Relational database, supports ACID transactions.
- Cosmos DB: NoSQL database, supports multiple data models (document, key-value, graph).
Scalability:
- SQL: Scales vertically with more compute power.
- Cosmos DB: Scales horizontally with partitioning and global distribution.
Availability:
- SQL: 99.995% for SQL Database, 99.99% for Managed Instances.
- Cosmos DB: 99.99% for single-region, 99.999% for multi-region setups.
Pricing:
- SQL: The resources are billed hourly at at fixed rate based on the services tier.
- Cosmos DB: The cost of all database operations is normalized and expressed as request units.
Comments
Post a Comment