Urgenthomework logo
UrgentHomeWork
Live chat

Loading..

Ict704 Handling Of Relationships In Assessment Answers

  4 Download     📄   5 Pages / 1184 Words

Create a MongoDB database using the data provided to you in the MovieData_Task2.xls spreadsheet. (There should only be one collection movies with each movie as a single document).
• Insert data from the provided .xlsx file into MongoDB using the insert command
• Create indexes which you think will be needed and beneficial
• Create the following queries (all output should be displayed in a formatted way):
o List all the movies in the collection
o List the movies that are from Japan
o List just the directors name(s) for every movie

o List the distinct names of every director
o Count the number of movies in the list
o Return only the movies that have won at least one Oscar
o List the movies that were released before 1980
o Return the title and average rating of each movie

o Return the title of movies that have had no ratings or comments
• Update the title of movie 6 to “E.T.”
• Add a new field called notes to the following movies:
o 12 Terminator and Terminator 2 are rated together
o 18 The trilogy consists of the three movies

For the report you are required to explain the structure of the database you created.This includes justifying the indexes you created. You need to describe how the relationships were handled in the database. In your report, discuss potential
alternatives to how the relationships could have been modeled and implemented in MongoDB and the benefits/issues of each. Provide recommendations to Movie Maniacs for any additional functionality for the database. 

Answer:

We have created these two indexes in our Movies collection. These two indexes are created on the basis of MovieId and MovieName. 1 in these indexes specifies that the indexes are created by ascending order. We have chosen MovieId and MovieName for these indexes as these are the most commonly used attributes while fetching the database. Making an index on these two attributes ensures improved performance while fetching results from the database. This performance improvement is not noticeable in our database as we just have 25 documents of data. But as our data will increase, these indexes will play a crucial role in fetching the required data in less amount of time.

Handling of relationships in our database:

We have used embedded relationship approach in our database design. So the Reviews documents related to the Movie are persisted in the same collection. We have Zero to Many relationships between movies and reviews. Reviews do not exist as a separate collection but they are an integral part of the Movie. Each movie can have one or more reviews but each review is associated with one and only one movie.

As the reviews are an integral part of a Movie document. These reviews cannot exist without the Movie document. If we delete any movie document, then all the reviews associated with that movie are automatically deleted. Also, _id is assigned only to the parent Movie document and not to the child Review documents All the crud operations like insert, update, delete etc. operate on top level documents i.e. the Movie document only and not on the child documents.

Potential alternatives to how the relationships could have been modelled and implemented in

MongoDB: - 

There are two main approaches to handling relationships in MongoDB database:


  1. Embedded approach: -

In this approach, the child documents are persisted in the parent collection. These child documents are an integral part of the parent document. They even don't have their own _id (identifier provided by Mono DB). These documents are just like any other attribute of a MongoDB document.

Advantages of Embedded Approach: -

  1. It helps in improving the performance as the query results are faster in case of embedded approach as compared to Referenced approach.
  1. The strong relationship is there between the parent document and the child document.
  1. Multiple documents cannot access nor have a relationship with the same document in the case of the embedded relationship.
  1. Queries on child entities are much easier in embedded approach as compared to the queries on child objects in Referenced approach.

Disadvantages of using Embedded Approach: -

  1. as all the child documents are an integral part of the parent document. So the size of the parent document increases drastically as the array size of the child document increases. Mongo DB imposes a limit of 16 MB document size. 
  1. No Unique Id is set on the child documents as it is only on root documents. 
  1. Child documents have the strong relationship with parent document. So they can't exist without the parent documents. The entire child documents associated with a parent is also deleted as soon as a parent is deleted in Embedded Relationship approach. 
  1. Referenced approach: - 

This is the second approach available to handle relationships in Mongo DB. In this approach, we do not store the children directly with the parents. But we just store the references of these documents inside the main parent document. These child documents exist as a separate document. As all these child documents exist as a separate document so their reference can be stored in more than one parent. These documents have their unique identifier (_id).

Advantages of Referenced Approach: - 

  1. We are just adding the reference to the documents and not the documents inside the parent document. So the size of the parent document will remain within 16 MB which is the limit specified by MongoDB. 
  1. Same child document can be used by more than one parent as we are just passing the references in the parent document. 
  1. Child documents are a separate entity. So, they can exist even without a parent. 

Disadvantages of Referenced Approach 

  1. The queries to fetch results from a database using the referenced approach are complexes and slower as compared to the embedded approach as we have to make multiple hits for fetching the results from child tables.

Recommendations to Movie Maniacs for any additional functionality for the database 

  1. We can also store the information about the movie trailers. If possible, we can store the link to these trailers so that any user can go and view the trailer at the given link. 
  1. We can also store links to some online sites that can provide the movie on rent or for purchase. 
  1. We can also add some information field where the user can find more information about the movie like brief information about the movie story etc. 

Bibliography

Alam, M. (2014) Oracle NoSQL database. New York: McGraw-Hill Education/Oracle Press.

Belloc, H. (1967) On. Freeport, N.Y.: Books for Libraries Press.

Broeck, E. and Cuypers, E. (2011) MS Word 2010. Berchem: De Boeck.

Copeland, R. (2013) MongoDB applied design patterns. Sebastopol, CA: O'Reilly Media, Inc.

Dayley, B. (2015) Sams Teach Yourself NoSQL with MongoDB in 24 hours. Indianapolis, Ind.: Sams.

Francia, S. (2012) MongoDB and PHP. Beijing: O'Reilly.

McCreary, D. and Kelly, A. (2014) Making sense of NoSQL. Shelter Island: Manning.

Mehrabani, A. (2014) MongoDB high availability. Birmingham: Packt Publishing.

Perkins, L., Redmond, E. and Wilson, J. (2018) Seven databases in seven weeks. Raleigh, N. C.: The Pragmatic Bookshelf.

Vaish, G. (2013) Getting started with NoSQL. Birmingham: Packt Publishing.

Word of the Wives. (2010) Gardners Books.


Buy Ict704 Handling Of Relationships In Assessment Answers Online


Talk to our expert to get the help with Ict704 Handling Of Relationships In Assessment Answers to complete your assessment on time and boost your grades now

The main aim/motive of the management assignment help services is to get connect with a greater number of students, and effectively help, and support them in getting completing their assignments the students also get find this a wonderful opportunity where they could effectively learn more about their topics, as the experts also have the best team members with them in which all the members effectively support each other to get complete their diploma assignments. They complete the assessments of the students in an appropriate manner and deliver them back to the students before the due date of the assignment so that the students could timely submit this, and can score higher marks. The experts of the assignment help services at urgenthomework.com are so much skilled, capable, talented, and experienced in their field of programming homework help writing assignments, so, for this, they can effectively write the best economics assignment help services.


Get Online Support for Ict704 Handling Of Relationships In Assessment Answers Assignment Help Online


Resources

    • 24 x 7 Availability.
    • Trained and Certified Experts.
    • Deadline Guaranteed.
    • Plagiarism Free.
    • Privacy Guaranteed.
    • Free download.
    • Online help for all project.
    • Homework Help Services
Copyright © 2009-2023 UrgentHomework.com, All right reserved.