Exam 70-487: Accessing Data - How to choose the Appropriate Data Access Technology - Azure Cosmos DB?
Azure cosmos DB is now part of Exam 70-487's latest update and you should study it deeply. Focus on understanding when it is a perfect choice for data storage and access.It is important to read some of the use cases presented by Microsoft: Common Azure Cosmos DB use cases
CosmosDB is useful for companies that are looking for a database system that is scalable and globally distributed, meaning that all resources are partitioned horizontally in every region of the world, as well as replicated across different geographical areas, thereby significantly reducing latency.
It uses five different consistency levels: Strong, Bounded Staleness, Session, Consistent Prefix and Eventual. You must have a thorough understanding of these levels.
Bounded staleness: The reads are guaranteed to honor the consistent-prefix guarantee. The reads might lag behind writes by at most "K" versions (that is "updates") of an item or by "t" time interval. When you choose bounded staleness, the "staleness" can be configured in two ways:
- The number of versions (K) of the item
- The time interval (t) by which the reads might lag behind the writes
Bounded staleness offers total global order except within the "staleness window." The monotonic read guarantees exist within a region both inside and outside the staleness window. Strong consistency has the same semantics as the ones offered by bounded staleness. The staleness window is equal to zero. Bounded staleness is also referred to as time-delayed linearizability. When a client performs read operations within a region that accepts writes, the guarantees provided by bounded staleness consistency are identical to those guarantees with the strong consistency.
Session: The reads are guaranteed to honor the consistent-prefix (assuming a single “writer” session), monotonic reads, monotonic writes, read-your-writes, and write-follows-reads guarantees. Session consistency is scoped to a client session.
Consistent prefix: Updates that are returned contain some prefix of all the updates, with no gaps. Consistent prefix guarantees that reads never see out-of-order writes.
Eventual: There's no ordering guarantee for reads. In the absence of any further writes, the replicas eventually converge.
Besides the consistency levels, you need to also know the different APIs:
- SQL API (Non-relational Document database)
- Azure Cosmos DB's API for MongoDB
- Gremlin API (Graph database to model and traverse relation among entities)
- Table API (For querying Azure Table storage)
- Cassandra API (Cassandra)
Why choose CosmosDB and its APIs over other data Access methods?
IoT and telematics Systems:
- Ingest bursts of data from device sensors of various locales
- Process and analyze streaming data to derive real-time insights
- Archived to cold storage for batch analytics
Retail and marketing Systems
- Store catalog data
- Provide event sourcing in order processing pipelines.
- Azure Cosmos DB supports flexible schemas and hierarchical data, and thus it is well suited for storing product catalog data.
- Perform graphical processing on mobile/console clients, but rely on the cloud to deliver customized and personalized content like in-game stats, social media integration, and high-score leaderboards.
- Require single-millisecond latencies for reads and writes to provide an engaging in-game experience.
- Need database to be fast and be able to handle massive spikes in request rates during new game launches and feature updates.
Web and mobile applications (Social Applications with global reach; personalization)
- Model social interactions, integrating with third-party services, and for building rich personalized experiences
- Store and query user generated content (UGC) for web, mobile, and social media applications
- Respond to changing schemas from other social networks they integrate with
- Need to be able to retrieve personalized settings effectively to render UI elements and experiences quickly.
How to choose the right consistency level: