Database / Azure Cosmos DB interview questions
What is the Cosmos DB Emulator and how is it used in development?
The Azure Cosmos DB Emulator is a locally running software that faithfully emulates the Cosmos DB NoSQL API on your development machine. It lets you develop and test Cosmos DB applications without an Azure subscription, without incurring costs, and with full offline capability. The emulator runs as a Windows application or as a Docker container (supporting Linux and macOS via Docker).
Starting the emulator via Docker is the most cross-platform approach:
docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest
docker run -p 8081:8081 -p 10251-10255:10251-10255 \
-e AZURE_COSMOS_EMULATOR_PARTITION_COUNT=10 \
-e AZURE_COSMOS_EMULATOR_ENABLE_DATA_PERSISTENCE=true \
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latestThe emulator exposes the same REST endpoint as the cloud service at https://localhost:8081 and uses a well-known fixed key for authentication (the same key is documented publicly and is the same for every installation). Connection string:
AccountEndpoint=https://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==Key limitations compared to the cloud service:
- Only supports the NoSQL API — no MongoDB, Cassandra, or Gremlin emulation
- No global distribution simulation
- No SLA guarantees (performance is your local machine's)
- The emulator certificate is self-signed — CI pipelines need to trust it explicitly
- Supports up to 25 fixed containers with simulated partitioning
For integration tests in CI/CD pipelines, the emulator Docker image is commonly used in GitHub Actions or Azure DevOps pipeline steps, giving every pull request its own isolated Cosmos DB environment at zero cost.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
