Databases for web developers

 

Databases for web developers

Members who have contributed in this blog

Onkar Kulkarni

Shantanu Inamdar

Kunal Ingale

Rutik kadam



Do you know that there are more than 300 databases available!!!

 

Quite surprising. Among these databases, few of them are popular based on their category. Yes, there are categories in databases as well, this will seem confusing while selecting perfect database. This blog is going to answer all of your questions and will give you the idea of most of the databases. But first of all, let us first understand what is database and why it is needed.

 

For any application to work there is a need of data. According to an article on ‘Forbes’ we produce approximately 2.5 quintillion bytes of data each day. You can understand this like, we are producing 2.5 billion gigabytes of data each day, and this number is going on increasing. Of course, we need some way to organise this data; such that we can store it and retrieve it faster. Based on the ways to organise these data, there are different types of databases and are listed below:



Fig.1 Graphical representation of databases


  • 1.     Hierarchical Databases.
  • 2.    Relational Databases
  • 3.    Document Databases
  • 4.    Key-value Databases
  • 5.    Wide column Databases
  • 6.    Graph based Databased
  • 7.    Object oriented Databases.
  • 8.    Time series database



Hierarchical Databases.


A hierarchical database is a pattern in which data is stored in the form of records and planned-stored into a tree-like structure or parent-child structure in this model parent and child’s records are connected through links.

Fig.2 Hierarchical database model

 

What is a Hierarchical Database?

As it’s name suggesting its meaning, hierarchical databases is known for it’s tree-like organization .These database model is most efficient use cases which focus of information , such as several individual worker reporting to a single department at a company.

typically a root “parent” directory of data stored as records that links to other subdirectory or child directory, and each subdirectory branch, or child record can be a parent of other child records

each child record can only have one parent record. Data within records is stored in the form of fields and it contain only one value.

 Advantages and Disadvantages

Advantage of a hierarchical database

is its ease of use . traversing the database simple and quick, which is ideal for use cases such as website drop-down menus or computer folders in systems like Microsoft Windows OS.  separation of the tables from physical storage structures adding and deletion of information can be done without affecting the entirety of the database. 

 Disadvantage of hierarchical databases is their inflexible nature. Cannot support complex relationship. Requires top-to-bottom sequential searching for tree-like organization of data.



Relational Databases


The Relational Database is as the term gives the idea, Relational database is a tool that holds any type of information related to each other (i.e two databases having similar information). For instance, A social media company has a list of their customers and other databases have the detail of the customer.

 The Relational Database has a vast range of usage, It can be used in many fields and is popular even today because it is easy to use, convenient, and reliable technology, It is very useful in managing data, and their relations.

Here in this blog, we'll see the bit history and how Relational Database works.




Fig.3 Relational database model

In 1970 at IBM the terminology "relational database" was coined by E. F. Codd. In his paper and later papers, he described what he meant by "relational". A very known definition of what consists of a relational database system is composed of Codd's 12 rules.

In 2009, most commercial relational DBMSs employ SQL as their query language.

 

Present the data to the user as relations (a presentation in tabular form, i.e. as a collection of tables with each table consisting of a set of rows and columns);

 

Let us now look at what exactly is a SQL. SQL is used to retrieve data from relational databases.

SQL stands for Structured Query Language. SQL is a domain-specific language used by programmers and designed to manage the  data held in a relational database management system (RDBMS). It is particularly useful in handling structured data, managing the data in easier manner.

SQL offers few major advantages over older read–write APIs such as  VSAM or ISAM . As, it introduced the concept of accessing more than one records with one single command. And it reduct the necessity  to specify how to reach a record, e.g. with or without an index.

Examples: mySql, oracle, PostgreSQL.



Document Database

What is a document database? Also known as a document-oriented database or document store, it is a NoSQL database that stores data as structured documents instead of rows and columns. XML), binary JSON (BSON), or another markup language (YAML) for defining, storing, managing, and retrieving data.


Fig.4 Document Database model

Document database model How does a document database work? Document database software stores or retrieves information in the form of a document or semi-structured database.You can manage these non-relational documents based on key-value pairs instead of a tabular schema of rows and columns. Document databases can analyze documents regardless of the type of data stored. This flexibility in data storage makes it easy for developers to query, add, edit, and delete. However, you can still use different file format schemes to define document structures. Some developers believe that document databases are less secure
than SQL databases.Using the Document Database Document databases are ideal for storing
unstructured data such as profiles, catalogs, and large documents.

When to use a document database:

·        Build CRUD apps

·        Store non-tabular data

·        Store, manage, and retrieve different data patterns and types

·        Handle continuous reads and writes with fast in-memory access

Example: According to DBEngines MongoDB is at top.



Key-Value Database


It’s like Lock-and-key; once you have the key, you will get the access to data. Key-value is non-relational type of database, and most probably the simple form of databases that we’ve seen so far. This key-value database uses associative array to store the data, which can be easily retrieved once we know the key. Key-value database use NOSQL to retrieve the data.

 

Fig.5 Key-value pair database model


These type of databases are not recommended to use for complex applications. But on the other hand, these databases makes system easy to use and provides high performance.

According to an answer given on The main difference between Document database and key-value database is that “A document database is, at its core, a key/value store with one major exception. Instead of just storing any blob in it, a document db requires that the data will be store in a format that the database can understand (i.e. JSON, XML etc). In most doc dbs, that means that we can now allow queries on the document data.

