ICT704 Non-Relational Database Systems: MongoDB Database Project
VerifiedAdded on 2023/06/04
|13
|2135
|313
Project
AI Summary
This project provides a detailed implementation of a movie database using MongoDB, a NoSQL database system. The project includes the creation of database schemas, indexes for optimizing search operations, and handling relationships between collections. It features queries to retrieve specific movie data, ratings, and comments. The report justifies the design choices, such as using indexes and reference relationships, and suggests an alternate database implementation using embedded documents. Additionally, it explores other functionalities that could be added to the movie review database, such as separate documents for reviewers and critiques, user tagging in comments, and categorized data for actors and directors. This document is available on Desklib, a platform providing study tools and resources for students.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.

Running head: MONGODB DATABASE
MongoDB Database
Name of the Student
Name of the University
MongoDB Database
Name of the Student
Name of the University
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

1MONGODB DATABASE
Table of Contents
Part A: Query.............................................................................................................................2
Index 1:...................................................................................................................................2
Index 2:...................................................................................................................................2
Index 3:...................................................................................................................................2
Query 1:..................................................................................................................................3
Query 2:..................................................................................................................................3
Query 3:..................................................................................................................................3
Query 4:..................................................................................................................................4
Query 5:..................................................................................................................................4
Query 6:..................................................................................................................................4
Query 7:..................................................................................................................................5
Query 8:..................................................................................................................................5
Query 9:..................................................................................................................................5
Query 10:................................................................................................................................5
Query 11:................................................................................................................................6
Part B: Report.............................................................................................................................7
Structure of Database:............................................................................................................7
Justification for Creating Index:.............................................................................................8
Handling Relationships:.........................................................................................................8
Alternate Database Implementation:......................................................................................9
Other Functionalities:.............................................................................................................9
Bibliography:............................................................................................................................10
Table of Contents
Part A: Query.............................................................................................................................2
Index 1:...................................................................................................................................2
Index 2:...................................................................................................................................2
Index 3:...................................................................................................................................2
Query 1:..................................................................................................................................3
Query 2:..................................................................................................................................3
Query 3:..................................................................................................................................3
Query 4:..................................................................................................................................4
Query 5:..................................................................................................................................4
Query 6:..................................................................................................................................4
Query 7:..................................................................................................................................5
Query 8:..................................................................................................................................5
Query 9:..................................................................................................................................5
Query 10:................................................................................................................................5
Query 11:................................................................................................................................6
Part B: Report.............................................................................................................................7
Structure of Database:............................................................................................................7
Justification for Creating Index:.............................................................................................8
Handling Relationships:.........................................................................................................8
Alternate Database Implementation:......................................................................................9
Other Functionalities:.............................................................................................................9
Bibliography:............................................................................................................................10

2MONGODB DATABASE
Part A: Query
Index 1:
Index 2:
Index 3:
Part A: Query
Index 1:
Index 2:
Index 3:

3MONGODB DATABASE
Query 1:
Query 2:
Query 3:
Query 1:
Query 2:
Query 3:
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

4MONGODB DATABASE
Query 4:
Query 5:
Query 6:
Query 4:
Query 5:
Query 6:

5MONGODB DATABASE
Query 7:
Error in the Data Sheet… The query is perfect
Query 8:
Query 9:
Query 10:
Query 7:
Error in the Data Sheet… The query is perfect
Query 8:
Query 9:
Query 10:

6MONGODB DATABASE
Query 11:
Query 12:
Query 11:
Query 12:
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

