Get startedGet started for free

MongoDB case study

1. MongoDB case study

In this final lesson of chapter two, we will cover the case study of Shutterfly, a company that uses the MongoDB database.

2. MongoDB - overview

MongoDB is one of the most popular document databases. It stores the data in a format called BSON, which means Binary JSON. BSON is a binary representation to store data in JSON format.

3. MongoDB - features

MongoDB offers MQL, or MongoDB Query Language, which allows us to create complex queries for the data. For example, this code finds all the users whose zip code is 10245. MongoDB provides native drivers for many programming languages such as C#, Java, Python, Scala, etc. It allows us to declare indexes on any document field. As relational databases, it supports ACID transactions, that is, Atomicity, Consistency, Isolation, and Durability; and joins in queries.

4. MongoDB - features

MongoDB can scale horizontally across multiple nodes through native sharding without adding complexity to the application. Shards can be removed or added at any time. MongoDB offers replication so that there is no single point of failure. We can create up to 50 copies of our data across different servers and geographic regions.

5. MongoDB - products

These are the most important products that MongoDB offers. MongoDB Compass is the free Graphic User Interface where we can explore our schema, create queries visually, and much more. MongoDB Atlas is the cloud database service. It can be fully managed across Amazon Web Services, Azure, and Google Cloud. With MongoDB Enterprise Advanced, we can run MongoDB in our infrastructure.

6. MongoDB - products

MongoDB Atlas Data Lake allows the querying and analyzing of data across Amazon Web Services S3 and MongoDB Atlas using the MongoDB Query Language. With MongoDB Charts, we can create visualizations of the data. And finally, Realm Mobile Database allows developers to store data locally on iOS or Android devices.

7. MongoDB - popular uses

Let's see some popular uses of MongoDB. MongoDB is frequently used in single-view applications, which gather data from multiple sources to create a single view. Some example applications include financial services, government, high tech, and retail. Gaming is another use. MongoDB can store data such as player profiles, leaderboards, etc. Another common use is catalog storage, with financial services, government, high tech, and retail, again being the main applications. Real-time analytics, content management, and the Internet of Things are also popular uses.

8. MongoDB - customers

Here are a few MongoDB customers.

9. Shutterfly case study - overview

One company that uses MongoDB is Shutterfly. Shutterfly is an online photography service. Users can share their memories by creating personalized photo albums. The company also offers personalized products with printed photographs. Shutterfly has millions of customers and stores more than six billion images.

10. Shutterfly case study - problem and solution

Shutterfly's data started to grow a lot because their platform doesn't compress, force delete, or down-sample photos. The company used the Oracle relational database, and this growth pushed the performance limits of this database. Thus, applications took a long time to build properly and didn't perform quickly enough. Oracle became too expensive for this deficient performance. These reasons lead Shutterfly to analyze other databases and finally chose MongoDB.

11. Shutterfly case study - results

The switch from Oracle to MongoDB produced a performance improvement. For instance, the average latency for inserts dropped from 400 milliseconds to 2 milliseconds. MongoDB enabled Shutterfly to scale horizontally. With MongoDB's flexible schema, Shutterfly's development cycles are shorter. As a result, developers can quickly develop and deploy new applications. Special features like tags, comments, etc., are not challenging to implement anymore. MongoDB also allows new query patterns that were non-viable with Oracle. All of this resulted in cost reduction.

12. Shutterfly case study - results

You can find more case studies of MongoDB in the link below.

13. Let's practice!

Let's check you understand the reasons why Shutterfly is using MongoDB!