You are on page 1of 7

The National University of Lesotho

Department of Mathematics and Computer Science


Distributed Database Systems.

C S 4 4 3 0
2016/17, Semester B.

A s s i g n m e n t 0 1 :
Relational and Non-Relational Databases

Due: February 21th 2017.

Compiled & submitted by:

1 Thekiso, J. T 201300127

2 Mokoma R.M - 201000481

3 Mahomo, S

4 Monyamane T - 201001217

5 Makepe, K -201301654
RELATIONAL DATABASE
A relational database is a collection of data items organized as a set of formally-described tables
from which data can be accessed or reassembled in many different ways without having to
reorganize the database tables. The relational database was invented by E. F. Codd at IBM in
1970.
A relational database is a set of tables containing data fitted into predefined categories. Each
table (which is sometimes called a relation) contains one or more data categories in columns.
Each row contains a unique instance of data for the categories defined by the columns. For
example, a typical business order entry database would include a table that described a customer
with columns for name, address, phone number, and so forth. Another table would describe an
order: product, customer, date, sales price, and so forth. A user of the database could obtain a
view of the database that fitted the user's needs. For example, a branch office manager might like
a view or report on all customers that had bought products after a certain date. A financial
services manager in the same company could, from the same tables, obtain a report on accounts
that needed to be paid.
DBMSs are generally classified according to how data is represented in the conceptual schema
(i.e. the conceptual data model). There are three main approaches:
(1) Relational
(2) Network
(3) hierarchical
Relational database technology is attractive both for its simplicity and for the fact that it has a
sound theoretical basis in mathematical relational theory. In a relational database, data is viewed
through two dimensional structures known as tables or relations. When describing a DBMS as
relational, we mean that it supports relations at the conceptual and external levels; at the internal
level there are no restrictions. Each table has a fixed number of columns called attributes, and a
variable number of rows called tuples.
Hierarchical and network DBMSs
Hierarchical and network systems were developed and commercialized almost a decade before
relational systems, and so their origins in traditional file processing systems are naturally more
evident. Unlike relational DBMSs which support set-oriented processing, both hierarchical and
network DBMSs are record-oriented, that is they process one record at a time. Furthermore,
while relationships in relational DBMSs are represented solely by attributes drawn from a
common domain, relationships in hierarchical and network systems are explicitly and visibly (to
the user) implemented by pointers. Hence while relational systems adopt a declarative approach
to database processing, hierarchical and network systems adopt a navigational approach. This not
only makes the actual writing of programs more difficult but also requires the user to keep track
of the current position in the database. Although relational systems are
rapidly replacing all other DBMSs, it can be argued that hierarchical and network systems offer
considerable advantages in performance. However, as relational DBMSs mature and disks and
CPUs get faster, these disadvantages are being overcome, even for large databases.
Advantages of using relational database:
1. Ease of use: The revision of any information as tables consisting of rows and columns is much
easier to understand.

2. Flexibility: Different tables from which information has to be linked and extracted can be
easily manipulated by operators such as project and join to give information in the form in which
it is desired.

3. Precision: The usage of relational algebra and relational calculus in the manipulation of he
relations between the tables ensures that there is no ambiguity, which may otherwise arise in
establishing the linkages in a complicated network type database.

4. Security: Security control and authorization can also be implemented more easily by moving
sensitive attributes in a given table into a separate relation with its own authorization controls. If
authorization requirement permits, a particular attribute could be joined back with others to
enable full information retrieval.

5. Data Independence: Data independence is achieved more easily with normalization structure
used in a relational database than in the more complicated tree or network structure.

6. Data Manipulation Language: The possibility of responding to query by means of a language


based on relational algebra and relational calculus e.g SQL is easy in the relational database
approach. For data organized in other structure the query language either becomes complex or
extremely limited in its capabilities.

Disadvantages of using relational database :

1. Performance: A major constraint and therefore disadvantage in the use of relational database
system is machine performance. If the number of tables between which relationships to be
established are large and the tables themselves effect the performance in responding to the sql
queries.

2. Physical Storage Consumption: With an interactive system, for example an operation like join
would depend upon the physical storage also. It is, therefore common in relational databases to
tune the databases and in such a case the physical data layout would be chosen so as to give good
performance in the most frequently run operations. It therefore would naturally result in the fact
that the lays frequently run operations would tend to become even more shared.