7MONGODB DATABASE
Part B: Report
Structure of Database:
The appropriate database schemas has been used for the implementation of Movie
Database. This allowed to get the best performance from the database and alter the database
to adopt changing business requirements quickly. The data model has been a flexible one and
allow storing or aggregating any type data that has been defined in the database. The database
structure also allows alteration of schema without any downtime.
The collections have been used for organizing the documents and the movie data are
stored in the documents. The database has two collections. The first collection is movie and
the second collection is Rating. These two collections has MovieID in common. The Movie
collection has MovieID, MovieName, Director, ReleaseDate, OscarsWon and Country fields.
The Rating collection has MovieID, ReviewedBy, Date, Rating and comments. The rating
and comments can be null in ‘Rating’ collection. In Movie Collection, the oscarsOwn can be
null. The MongoDB has _id field as a default filed which is unique. This naming convention
is used by the MongoDB database server across entire contents. The _id are used as the
Part B: Report
Structure of Database:
The appropriate database schemas has been used for the implementation of Movie
Database. This allowed to get the best performance from the database and alter the database
to adopt changing business requirements quickly. The data model has been a flexible one and
allow storing or aggregating any type data that has been defined in the database. The database
structure also allows alteration of schema without any downtime.
The collections have been used for organizing the documents and the movie data are
stored in the documents. The database has two collections. The first collection is movie and
the second collection is Rating. These two collections has MovieID in common. The Movie
collection has MovieID, MovieName, Director, ReleaseDate, OscarsWon and Country fields.
The Rating collection has MovieID, ReviewedBy, Date, Rating and comments. The rating
and comments can be null in ‘Rating’ collection. In Movie Collection, the oscarsOwn can be
null. The MongoDB has _id field as a default filed which is unique. This naming convention
is used by the MongoDB database server across entire contents. The _id are used as the

8MONGODB DATABASE
primary key on the collection elements. This eliminates the need of having a default primary
key like relational database. This makes the used database collection more efficient.
Justification for Creating Index:
The index has enhanced the search-ability and data accessibility of the implemented
Movie database. The MovieID, MovieName and few fields are frequently used in the
database queries. That is why three indexes has been created for optimizing the search
operation. The indexes has allowed to search for results for queries to be more efficient and
quick. As the collection document has small amount of data sets, the impact of the index
cannot be much effective. However, the searching time has reduced from 8 milliseconds to 4
milliseconds. The MovieID is indexed to optimize the search operation of query 1, query 6
and many more. The third index optimize the query 10, query 9 and others. By default, the
‘find()’ searches for every database values in the collection even if the value is found. The
second index allows the database to search for the Movies that is originated in Japan. The
MongoDB indexes use the efficient binary search algorithm that automatically reduces the
searching time. The index also functions when two collections are merged together to find
some value. The query 9 just takes 12 milliseconds to search the result after implementing the
index 1. Before that it took 18 milliseconds were needed. This implies that indexing may not
affect small databases but the impact can be see immediately.
Handling Relationships:
The Collections in the Movie Database in MongoDB are connected to each other in
one-to-many relationship. The Movie Collection is connected to the Rating collection in on—
to-many relation. This implies that the one movie can have one or more rating or comments.
The $lookup and $replaceRoot has been used for connecting these two collections and search
for needed results. The Movie MongoDB database uses the reference relationship as two
documents are maintained separately. The rating document has a reference to the MovieID of
primary key on the collection elements. This eliminates the need of having a default primary
key like relational database. This makes the used database collection more efficient.
Justification for Creating Index:
The index has enhanced the search-ability and data accessibility of the implemented
Movie database. The MovieID, MovieName and few fields are frequently used in the
database queries. That is why three indexes has been created for optimizing the search
operation. The indexes has allowed to search for results for queries to be more efficient and
quick. As the collection document has small amount of data sets, the impact of the index
cannot be much effective. However, the searching time has reduced from 8 milliseconds to 4
milliseconds. The MovieID is indexed to optimize the search operation of query 1, query 6
and many more. The third index optimize the query 10, query 9 and others. By default, the
‘find()’ searches for every database values in the collection even if the value is found. The
second index allows the database to search for the Movies that is originated in Japan. The
MongoDB indexes use the efficient binary search algorithm that automatically reduces the
searching time. The index also functions when two collections are merged together to find
some value. The query 9 just takes 12 milliseconds to search the result after implementing the
index 1. Before that it took 18 milliseconds were needed. This implies that indexing may not
affect small databases but the impact can be see immediately.
Handling Relationships:
The Collections in the Movie Database in MongoDB are connected to each other in
one-to-many relationship. The Movie Collection is connected to the Rating collection in on—
to-many relation. This implies that the one movie can have one or more rating or comments.
The $lookup and $replaceRoot has been used for connecting these two collections and search
for needed results. The Movie MongoDB database uses the reference relationship as two
documents are maintained separately. The rating document has a reference to the MovieID of

