Centralized database VS Distributed database and Different key attributes


Centralized database VS Distributed database



Centralized database

It is a simple type which works on client server basis. In this type clients or user are directly connected to the centrally totally located server. This server hosts the data of its client or user and helps them to store and retrieve data as requirement. This type of system is used in small scale industries which doesn't have to deal with large volume of data and user. Centralized database runs on single computer which may have single or multiple users. Since database is centralized, security is not a crucial part here. The maintenance of database is easier because of data are centrally stored. This type of system denotes allow unauthorized person to access data.

A centralized database (sometimes abbreviated CDB) is a database that is located, stored, and maintained in a single location. This location is most often a central computer or database system, for example a desktop or server CPU, or a mainframe computer.

In most cases, a centralized database would be used by an organization (e.g. a business company) or an institution (e.g. a university.) Users access a centralized database through a computer network which is able to give them access to the central CPU, which in turn maintains to the database itself.

All of the information stored on the CBS is accessible from a large number of different points, which in turn creates a significant amount of both advantages and disadvantages.

Advantages

  1. Suitable for small scale industries.
  2. Operation and maintenance is easier.
  3. Since it prevents, unauthorized person being accessed to database, it minimizes risk factor.
  4. It is simple to implement and manage.
  5. It has less or no risk of data loss.
  6. It has low cost of implementation and operation.
  7. It is suitable for small organization with limited data and users.
  8. High security can be provided.

Disadvantages

  1. Data are not secured in this type of system.
  2. Not suitable for large scale industries.
  3. Failure of centrally located serves will collapse whole network.
  4. It is not reliable as distributed system.
  5. The performance and service will degrade when the number of user increases.
  6. It is not appropriate for big organizations which have large numbers of users and computers 

Distributed database



A distributed database is a database in which storage devices are not all attached to a common processing unit such as the CPU and which is controlled by a distributed database management system (together sometimes called a distributed database system).

It may be stored in multiple computers, located in the same physical location; or may be dispersed over a network of interconnected computers. Unlike parallel systems, in which the processors are tightly coupled and constitute a single database system, a distributed database system consists of loosely coupled sites that share no physical components.

System administrators can distribute collections of data (e.g. in a database) across multiple physical locations. A distributed database can reside on network servers on the Internet, on corporate intranets or extranets, or on other company networks. Because they store data across multiple computers, distributed databases can improve performance at end-user worksites by allowing transactions to be processed on many machines, instead of being limited to one.

This type of database system is complex in structure, instead of storing and retrieving data from centrally located server, it uses several numbers of database and server randomly located at different place. It is the collection of multiple logically interrelated database which are distributed in many geographical locations. Since server are located at different locations user can experience a good speed of bandwidth. Similarly, backup and recovery process are lot easier there, which makes data more secured. This type of system is used by large organization who has to deal with large volume of data and user all around the world. Since it is distributed in nature there may arises security issue and are costly to maintain and operate. Simply, distributed database system is the collection of several number of centralized database system in different locations.

Advantages

  1. Backup and recovery of data is easier.
  2. It can handle large volume of data and user all over the word.
  3. User can experience high speed bandwidth.
  4. Failure of a site doesn’t affect the whole computer system.
  5. It is more reliable as compared to centralized database system.
  6. The performance and service are better than centralized system.
  7. It is suitable for big organization with large amount of data, database users and computers.
  8. Due to multiple servers, it can support large numbers of users and computers at a same time.

Disadvantages

  1. Very expensive to operate and maintain.
  2. Data security may be real issue.
  3. Complex to implement and manage
  4. Risk of data theft, hacking etc.
  5. Differences between centralized and distributed database system.

E-R Diagram 

It is a graphical representation of database. E-R Diagram is a graphical representation of different entities and their relationship.

E-R model is based on the perception of a real world that consists of a collection of basic objects (entities) and relationship among these objects.

The overall logical structure of a database can be express graphically by 

Rectangle: It represents of entity. It contains objects used in relational database.

Oval or Ellipse: it represents attributes (properties) entities.

Diamond: It represents relationship among entities.

Line: It is used to link attributes to entity sets and entity set to relationship and vice-versa.

Different key attributes:

➢ PRIMARY KEY

In DBMS is a column or group of columns in a table that uniquely identify every row in that table. The Primary Key can't be a duplicate meaning the same value can't appear more than once in the table. A table cannot have more than one primary key.

Rules for defining Primary key:

  1. Two rows can't have the same primary key value
  2. It must for every row to have a primary key value.
  3. The primary key field cannot be null.
  4. The value in a primary key column can never be modified or updated if any foreign key refers to that primary key.

What is the Alternate key?

  1. ALTERNATE KEYS is a column or group of columns in a table that uniquely identify every row in that table.
  2. A table can have multiple choices for a primary key but only one can be set as the primary key.
  3. All the keys which are not primary key are called an Alternate Key.

What is a Candidate Key?

  1. CANDIDATE KEY in SQL is a set of attributes that uniquely identify tuples in a table. Candidate Key is a super key with no repeated attributes.
  2. The Primary key should be selected from the candidate keys.
  3. Every table must have at least a single candidate key.
  4. A table can have multiple candidate keys but only a single primary key.

What is the foreign key?

  1. FOREIGN KEY is a column that creates a relationship between two tables. The purpose of Foreign keys is to maintain data integrity and allow navigation between two different instances
  2. of an entity. It acts as a cross-reference between two tables as it references the primary key of another table
  3. In this key in dbms example, we have two table, teach and department in a school. However, there is no way to see which search work in which department.
  4. In this table, adding the foreign key in Deptcode to the Teacher name, we can create a relationship between the two tables.

What is the Compound key?

  1. COMPOUND KEY has two or more attributes that allow you to uniquely recognize a specific record.
  2. It is possible that each column may not be unique by itself within the database.
  3. However, when combined with the other column or columns the combination of composite keys become unique.
  4. The purpose of the compound key in database is to uniquely identify each record in the table.

What is the Composite key?

  1. COMPOSITE KEY is a combination of two or more columns that uniquely identify rows in a table. The combination of columns guarantees uniqueness, though individually uniqueness is not guaranteed. Hence, they are combined to uniquely identify records in a table.
  2. The difference between compound and the composite key is that any part of the compound key can be a foreign key, but the composite key may or maybe not a part of the foreign key.
  3. Column cust_Id alone cannot become a key as a same customer can place multiple orders, thus the same customer can have multiple entires.
  4. Column order_Id alone cannot be a primary key as a same order can contain the order of multiple products, thus same order_Id can be present multiple times.
  5. Column product_code cannot be a primary key as more than one customers can place order for the same product.
  6. Column product_count alone cannot be a primary key because two orders can be placed for the same product count.
  7. Based on this, it is safe to assume that the key should be having more than one attributes:
  8. Key in above table: {cust_id, product_code}
  9. This is a composite key as it is made up of more than one attributes.







Author Spotlight

Santosh Chapagain
Gmail: chapagainsantoshcs@gmail.com
Phone no: +977-9863512955

Post a Comment

0 Comments