Three Schema Architecture .:.

Shehan PW
4 min readJul 20, 2020

Database schema and a Database state and the difference between them. Conceptual schema, External Schema/Level, Internal Data Level.

Database schema in a database is described as the framework of tables or as where the skeleton of how each table speeded. Databases schema is essentially the blueprint of a database where it contains details of each individual table describing what type of a there is in, what is the name to the table, how many columns and rows and keys and also each individual property for each section of column. This description of the database describes how the database itself behave for each input of data and how the output from database should behave.

Advantages Database Schema

· Data can be independently managed of the physical storage

· Faster Migration to new graphical environments

· it is possible to use different sets of developers on different set of developers

· It is better, because the customer has no direct access to the business logic of the database

· No data loss in the event of a failure, as you are always secure by accessing the other level

Disadvantages Database Schema

· Complete DB Schema is a complex structure that is difficult for everyone to understand.

· Physical separation of levels may affect the Database performance

Specially there are two types of database schemas available in the market where they are SQL related and SQL unrelated described as SQL and NoSQL databases. SQL database use the schema as relational databases and also SQL where it describes how each individual data pair related to each other. Where non-relational database schema work as a file structure of no data related to each other. Therefore, there can be duplications exist and also the main id is generated itself and data itself is described in json format.

Ex: SQL : MYSQL database

customer_services.jobs(job_id INT PRIMARY KEY IDENTITY,customer_id INT NOT NULL,description VARCHAR(200),created_at DATETIME2 NOT NULL);

Ex: NoSQL: mongo DB

collection.updateOne({ "_id": BSON.ObjectId("5ae782e48f25b9dc5c51c4d0") },{ "$set": { "name": 42 } })

Database state is described as data itself in the database considering any given moment of time.

There are two moments to a database where there are initial database state and valid state. In the case of database schema versus database state where there are very few updates occur in database schema frequently and almost nothing compared to database state. Database state on the other hand has too much update when every time CRUD (create-data, Read-data, Update-data, Delete-data) activities happens. In initial state of database is referred as when the database is in loading. Best example to the initial state is when doing data streaming. When a video is loading it does take some time to fully loaded in. In order to reduce the loading time databases jumps from initial state to the valid state frequently.

!!!Describe the three-schema architecture.!!!

Three schema architecture is essentially the base architecture for every database system available. This was back in the 1980s when it invented as the first database architecture.

Finally let’s get in to the actual three schema architecture

Photo by Ian Battaglia on Unsplash

1)Internal Data Level:

The internal data-level or known as physical data Schema is what the actual database design is, and where it explains how each individual data laid in to the database or in to the actual hard drive itself. Since this Is in the very bottom level in the data base systems, there are many data structures available in order to describe how data is created. Ex:(hash, b-tree, flat). There need to be a very efficient data structure available and implemented in order to deliver, store and read data.

Ex: Heaps, queues, B -tree, Hash maps.

2) Conceptual schema:

Conceptual schema describe as how database interact with data. In this stage the data base physical structure is hidden and also physical structure is been used in the back-end. Therefore, conceptual schema is been used as physical schema’s interface. Interaction with data and people between database runs a huge roll in databases. It needs to have conditions and criteria’s in order to store and retrieve data. Conceptual data schema includes CRUD (create-data, Read-data, Update-data, Delete-data) operations, key and more. Conceptual schema Is very y necessary when it comes to deal with the database where it defines entries, attributes and also relationships with other databases and interfaces. conceptual design helps to design and develop the integrity information and security to the database.

3)External Schema/Level:

External schema is the schema where the user interacts with it. in another words external schema is the interface for conceptual schema. In this level most amount of data is hidden from users’ only get to see the data that only they are allowed to see and interact with. It is not possible to alter databases as the users wish. There fore this level is also known as the view level.

Ex: filling a form in order to send to the database for store.

Click like button and updates you profile in the databases as you like a post.

--

--

Shehan PW

Full-stack web developer | Block-chain developer . (MERN stack && MARN stack). System Design and Development || NodeJS || JavaScript || Java || REACT || etc