9MONGODB DATABASE
Movie document. This has been done for designing the relationships that are normalized.
This has been done to convey the basic level idea of NoSQL database which is simplifying
the relationship among the documents. As a NoSQL database, MongoDB states the same.
However, in the selected scenario, the modelled database needs to have a relationship among
the documents and it is done through one-to-many reference relationship.
Alternate Database Implementation:
In the proposed database, two documents are implemented in two different
collections. The alternate approach is implementing two documents in one collection. The
alternate approach suggests that movie and rating documents will be stored in one collection.
The Movie rating is related to only the movies. The ratings will always be loaded with the
movie name or id, so the database documents can be embedded. The alternate approach will
have the same basic idea for the movie database but the query structure and result
optimization will change with embedded document approach.
Other Functionalities:
The movie review database can have several functions other than the proposed
functions. The proposed database has only comment and review functions. The database can
have separate document for normal reviewers and critiques. This way the database can make
more meaning to the real world implication of it. The database can show both the normal
reviewer and critiques’ average ratings so that users can have a better idea about what the
movie is really like. The comments sections does not have any option of tagging another user.
The database can have different document for comments so that tagged users can be
identified. The database also can be different documents for actors, directors and other
people who has worked in the movie. This way the user can be search for different movies
that a person has worked in. The database can categorize the persons into different tables.
Movie document. This has been done for designing the relationships that are normalized.
This has been done to convey the basic level idea of NoSQL database which is simplifying
the relationship among the documents. As a NoSQL database, MongoDB states the same.
However, in the selected scenario, the modelled database needs to have a relationship among
the documents and it is done through one-to-many reference relationship.
Alternate Database Implementation:
In the proposed database, two documents are implemented in two different
collections. The alternate approach is implementing two documents in one collection. The
alternate approach suggests that movie and rating documents will be stored in one collection.
The Movie rating is related to only the movies. The ratings will always be loaded with the
movie name or id, so the database documents can be embedded. The alternate approach will
have the same basic idea for the movie database but the query structure and result
optimization will change with embedded document approach.
Other Functionalities:
The movie review database can have several functions other than the proposed
functions. The proposed database has only comment and review functions. The database can
have separate document for normal reviewers and critiques. This way the database can make
more meaning to the real world implication of it. The database can show both the normal
reviewer and critiques’ average ratings so that users can have a better idea about what the
movie is really like. The comments sections does not have any option of tagging another user.
The database can have different document for comments so that tagged users can be
identified. The database also can be different documents for actors, directors and other
people who has worked in the movie. This way the user can be search for different movies
that a person has worked in. The database can categorize the persons into different tables.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

10MONGODB DATABASE
Bibliography:
Abbes, H. and Gargouri, F., 2016, December. M2Onto: an approach and a tool to learn OWL
ontology from MongoDB database. In International Conference on Intelligent Systems
Design and Applications (pp. 612-621). Springer, Cham.
Abbes, H. and Gargouri, F., 2016. Big data integration: A MongoDB database and modular
ontologies based approach. Procedia Computer Science, 96, pp.446-455.
Abbes, H., Boukettaya, S. and Gargouri, F., 2015, November. Learning ontology from big
data through MongoDB database. In Computer Systems and Applications (AICCSA), 2015
IEEE/ACS 12th International Conference of (pp. 1-7). IEEE.
Aboutorabi, S.H., Rezapour, M., Moradi, M. and Ghadiri, N., 2015, August. Performance
evaluation of SQL and MongoDB databases for big e-commerce data. In Computer Science
and Software Engineering (CSSE), 2015 International Symposium on (pp. 1-7). IEEE.
Chauhan, D. and Bansal, K.L., 2017. Using the Advantages of NoSQL: A case study on
MongoDB. International Journal on Recent and Innovation Trends in Computing and
Communication, 5(2), pp.90-93.
Dupont, C., Wussah, A., Malo, S., Thiare, O., Niass, F., Pham, C., Dupont, S., Le Gall, F. and
Cousin, P., 2018, May. Low-Cost IoT Solutions for Fish Farmers in Africa. In 2018 IST-
Africa Week Conference (IST-Africa) (pp. Page-1). IEEE.
Ferney, M.M.J., Estefan, L.B.N. and Alexander, V.V.J., 2017, October. Assessing data
quality in open data: A case study. In de Innovacion y Tendencias en Ingenieria (CONIITI),
2017 Congreso Internacional (pp. 1-5). IEEE.
Bibliography:
Abbes, H. and Gargouri, F., 2016, December. M2Onto: an approach and a tool to learn OWL
ontology from MongoDB database. In International Conference on Intelligent Systems
Design and Applications (pp. 612-621). Springer, Cham.
Abbes, H. and Gargouri, F., 2016. Big data integration: A MongoDB database and modular
ontologies based approach. Procedia Computer Science, 96, pp.446-455.
Abbes, H., Boukettaya, S. and Gargouri, F., 2015, November. Learning ontology from big
data through MongoDB database. In Computer Systems and Applications (AICCSA), 2015
IEEE/ACS 12th International Conference of (pp. 1-7). IEEE.
Aboutorabi, S.H., Rezapour, M., Moradi, M. and Ghadiri, N., 2015, August. Performance
evaluation of SQL and MongoDB databases for big e-commerce data. In Computer Science
and Software Engineering (CSSE), 2015 International Symposium on (pp. 1-7). IEEE.
Chauhan, D. and Bansal, K.L., 2017. Using the Advantages of NoSQL: A case study on
MongoDB. International Journal on Recent and Innovation Trends in Computing and
Communication, 5(2), pp.90-93.
Dupont, C., Wussah, A., Malo, S., Thiare, O., Niass, F., Pham, C., Dupont, S., Le Gall, F. and
Cousin, P., 2018, May. Low-Cost IoT Solutions for Fish Farmers in Africa. In 2018 IST-
Africa Week Conference (IST-Africa) (pp. Page-1). IEEE.
Ferney, M.M.J., Estefan, L.B.N. and Alexander, V.V.J., 2017, October. Assessing data
quality in open data: A case study. In de Innovacion y Tendencias en Ingenieria (CONIITI),
2017 Congreso Internacional (pp. 1-5). IEEE.

