Hey there,
To be a better engineer it is important to know the fundamentals of the database because everything we build and design involves data and how we handle it, to make our systems more efficient and scalable so this is a series on databases where we are going to discuss every type of database and its use cases, pro, and cons. After reading the series you would be in a position to take better decisions while building your systems and would be able to think in a very in-depth way about databases which to use and when and were
What is a Database?
A database is a tool that stores data, and lets you create, read, update, and delete the data in some manner.
This definition is given by Rod Stephens in his book Database Design Solutions he states that anything that lets you store information and let you manage the data either update or delete is called a database
example :
A shopkeeper lists all the items and their stock available in his shop in a notebook which is a database for his/her store.
Types of databases
There are a wide variety of databases that are used based on the use case
A database is a tool that stores data, and lets you create, read, update, and delete the data in some manner.
This definition is given by Rod Stephens in his book Database Design Solutions he states that anything that lets you store information and let you manage the data either update or delete is called a database
example :
A shopkeeper lists all the items and their stock available in his shop in a notebook which is a database for his/her store.
Types of databases
There are a wide variety of databases that are used based on the use case
These represent data stored in simple files in text format and may have delimiters separated to structure the data stored. Flat files are good places to store configuration settings. These don’t provide features like searching and indexing or data concurrency.
[/etc/passwd]()
and [/etc/fstab]()
on Linux and Unix-like systemsCSV
filesINI
files (INI stands for ‘‘initialization’’).Hierarchical databases build a tree-like structure which somehow creates a child and parent relationship to categorise the data
example
Network databases are more like the Hierarchical but instead of always having a single parent, as in hierarchical databases, network database entries can have more than one parent It's more like a node connected with one or more nodes. It basically builds a graph-like structure with the data
In the below image we can see the order is related or connected to the manager, salesman and customer
Example:
These most widely used databases and are the majority among the databases which are in production around the world
A relational database contains tables that hold rows and columns. Each contains related data about a particular entity (person, vehicle, sandwich, etc….).The tables are created using strictly using the schema and linked with one another using primary and foreign keys. They come with a huge variety of features that makes life easier and all of these will be discussed detailed in the upcoming articles
Below is a schema of the relational database
Examples:
Examples:
These are called the modern standard databases which are designed with a different approach than the traditional SQL databases. The term NoSQL means “not only SQL ” or “non SQL”
They are again sub-divided into many categories and they are
These represent data stored in simple files in text format and may have delimiters separated to structure the data stored. Flat files are good places to store configuration settings. These don’t provide features like searching and indexing or data concurrency.
[/etc/passwd]()
and [/etc/fstab]()
on Linux and Unix-like systemsCSV
filesINI
files (INI stands for ‘‘initialization’’).Hierarchical databases build a tree-like structure which somehow creates a child and parent relationship to categorise the data
example
Network databases are more like the Hierarchical but instead of always having a single parent, as in hierarchical databases, network database entries can have more than one parent It's more like a node connected with one or more nodes. It basically builds a graph-like structure with the data
In the below image we can see the order is related or connected to the manager, salesman and customer
Example:
These most widely used databases and are the majority among the databases which are in production around the world
A relational database contains tables that hold rows and columns. Each contains related data about a particular entity (person, vehicle, sandwich, etc….).The tables are created using strictly using the schema and linked with one another using primary and foreign keys. They come with a huge variety of features that makes life easier and all of these will be discussed detailed in the upcoming articles
Below is a schema of the relational database
Examples:
Examples:
These are called the modern standard databases which are designed with a different approach than the traditional SQL databases. The term NoSQL means “not only SQL ” or “non SQL”
They are again sub-divided into many categories and they are
These are the simplest databases that stores data as key-value pairs like a Hashmap (”name ”:” Virat Kohli” )
examples
Document databases are an advanced version of key-value databases in which document databases store data in structured formats called documents, often using formats like JSON, BSON, or XML. They use a key to uniquely identify data within the document. They don't have any rules to maintain strict schema so documents can store dynamic data for example
The User document can store both the user data
{
"_id":123455,
"name":"james",
"age":43,
"salary":400000
}
{
"_id":123456,
"name":"john",
"age":43
}
Examples
Graph databases are Nosql databases that follow a different approach they establish connections between nodes using the graph concepts
each node can be connected to any node using an edge which creates a relationship. Graph databases are most useful when working with data where relationships or connections are highly important. For example in a social media application, fetching the data may require making a lot of joins among the tables which is a tedious task on the other hand using these kinds of databases make the work simple.
Examples:
Column family databases are wide-column Nosql databases that seem like SQL databases but they are completely different. In Column databases, they have column families instead of tables and each of them has rows that can define its own schema and can contain many columns. It is more like a key-value pair database where each key has a dictionary of arbitrary values
Column-family databases are good when working with applications that require great performance for row-based operations and high scalability.
Examples:
Time series databases are like key-value databases which are purely designed to store the data which changes over time like storing the CPU temperature at different time stamps
These are generally used to store system data and they are mostly used in IoT (Internet of things) systems.
Examples:
These are the simplest databases that stores data as key-value pairs like a Hashmap (”name ”:” Virat Kohli” )
examples
Document databases are an advanced version of key-value databases in which document databases store data in structured formats called documents, often using formats like JSON, BSON, or XML. They use a key to uniquely identify data within the document. They don't have any rules to maintain strict schema so documents can store dynamic data for example
The User document can store both the user data
{
"_id":123455,
"name":"james",
"age":43,
"salary":400000
}
{
"_id":123456,
"name":"john",
"age":43
}
Examples
Graph databases are Nosql databases that follow a different approach they establish connections between nodes using the graph concepts
each node can be connected to any node using an edge which creates a relationship. Graph databases are most useful when working with data where relationships or connections are highly important. For example in a social media application, fetching the data may require making a lot of joins among the tables which is a tedious task on the other hand using these kinds of databases make the work simple.
Examples:
Column family databases are wide-column Nosql databases that seem like SQL databases but they are completely different. In Column databases, they have column families instead of tables and each of them has rows that can define its own schema and can contain many columns. It is more like a key-value pair database where each key has a dictionary of arbitrary values
Column-family databases are good when working with applications that require great performance for row-based operations and high scalability.
Examples:
Time series databases are like key-value databases which are purely designed to store the data which changes over time like storing the CPU temperature at different time stamps
These are generally used to store system data and they are mostly used in IoT (Internet of things) systems.
Examples: