Urgenthomework logo
UrgentHomeWork
Live chat

Loading..

Ict704 Non Relational Database Systems Assessment Answers

  59 Download     📄   5 Pages / 1117 Words

Create a MongoDB database 
- Insert data into MongoDB using the insert command 
- Create indexes
- Create the queries and other actions

Answer:

Structure of the database:- 

We have only one collection in our database "movie". This collection of the movie has various movie documents. Each movie document contains information about a movie. To contain this information, each movie document has various attributes like MovieID, MovieName, ReleaseDate etc. Apart from these attributes, each movie is related to Rating. One movie can have zero or more ratings but one rating can be related to one and only one movie. A rating is a document containing information about movie reviews. We have used embedded relationship approach in our database. All the ratings are stored as an array inside the movie document. 

Example Movie document:- 

db.movie.insert( { "MovieID" : "1" , "MovieName" : "2001" , "Director" : "Stanley Kubrick " , "Leading actors " :  "Daniel Richter, Gary Lockwood, Keir Dullea, William Sylvester" ,

"ReleaseDate" : "1968" , "OscarsWon" :  1 , "Country" : "USA" , "ratings" :

 [ { "MovieID" : "1" , "ReviewedBy" : "Joe" , "Date" : "6/15/18" , "Rating" : 9 , "Comments" : "The best ever!" } ,

{ "MovieID" : "1" , "ReviewedBy" : "Howie" , "Date" : "6/9/18" , "Rating" : 7 } ] } );  

This example shows a movie document having MovieId 1 and name 2001. This movie document has array ratings which have two rating documents. These rating documents are an integral part of the Movie. 

Indexes created in the database:- 

We have created the following index in our database: 

db.movie.createIndex({"MovieID":1, "MovieName":1}); 

This index is a combination of two attributes MovieID and movieName. 1 with these attributes denotes that we are using ascending order while creating these indexes. Indexes play a very crucial part in improving the performance of queries in the database. We just have 25 records in the database. So the results of applying indexes are not noticeable. But when our database size will grow considerably larger, we can easily notice the differences 


Handing of relationships in Database:- 

We have a Zero to Many relationships in our database. Each movie document can have zero or more rating documents related to it but each rating document can have one and only one movie document related to it. We are using an embedded relationship approach in our database, so all the rating documents are embedded inside the movie document. We have one attribute ratings in our movie document which contains an array of all the ratings associated with that movie.  

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

MongoDB:-  

There are two ways to handle the relationship in Mongo DB: 

  1. Embedded Approach:- 

In the embedded approach the child documents are persisted inside the parent document.  The child documents do not have a unique identifier (_id) provided by Mongo DB. Mongo DB provides this identifier only to the root documents. 

Advantages of Embedded Approach:- 

  1. Read operations result in better performance as all the embedded documents are also fetched with the root documents. 
  1. as all the embedded documents is also an integral part of the main document. So when we delete the main document, all the embedded documents associated with it are also automatically deleted. 

Issues of Embedded Approach:- 

  1. Write operations are costlier in the embedded approach as the child documents are also a part of the main document. 
  1. Data size grows very rapidly in embedded approach as the embedded documents reside inside parent document. Size of the child documents also adds to the size of the main document. Mongo DB limits the size of a document to 16MB. So it may be a problem. 
  1. A unique id (_id) is not set on nested subdocuments by default as it is only on root documents. 
  1. Data Inconsistency may occur if a document copy is embedded in more than one main document. In such cases, any updating may result in inconsistency among records. 
  1. Reference Approach:- 

In the referenced approach, the child documents are stored in a separate collection. Instead of storing the child documents, we only store references to these documents. Every referenced document has a unique identifier (_id) provided by Mongo DB.  If many records refer to the same document then it is better to use the referenced approach as it is less prone to errors. Any updates will update a single document and this updated document provides the updated value to all documents referencing it. 

Advantages of Reference Approach:- 

  1. 1. It is better to use this approach if we have a large number of associated elements as all the associated elements will have their own size and this will keep the size of the main document within 16 MB which is the size limit of a document in MongoDB. 
  1. Each referenced document is a unique document. So it can be referenced by more than one parent document at the same document. SO we will not have to duplicate the records. Also as the records are not duplicate data consistency is there. Any change in the referenced document will reflect this change in all the parent documents. 
  2. Each referenced document is a separate document having own unique identifier. They exist separately as a collection in Mongo DB. So even if the parent document is deleted, the referenced document remains to exist as a separate document.   

Issues of Reference Approach:- 

  1. Read operations are costlier in referenced approach. We will need multiple queries to fetch the records associated with a document. It will take more than one queries. The first query will just fetch the references to the document and then the second query will fetch the referenced documents.  

Recommendations to Movie Maniacs for any additional functionality for the database;- 

  1. We can add a story attribute that will contain the story of the movie in brief so that the users can have an idea about the movie. 
  1. We can add a link attribute which will contain the link to the movie trailers. So any user can go to that link from the database and watch trailers of that movie. 
  1. We can also add an attribute location that will contain the location of various stores where the user can go and buy that movie. 

References: -

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

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

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.


Buy Ict704 Non Relational Database Systems Assessment Answers Online


Talk to our expert to get the help with Ict704 Non Relational Database Systems 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 Non Relational Database Systems 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.