Limitations:

We cannot retrieve a value without using key.

Examples:  According to survey on DB-Engines[1], Redis is the no.1 rank holder in this category.



Wide column Database

These are very scalable databases and also known as extensible record stores. It has ability to store very large amount of dynamic columns. It can be also seen as two-dimensional key-value stores, since a record in this category can have billions of columns.[2]

The wide column databases add variable column names, since individual columns are vertically partitioned.


Fig.6 Column based database model

Wide column database are used in scenario where you have unstructured data; like user preference.

Limitations:

These types of databases are not immediately consistent across all the places where data has been stored.

Example: According to DB-ENGINES; Cassandra has scored rank one, followed by HBase.




Graph based Databases



You can imagine these types of databases as mathematical graphs, which has nodes and some nodes are connected to some nodes. This approach of storing data using graph actually gives upper hand to maintaining relationships among data.

In this types of databases, data are the nodes and edges are the relations. As well as they allow easy processing of data. Unlike SQL  no universal graph query language has been adopted.

 




Fig.7 Graph based Databases

 

The effective use of graph based databases are in social media applications, recommendation engine, etc.

The data are stored in doubly-link list format or adjacency list. To retrieve data, there are graph query languages like Cypher which is developed by neo4j.

 

Limitations:

Performance get affected when it comes to large amount of data.

 

Example: According to DB-ENGINES; Neo4j has scored rank one.




Object Oriented Database:


The Short of Object Oriented Database is OODB, It was developed in 1980s motivated by similar term for programming called OOPL or Object Oriented Programming Language. The objective was that in database the objects were stored in the corresponding manner as it represents in programing language. The inheritance and polymorphism has to be maintained in the database as it'll be easier to understand and to handle.

 

The OODB follows an Object Oriented Data model with classes, methods and property. In modern years, The classic relational Database management system upgraded with some object oriented features; like, user-defined data type, etc

 

Popular Example of OODB:

InterSystems Cache

InterSystems IRIS

ObjectStore

 

Fig.8 Object-oriented database model[3]

 

Object-oriented databases closely relate to object-oriented programming concepts. The four main ideas of object-oriented programming are:

  • ·       Polymorphism
  • ·       Inheritance
  • ·       Encapsulation
  • ·       Abstraction


Advantages

            The main advantages are:


·       Complex data and a vast variety of data types with compare  to MySQL data types.

·       Easy to manipulate the data I.E To store, upgrade, save and retrieve data quickly.

·       Seamless blending  with object-oriented programming languages.

·       It is easier to model advance real life problems.

·       It is flexible  with custom data types.

 

Disadvantages

Some cons are :


·       Not as vastly  adopted as relational databases.

·       It have no data model universally .

·       Lacks theoretical basis and standards.

·       It does not support views.

·       Due to it's high complexity, it causes performance issues.






Time Series DBMS


The time series DBMS is a database management system that is optimized for managing time series data; All entry is associated with timestamp.

The time series DBMS are created to efficiently to collect, store and query many time series with big transaction volumes.It is a very unique type of database management system, optimized for gathering , keeping , sorting  and processing series of values regarding a timestamp.

Most popular examples

InfluxDB

RRDtool

Prometheus

Graphite

TimescaleDB

InfluxDB is the most popular time series DBMS now. It is a powerful features such as flexible retention policies for time series values or continuous queries for downsampling the data, make InfluxDB an attractive choice.

One of the most basic tool in our list of Time Series DBMS is RRDtool, where time series data are stored - and removed - in a fixed round-robin manner.

The next system in the ranking is Graphite, which is just not only an open source DBMS, but also comes with built-in graphing and monitoring capabilities.

 

Advantages

It helps to understand the past behavior and would be helpful for future predictions.

The statistical technique has been developed so that the time series can be analyzed in such a way that the factor that influences the fluctuation of the series may be identified

It helps to compare the performance of two different series of a different type for the same time duration.

The analysis of time series helps us to compare the present performance of the series with that of the past.

 

 

Disadvantages

 The conclusion drawn from the analysis of time series is not always perfect.

The various factor that affected the fluctuations of a series cannot be fully adjusted by the time series analysis.

The various factor that influences the time series may not remain the same for an extended period of time and so forecasting made on this basis may become unreliable.

Sometimes the increasing trend in the time series data may be due to the increase in population. So, unless a necessary modification is made to the data it would be difficult to understand the trend.



Conclusion:

Databases today are essential to every business. Whenever you visit a major Web site - Google, Yahoo!, Amazon.com, or thousands of smaller sites that provide information there is a database behind the scenes serving up the information you request. Corporations maintain all their important records in databases. In this blog we learned a lot of information concerning different databases. Also we have seen specification, advantages, disadvantages of each of them. So, above discussion shows the importance of databases and its applications, Now, I hope its clear that, when to use which type of databases and many more of your questions.


References:

[1]          DB-Engines Ranking - popularity ranking of database management systems

[2]          Wide-column store - Wikipedia

[3]          Basic Object Oriented Data Model - GeeksforGeeks

The Different Types of Databases - Overview with Examples (prisma.io)

Database Types Explained {11 Database Types Explained} (phoenixnap.com)

























Comments

Post a Comment