DocumentDB Interview Questions & Answers

  1. Question 1. What Happened To The Documentdb Api?

    Answer :

    The Azure Cosmos DB DocumentDB API or SQL (DocumentDB) API is now known as Azure Cosmos DB SQL API. You don’t need to change anything to continue running your apps built with DocumentDB API. The functionality remains the same.

    If you had a DocumentDB API account before, you now have a SQL API account, with no change to your billing.

  2. Question 2. What Is Understand Of The Etag?

    Answer :

    Each DocumentDB document has an ETag property that is updated each time the document is updated and you can enforce that the ETag must be identical to what you opened before when you replace the your document.

    The problem with the ETag is that it is attached to the document not the stored JSON object. So all methods we have for fetching a typed Order and write typed Linq statements against the order is effectively made unusable. You should not (in my opinion) manually add the ETag to the orders object as JSONProperty either. In theory you could add a property in your objects like.

  3. DB2 Using SQL Interview Questions

  4. Question 3. What Is Configure Documentdb For Optimistic Concurrency Using The Etag?

    Answer :

    So now we have prepared for usage of Optimistic Concurrency. Now it is just to make sure that we use it. The way DocumentDB implements Optimistic Concurrency is by using AccessConditions. These are added as RequestOptions in the ReplaceDocument API call.

    I added the following two overloads in the DocumentDBRepository. One accepts dynamic and one that accepts a Document (I recommend using the Document overload).

  5. Question 4. How Is Documentdb Pessimistic Concurrency?

    Answer :

    There is no built-in support for handling pessimistic concurrency in DocumentDB so you would have to implement it yourself. I would not recommend this because you have to handle deadlocks, lock expiry and advanced database topics manually.

    I haven’t read up on permissions on documents yet and maybe that could be a start to limit access to a document temporary (have to return on that issue). Doing it the hard way and implementing your own pessimistic locking mechanism is to a series of posts itself and frankly it will most likely be a bad idea as one of DocumentDBs major benefits isthe fast throughput/access times which you may very likely kill if you add pessimistic concurrency to this component.

  6. DB2 Using SQL Tutorial

  7. Question 5. What Is Partial Updates?

    Answer :

    • Partial updates are currently not supported in DocumentDB. This means that you will save the entire document upon time of writing.
    • So a scenario of having two order lines being modified by separate workers is not possible and you should use optimistic concurrency and reload the object if it has been updated elsewhere.
  8. Dbase Interview Questions

  9. Question 6. How To Handle Concurrent Updates To The Same Document?

    Answer :

    When precondition (ETag match) fails Replace Document Async will throw Document Client Exception (Inner Exception to be specific).

    To check if the reason of exception is non-current ETag we have to check if Status Code is Http Status Code. Precondition Failed. 

  10. Question 7. What Is Documentdb?

    Answer :

    DocumentDB is a fully managed NoSQL database service built for fast and predictable performance, high.availability, elastic scaling, global distribution, and ease of development. As a schema-free NoSQL database,DocumentDB provides rich and familiar SQL query capabilities with consistent low latencies on JSON data -ensuring that 99% of your reads are served under 10 milliseconds and 99% of your writes are served under 15milliseconds.

    These unique benefits make DocumentDB a great fit for web, mobile, gaming, and IoT, and manyother applications that need seamless scale and global replication.

  11. Document Type Definition (DTD) Tutorial
    DB2 SQL Programming Interview Questions

  12. Question 8. How Can I Learn About Documentdb?

    Answer :

    A quick way to learn about DocumentDB and see it in action is to follow these three steps:

    1. Watch the two minute video, which introduces the benefits of using DocumentDB.
    2. Watch the three minute Create DocumentDB on Azurevideo, which highlights how to get started with DocumentDB by using the Azure Portal.
    3. Visit the Query Playground, where you can walk through different activities to learn about the rich querying functionality available in DocumentDB. Then, head over to the Sandbox tab and run your own custom SQLqueries and experiment with DocumentDB.
  13. Question 9. What Capabilities And Key Features Does Documentdb Offer?

    Answer :

    Azure DocumentDB offers the following key capabilities and benefits:

    Elastically scalable throughput and storage: Easily scale up or scale down your DocumentDB JSONdatabase to meet your application needs. Your data is stored on solid state disks (SSD) for owredictablelatencies. DocumentDB supports containers for storing JSON data called collections that can scale to virtuallyunlimited storage sizes and provisioned throughput.

    Multi-region replication: MDocumentDB transparently replicates your data to all regions you’ve associated with your DocumentDB account, enabling you to develop applications that require global access to data whileproviding tradeoffs between consistency, availability and performance, all with corresponding guarantees.DocumentDB provides transparent regional failover with multi-homing APIs, and the ability to elastically scalethroughput and storage across the globe.

  14. Document Type Definition (DTD) Interview Questions

  15. Question 10. How Does Documentdb Manage Data?

    Answer :

    Azure DocumentDB manages JSON data through well-defined database resources. These resources are replicatedfor high availability and are uniquely addressable by their logical URI. DocumentDB offers a simple HTTP based.

    RESTful programming model for all resources.The DocumentDB database account is a unique namespace that gives you access to Azure DocumentDB. Beforeyou can create a database account, you must have an Azure subscription, which gives you access to a variety ofAzure services.All resources within DocumentDB are modeled and stored as JSON documents. 

  16. CouchDB Tutorial

  17. Question 11. How Can I Develop Apps With Documentdb?

    Answer :

    Azure DocumentDB exposes resources through a REST API that can be called by any language capable of makingHTTP/HTTPS requests. Additionally, DocumentDB offers programming libraries for several popular languages.

    These libraries simplify many aspects of working with Azure DocumentDB by handling details such as addresscaching, exception management, automatic retries and so forth.

  18. CouchDB Interview Questions

  19. Question 12. Common Use Cases For Documentdb?

    Answer :

    Azure DocumentDB is a general purpose NoSQL database that is used in a wide range of applications and usecases. It is a good choice for any application that needs low order-of-millisecond response times, and needs toscale rapidly.

    The following are some attributes of DocumentDB that make it well-suited for high-performanceapplications:

    • DocumentDB natively partitions your data for high availability and scalability.
    • DocumentDB’s has SSD backed storage with low-latency order-of-millisecond response times.
    • DocumentDB’s support for consistency levels like eventual, session and bounded-staleness allows for low cost-to performance-ratio.
  20. DB2 Using SQL Interview Questions

  21. Question 13. What Is Web And Mobile Applications?

    Answer :

    DocumentDB is commonly used within web and mobile applications, and is particularly well suited for modelingsocial interactions, integrating with third-party services, and for building rich personalized experiences.

    Social application: A common use case for DocumentDB is to store and query user generated content (UGC) for web and mobile applications, particularly social media applications.

  22. JSON (JavaScript Object Notation) Tutorial