3. Slow extraction of meaning from data: if the data is naturally organized in a hierarchical
manner and stored as such, the hierarchical approach may give quick meaning for that data.
NON-RELATIONAL DATABASES
- Non-relational database is any database that does not follow the relational model
provided by traditional relational database management system. These categories of
databases are also referred as NoSQL databases.
- Provide mechanism for storage and retrieval of data which is modeled in means other
than tabular relations used in relational databases.
- Such databases have existed since the late 1960s, but did not obtain a NoSQL moniker
until a surge of popularity in the early 21st century, trigged by the needs of Web 2.0
companies such as Facebook, Google and Amazon.com.
- They have grown in popularity over the years because they were designed to overcome
limitations of relational databases in dealing with big data demands (i.e data that is
growing and moving too fast and it is too diverse in structure for conversional
technologies to handle).
- These databases are typically more scalable and flexible than their relational counterparts.
And they have evolved from relational technology in these ways:
Data models: They offer flexible schema design that makes it easier to update the
database to handle changing application requirements unlike relational databases
that require predefined schema.
Data structure: They are designed to handle unstructured data that doesnt fit
neatly into rows and columns. This matters as most of the data today is
unstructured.
Scaling: The system can be scaled horizontally by taking advantage of cheap,
commodity servers.
Development model: non-relational databases are typically open source which
means you dont have to pay any licensing fees upfront.
MongoDB is an example of most widely used non-relational database.
MongoDB represent data in collections of JSON documents.
The Mongo import utility JSON, CSV and TSV file formats.
Mongo query targets of data are technically represented as BSON( binary
JASON).

Further illustration of Data models:


Key-value stores
Key-value data stores sometimes considered to be the simplest form of data base. They are
usually schema-less. The data is stored in a form of a pair key->value, so key-value data model
resembles structure similar to strings, hashes, lists, sets sorted sets data structure (also known as
a map or dictionary). Keys are used as indexes to fetch the data (value) and this makes those
data stores much more efficient for data retrieval than classical RDBMS. This is incredibly fast
and can scale to large size. The key-value model can be extended to an ordered model that
maintains keys in lexicographic order.
Name of databases
Cassandra, Riak, Bigtale, Redis, memcahed

key

Type: student
Age: 23
Likes: play cards

Type: professor
Age: 58
Likes: play cards
Play basketball
Document-based stores
They save data without it being structured in schema, wit buckets of key-value pairs inside a
self-contained object.In general these databases store their data in the form of documents in
which key is used as an ID of the document and the value is the document itself, which can be
retrieved by ID. Various formats can be used as a metadata for document oriented DBs: XML,
JSON and some others.
In contrast with the traditional RDBMS, where every row follows the schema, in document-
oriented DBs each document may have a different structure. And usually document oriented
stores provide additional indexing based on document contents. Thats one of the main
enhancements of document stores over the more basic key-value store model. Both provide
querying mechanism based on the primary key, but in document store model one usually able
to query data also by the value (document) contents. Similarly to KV-stores, this type of DB
systems is less efficient when application requires multiple-key transactions.
Name of databases
CouchDB, MongoDB, OrientDB, SimpleDB, Terrastore
Graph Databases
They store data in flexible graph model that contains a node for each object. Basically it means
that data is stored in a form of nodes (vertices), while relations between data are presented as
edges that interconnect the vertices. These data stores considered to be NoSQL data bases,
because these systems dont offer SQL support and the data model is not similar to relational.
Nevertheless many of the Graph data bases, such as Neo4j , are fully ACID-compliant.its more
efficient for storing interconnected data and handling relational querying. Thus naturally they are
more suitable for dependency analysis problem solving and some of the social networking
scenarios.
Name of databases
AllegroGraph,DEX, Neo4j, FlockDB, Sones GraphDB
Column family stores
The term Column family means a pair that consists of key and value, where the key is mapped to
a value that is a set of columns. In analogy with relational databases, a column family can be
considered as a "table", while each key-value pair represent a "row". However using this analogy
we may illustrate one of the main differences between traditional RDBMS model and Colum-
family model, which is the fact that the same table (column family) can contain different
columns and different number of columns, while the traditional relational model is absolutely
strict about this. There is also a similarity to the most basic key-value model, since the row key
functions as a key, while the set of columns resembles the value. Due to the data model
specifics Column-families usually do not handle complex relational logic. Hence as in case of
the basic Key-value stores, if complex relational querying functionality is required, then it has to
be implemented in the client side.

REFERENCES:

(1) Bell, David and Jane Grimson. Distributed Database Systems. 1st ed. Britain: Library
of Congress Cataloging-in-Publication Data, 2017. Print.
(2) "What Is Relational Database? - Definition From Whatis.Com". SearchSQLServer.
N.p., 2017. Web. 18 Feb. 2017.
(3) "Advantages And Disadvantages Of Using Relational Databases".
Maxlogix.blogspot.com. N.p., 2017. Web. 18 Feb. 2017.
(4) "Mongodb For GIANT Ideas". MongoDB. N.p., 2017. Web. 18 Feb. 2017.
(5) "Pluralsight | Unlimited Online Developer, IT And Creative Training".
Pluralsight.com. N.p., 2017. Web. 18 Feb. 2017.
(6) Gurevich, Yuri. "Comparative Survey Of Nosql / New Sql DB Systems". (2015): 1-
87. Print.
(7) Ramkumar, R. Non-Relational Databases-Nosql. 1st ed. Pondicherry: Pope Paul II
College of Education Department of Computer Science. Print.

You might also like