11MONGODB DATABASE
Gousios, G., Vasilescu, B., Serebrenik, A. and Zaidman, A., 2014, May. Lean GHTorrent:
GitHub data on demand. In Proceedings of the 11th working conference on mining software
repositories (pp. 384-387). ACM.
Guimaraes, V., Hondo, F., Almeida, R., Vera, H., Holanda, M., Araujo, A., Walter, M.E. and
Lifschitz, S., 2015, November. A study of genomic data provenance in NoSQL document-
oriented database systems. In Bioinformatics and Biomedicine (BIBM), 2015 IEEE
International Conference on (pp. 1525-1531). IEEE.
Gyorodi, C., Gyorodi, R., Pecherle, G. and Olah, A., 2015, June. A comparative study:
MongoDB vs. MySQL. In Engineering of Modern Electric Systems (EMES), 2015 13th
International Conference on (pp. 1-6). IEEE.
Inel, O., Khamkham, K., Cristea, T., Dumitrache, A., Rutjes, A., van der Ploeg, J.,
Romaszko, L., Aroyo, L. and Sips, R.J., 2014, October. Crowdtruth: Machine-human
computation framework for harnessing disagreement in gathering annotated data. In
International Semantic Web Conference (pp. 486-504). Springer, Cham.
Kanoje, S., Powar, V. and Mukhopadhyay, D., 2015, March. Using MongoDB for social
networking website deciphering the pros and cons. In Innovations in Information, Embedded
and Communication Systems (ICIIECS), 2015 International Conference on (pp. 1-3). IEEE.
Kumar, L., Rajawat, S. and Joshi, K., 2015. Comparative analysis of nosql (mongodb) with
mysql database. International Journal of Modern Trends in Engineering and Research, 2(5),
pp.120-127.
Le, M.K., Chang, H.T., Chang, Y.M., Hu, Y.H. and Chen, H.T., 2016, December. An
efficient multilevel healthy cloud system using Spark for smart clothes. In Computer
Symposium (ICS), 2016 International (pp. 182-186). IEEE.
Gousios, G., Vasilescu, B., Serebrenik, A. and Zaidman, A., 2014, May. Lean GHTorrent:
GitHub data on demand. In Proceedings of the 11th working conference on mining software
repositories (pp. 384-387). ACM.
Guimaraes, V., Hondo, F., Almeida, R., Vera, H., Holanda, M., Araujo, A., Walter, M.E. and
Lifschitz, S., 2015, November. A study of genomic data provenance in NoSQL document-
oriented database systems. In Bioinformatics and Biomedicine (BIBM), 2015 IEEE
International Conference on (pp. 1525-1531). IEEE.
Gyorodi, C., Gyorodi, R., Pecherle, G. and Olah, A., 2015, June. A comparative study:
MongoDB vs. MySQL. In Engineering of Modern Electric Systems (EMES), 2015 13th
International Conference on (pp. 1-6). IEEE.
Inel, O., Khamkham, K., Cristea, T., Dumitrache, A., Rutjes, A., van der Ploeg, J.,
Romaszko, L., Aroyo, L. and Sips, R.J., 2014, October. Crowdtruth: Machine-human
computation framework for harnessing disagreement in gathering annotated data. In
International Semantic Web Conference (pp. 486-504). Springer, Cham.
Kanoje, S., Powar, V. and Mukhopadhyay, D., 2015, March. Using MongoDB for social
networking website deciphering the pros and cons. In Innovations in Information, Embedded
and Communication Systems (ICIIECS), 2015 International Conference on (pp. 1-3). IEEE.
Kumar, L., Rajawat, S. and Joshi, K., 2015. Comparative analysis of nosql (mongodb) with
mysql database. International Journal of Modern Trends in Engineering and Research, 2(5),
pp.120-127.
Le, M.K., Chang, H.T., Chang, Y.M., Hu, Y.H. and Chen, H.T., 2016, December. An
efficient multilevel healthy cloud system using Spark for smart clothes. In Computer
Symposium (ICS), 2016 International (pp. 182-186). IEEE.

