Terms you should know in the Database as a back-end Developer.

Terms you should know in the Database as a back-end Developer.

In the previous blog, I talked about the databases and the file system. If you haven't seen that blog yet then the link is here. Well, Let me repeat what is Database to refresh our memory.

What is Database?

A database is a systemic way of collecting data for easy access and management. This data can be Images, Videos, PDFs, or some files with unique extensions. Since databases are used to manage, retrieve or handle the data in the real-time sites present on the world wide web and they are dynamics. Databases can be made with query languages and some of them are SQL or non-SQL. SQL stands for structured query languages some of the popular databases using SQL are MySql, PostgreSQL, Oracle, or SQL Server. Non- SQL are those which doesn't use SQL protocols and rules and some of them are MongoDB, CouchDB, CouchBase, Cassandra, etc.

This is pretty much about the database, let's dig into some serious and good knowing terms in the database.

Data Models or Database Model

A Data model defines the Structure and logical design of a database like how data will be stored, How will we access it, and how we update it according to our needs. There are many database models available in the Database management system but a widely used one is Relational Model. Well, not to ignore any model let's learn about each of the models.

1. Relational Model

In this model, Data is stored in a two dimensional way means data will be available to us in a row and column format and the relationship will be maintained by storing a single field like if we have a table then our data will be stored in the table manner and there will be no substitute of the table.

The basic structure of data in the relational model is Table and all the information will be stored in rows and columns. Hence, tables are known as relations in Relational Model.

2. Hierarchical Model

If you have studied trees a little bit in the data structure then this model will be a piece of cake for you.

This Model organizes the data in a tree-like structure and a single root to which all the other data is linked. The hierarchy starts from the root node then adds the parents and the parents add the child node and this becomes our whole tree-like structure.

This model shows the one-to-many relationship like Madhya Pradesh State in India has many cities, districts, and rural areas and other examples can be one university having many Professors.

3. Network Model

A network Model is like an extension or somewhat like of Hierarchical model which we learned earlier but there is one simple difference that is it uses a graph-like structure instead of a tree in a hierarchical Model.

This model shows the many to many relationships among each other. In this database model data is more related as more relationships are established in this database model. Also, as the data is more related, hence accessing the data is also easier and fast.

This Data model was widely used before the relational database was introduced.

4. Entity-relationship Model

In this database model, relationships are created by dividing the object of interest into the entity and its characteristics into attributes like the student has their own Id, name, address, age, etc. E-R Models or Entity-relationship models are defined to represent the relationships in pictorial form to make it easier for different stakeholders to understand.

**That was all about data models which should be good to know.

Schemas

Schemas in the database are the skeleton structure that represents the logical view of the complete database. In other words, Schema is the global design of a database.

The database has objects like tables, views, indexes, constraints, procedures, Packages, etc. All these objects are owned by a particular user. This user is called a schema. Schema owns the ownership of all their objects. In a database, we can have multiple user – schemas with their own objects. The objects in one schema can be different from objects in other schemas. Here individual schema will have a specific role and purpose for the task.

A database schema is categorized as below:

  1. Logical database schema
  2. Physical database schema
  3. View schema

    1. Logical Database Schema: This schema defines all the logical constraints that require to be applied on the information stored. It defines tables, views, and integrity constraints.

Note here: Constraints are nothing but some rules that are used to specify the data in a table.

  1. Physical Database Schema: This schema pertains to the particular storage of information and its kind of storage like files, indices, etc. It defines how the information will be stored in exceedingly auxiliary storage.
    1. View schema: View schema is outlined because of the style of a database at the view level that usually describes end-user interaction with database systems.

Instance

It is very easy to understand instances in the database. Let me relate it with Schemas. We know schemas are a full descriptions of the database but Instances are Nothing but a specific description in a database at a particular time. Schemas are unchangeable but Instance is changeable and we can update it.

Proper Definition:- In simple words, it is the snapshot of the database taken at a particular moment. It can also be described in a more significant way as the collection of the information stored in the database at that particular moment. An instance can also be called as the database state or current set of occurrences due to the fact that it is information that is present at the current state.

Architecture of DBMS

Architecture is like a setup where programmers can communicate with the database for quick response.

Database Architecture is logical of two types:

  1. 2-tier DBMS architecture
  2. 3-tier DBMS architecture

2-tier DBMS architecture *

2-tier DBMS architecture includes an Application layer between the user and the DBMS, which is responsible to communicate the user's request to the database management system and then send the response from the DBMS to the user.

image.png

3-tier DBMS Architecture

3-tier DBMS architecture is the most commonly used architecture for web applications. In the 2-tier architecture, we have an application layer that can be accessed programmatically to perform various operations on the DBMS.

In a 3-tier architecture, an additional Presentation or GUI Layer is added, which provides a graphical user interface for the End-user to interact with the DBMS.

image.png

If you have used MySQL, then you must have seen PHPMyAdmin, it is the best example of a 3-tier DBMS architecture.

Did you find this article valuable?

Support piyushyadav0191 by becoming a sponsor. Any amount is appreciated!