You are on page 1of 3

Assignment 1

Database Engineer (MongoDB)


26, March 2023
Q1. If we want to transfer some money from one bank account to another
bank account, how does MongoDB achieve ACID property?
Ans. Mongo DB achieves ACID properties in all the scenarios where ACID
stands for Atomicity, Consistency, Isolation, and Durability
Mongo DB achieves ACID properties; we can show it using the following
explanation:
Atomicity guarantees that all commands that make up a transaction are
treated as a single unit and either succeed or fail together that means in case
of a power outage the transaction would have either been completed
successfully or been rollbacked if any part of the transaction failed.
E.g. Money needs to be removed from one account and added to the other, or
the transaction will be aborted. Removing money from one account without
adding it to another would leave the data in an inconsistent state.

Consistency guarantees that changes made within a transaction are consistent


with database constraints. This includes all rules, constraints, and triggers. If
the data gets into an illegal state, the whole transaction fails.
E.g. Consider a database constraint that an account balance cannot drop below
zero dollars. All updates to an account balance inside of a transaction must
leave the account with a valid, non-negative balance, or the transaction should
be aborted.

Isolation ensures that all transactions run in an isolated environment. That


enables running transactions concurrently because transactions don’t interfere
with each other.
Consider two concurrent requests to transfer money from the same bank
account. The final result of running the transfer requests concurrently should
be the same as running the transfer requests sequentially.

Durability guarantees that once the transaction completes and changes are
written to the database, they are persisted. This ensures that data within the
system will persist even in the case of system failures like crashes or power
outages.
E.g. Consider a power failure immediately after a database has confirmed that
money has been transferred from one bank account to another. The database
should still hold the updated information even though there was an
unexpected failure.

Ques2. Describe three real-life applications where MongoDB is used. What


are the drawbacks if we use RDBMS in these applications
Ans. Shutterfly
Shutterfly is a popular internet-based photo-sharing and personal publishing
company that manages a store of more than 6 billion images with a transaction
rate of up to 10,000 operations per second. Shutterfly is one of the companies
that transitioned from Oracle to MongoDB.
The drawbacks of RDBMS
In a Relational database first, you build your schema then you build your
queries based on the schema, but you're restricted to how your schema is set
up, and there is no fast, easy, or cost-effective way to change that

Aadhar
India’s Unique Identification project boasts the largest biometric database in
the world. The Aadhar Project uses MongoDB to store the massive
demographic and biometric data of over 1.2 billion Indians. Aadhar also uses
MongoDB to store project images.
Drawbacks of RDBMS
As MongoDB stores a large volume of unstructured data and follows a
document-based storage approach, it’s relatively faster than MySQL. It means
MongoDB stores data in a single document for an entity and helps in faster
data read or write. Features like replication can be a big reason for this.
eBay
eBay is a multinational company that provides a platform for the customer to
customer sales. It is currently running a large number of projects in MongoDB
like merchandising categorization, cloud management, metadata storage, and
search suggestions. eBay made a search suggestion list in MongoDB which was
then indexed by word prefixes and additionally with metadata such as product
category. The multiple indexes provided them the flexibility to look up
suggestions and process queries speedily. Prior, eBay was able to use just a
single replica set which made sharding unnecessary. Additionally, data was
placed inside memory which in return boosted query processing speed.
Drawbacks of RDBMS
MongoDB is flexible as compared to MySQL which means that your database
schema can emerge with business requirements
MongoDB database service enables us to build applications that are faster,
reliable, handles a diverse range of data, and manage applications in an
effective way.

REFERENCES

https://rutujakonde210.medium.com/mongodb-use-
cases-how-ebay-implemented-mongodb-32ad6eb890fc

https://kinsta.com/blog/mongodb-vs-mysql/
#:~:text=As%20MongoDB%20stores%20a%20large,a
%20big%20reason%20for%20this.

https://www.mongodb.com/customers/shutterfly

https://www.edureka.co/blog/real-world-use-cases-of-
mongodb/

You might also like