12MONGODB DATABASE
Michel, F., Faron-Zucker, C. and Montagnat, J., 2016, September. A mapping-based method
to query MongoDB documents with SPARQL. In International Conference on Database and
Expert Systems Applications (pp. 52-67). Springer, Cham.
Michel, F., Zucker, C.F. and Montagnat, J., 2016. Mapping-based SPARQL access to a
MongoDB database (Doctoral dissertation, CNRS).
Mohamed, H.H.H., 2015. A new auditing mechanism for open source NoSQL database a
case study on open source MongoDB database (Doctoral dissertation, Universiti Utara
Malaysia).
Shukla, K. and Khare, P., 2018. A SIMPLIFIED WAY OF DATABASE MIGRATION
FROM RELATIONAL DATABASE MYSQL TO NOSQL DATABASE MONGODB.
Simanjuntak, H.T., Simanjuntak, L., Situmorang, G. and Saragih, A., 2015. Query Response
Time Comparison NOSQLDB MONGODB with SQLDB Oracle. JUTI: Jurnal Ilmiah
Teknologi Informasi, 13(1), pp.95-105.
Stanescu, L., Brezovan, M. and Burdescu, D.D., 2016, September. Automatic mapping of
MySQL databases to NoSQL MongoDB. In Computer Science and Information Systems
(FedCSIS), 2016 Federated Conference on (pp. 837-840). IEEE.
Wu, C.M., Huang, Y.F. and Lee, J., 2015. Comparisons between mongodb and ms-sql
databases on the twc website. American Journal of Software Engineering and Applications,
4(2), pp.35-41.
Michel, F., Faron-Zucker, C. and Montagnat, J., 2016, September. A mapping-based method
to query MongoDB documents with SPARQL. In International Conference on Database and
Expert Systems Applications (pp. 52-67). Springer, Cham.
Michel, F., Zucker, C.F. and Montagnat, J., 2016. Mapping-based SPARQL access to a
MongoDB database (Doctoral dissertation, CNRS).
Mohamed, H.H.H., 2015. A new auditing mechanism for open source NoSQL database a
case study on open source MongoDB database (Doctoral dissertation, Universiti Utara
Malaysia).
Shukla, K. and Khare, P., 2018. A SIMPLIFIED WAY OF DATABASE MIGRATION
FROM RELATIONAL DATABASE MYSQL TO NOSQL DATABASE MONGODB.
Simanjuntak, H.T., Simanjuntak, L., Situmorang, G. and Saragih, A., 2015. Query Response
Time Comparison NOSQLDB MONGODB with SQLDB Oracle. JUTI: Jurnal Ilmiah
Teknologi Informasi, 13(1), pp.95-105.
Stanescu, L., Brezovan, M. and Burdescu, D.D., 2016, September. Automatic mapping of
MySQL databases to NoSQL MongoDB. In Computer Science and Information Systems
(FedCSIS), 2016 Federated Conference on (pp. 837-840). IEEE.
Wu, C.M., Huang, Y.F. and Lee, J., 2015. Comparisons between mongodb and ms-sql
databases on the twc website. American Journal of Software Engineering and Applications,
4(2), pp.35-41.
1 out of 13
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.