Ecse Unit III
Ecse Unit III
Operating systems: Functions of operating systems, types of operating systems, Device &
Resource management Database Management Systems: Data models, RDBMS, SQL, Database
Transactions, data centers, cloud services .
1. Multiprocessor OS
Advantages
∙ It
allows the system to run multiple programs simultaneously.
∙ Beneficial for tasks that need to use all of the processor’s resources, such as games, scientific
calculations, and financial simulations.
Disadvantages
∙ They require additional hardware, such as processors and memory, making a system more
expensive.
2. Multi-programming OS
The operating system which can run multiple processes on a single processor is called a
multiprogramming operating system. There are different programs that want to get executed.
So these programs are kept in the ready queue. And are assigned to the CPU one by one. If one
process gets blocked then other processes from the ready queue are assigned to the CPU. The
aim of this is optimal resource utilization and more CPU utilization. In the below figure,
different processes are there in RAM(main memory). Some processes are waiting for the CPU,
and process 2(which was previously executing) is now doing I/O operations. So CPU shifted
to execute process 1.
3. Distributed OS
A distributed operating system is an operating system that is designed to operate on a network
of computers. Distributed systems are usually used to distribute software applications and data.
Users could be at different sites. Multiple computers are connected via a single communication
channel. Every system have its own processor and memory. Resources like disk, computer,
CPU, network interface, nodes, etc are shared among different computer at different locations.
It increases data availability in the entire system.
4. Multitasking OS
For example, a user running antivirus software, searching the internet, and playing a song
simultaneously. Then the user is using a multitasking OS.
5. Time-sharing OS
A time-sharing operating system is an application that provides a shared user interface with
multiple users logged in simultaneously. It allows multiple users to access the same resources,
such as files and applications, as long as they are logged in simultaneously. This type of
operating system is most commonly used in businesses, especially those that involve a high
number of simultaneous users. Time-sharing operating systems enable users to finish their jobs
on a system at once. The time-sharing OS is the latest advancement in the computer science
world; it is being accepted worldwide, also at an increasing rate.
6. Client/server network OS
Client/server network operating systems are those networks that contain two types of nodes,
the servers, and clients. The servers host the applications or services for users while clients use
these applications. In a client/server system, both the server and client computers must have
certain software installed to connect to each other securely over a network connection.
Client-server networks are a type of computer network in which two or more computer systems
are linked through a telecommunications network. Clients are the computers that use the
network to access services provided by the server. Servers are the computers that provide the
services to the network. Client/server networks are commonly used in business and government
applications.
7. Batch OS
There are different users and each user prepares their work in a standalone device such as
punchcards in batch operating systems and sends them to a computer operator. The various
systems split and distribute similar tasks in batches to facilitate computing and faster responses.
A single operator takes similar types of jobs that share similar needs and requirements, then
groups them in various batches. Similar kinds of jobs that share similar needs and requirements.
These types of operating systems are not used nowadays.
Device & Resource management
Device Manager displays a graphical view of the hardware that is installed on your
computer. Use this tool when you want to view and manage hardware devices and their drivers.
There are several features to this OS. The first is a GUI, or graphical UI/UX. This is what makes
it easy for almost anyone to operate a computer without any special training. Another
significant feature of the OS is device management. Device management is in charge of all the
computer system's hardware devices. It may also encompass the administration of the storage
device as well as all the computer system's input & output devices.
Device management is responsible for the following tasks: Device & component-level drivers,
as well as associated software, are installed. Using the packaged OS, business/workflow
software, and/or other hardware components, configure a device so that it functions as planned.
Putting in place security procedures and safeguards.
The state of each device, such as storage drivers, printers, and other peripheral devices, is being
monitored. Furthermore, predefined rules and decisions about which process receives the
device, when and for how long can be enforced, as well as the allocation and efficient release
of the device.
Monitoring the state of each device, applying current policies to decide which processes will
receive a device and for how long, allocating and dealing to locating devices at the process and
job levels are the four primary responsibilities. They are:
database is a collection of interrelated data that helps in the efficient retrieval, insertion, and
deletion of data from the database and organizes the data in the form of tables, views, schemas,
reports, etc. For Example, a university database organizes the data about students, faculty,
admin staff, etc. which helps in the efficient retrieval, insertion, and deletion of data from it.
What is DBMS?
A Database Management System (DBMS) is a software system that is designed to manage and
organize data in a structured manner. It allows users to create, modify, and query a database, as
well as manage the security and access controls for that database. DBMS provides an
environment to store and retrieve data in convenient and efficient manner.
Database
A database is a logical grouping of data. It contains a set of related table spaces and index
spaces. Typically, a database contains all the data that is associated with one application or with
a group of related applications. You could have a payroll database or an inventory database,
for example.
Table
A table is a logical structure made up of rows and columns. Rows have no fixed order, so if
you retrieve data you might need to sort the data. The order of the columns is the order specified
when the table was created by the database administrator. At the intersection of every column
and row is a specific data item called a value, or, more precisely, an atomic value. A table is
named with a high-level qualifier of the owner's user ID followed by the table name, for
example TEST.DEPT or PROD.DEPT. There are three types of tables:
A base table that is created and holds persistent data
Rows–Each row contains data for a single department. It is also called as tuple.
Values–At the intersection of a column and row is a value. For example, PLANNING is the
value of the DEPTNAME column in the row for department B01.
Creating an index automatically creates the index space, the data set that contains the index.
Keys
A key is one or more columns that are identified as such in the creation of a table or index, or
in the definition of referential integrity.
Primary key
A table can only have one primary key because it defines the entity. There are two
requirements for a primary key:
It must have a value, that is, it cannot be null. It must be unique, that is, it must have a unique
index defined on it.
Unique key
We already know that a primary key must be unique, but it is possible to have more than one
unique key in a table. In our EMP table example, the employee number is defined as the primary
key and is therefore unique. If we also had a social security value in our table, hopefully that
value would be unique.
Foreign key
A foreign key is a key that is specified in a referential integrity constraint to make its
existence dependent on a primary or unique key (parent key) in another table.
The example given is that of an employee's work department number relating to the primary
key defined on the department number in the DEPT table. This constraint is part of the
definition of the table.
Data Models
Data Model is the modeling of the data description, data semantics, and consistency constraints
of the data. It provides the conceptual tools for describing the design of a database at each level
of data abstraction.
Therefore, there are following four data models used for understanding the structure of the
database:
1) Relational Data Model: This type of model designs the data in the form of rows and
columns within a table. Thus, a relational model uses tables for representing data and in
between relationships. Tables are also called relations. This model was initially described by
Edgar F. Codd, in 1969. The relational data model is the widely used model which is
primarily used by commercial data processing applications.
Entity-
Attribute-
Relation-
4) Semi-structured Data Model: This type of data model is different from the other three data
models (explained above). The semi-structured data model allows the data specifications at
places where the individual data items of the same type may have different attributes sets. The
Extensible Markup Language, also known as XML, is widely used for representing the semi
structured data. Although XML was initially designed for including the markup information
to the text document, it gains importance because of its application in the exchange of data.
5) Hierarchical Model
This concept uses a hierarchical tree structure to organise the data. The hierarchy begins at the
root, which contains root data, and then grows into a tree as child nodes are added to the
parent node. If you wish to learn more about the hierarchical model, click here.
6) Network Model
The main difference between this model and the hierarchical model is that any record can
have several parents in the network model. It uses a graph instead of a hierarchical tree. If you
wish to learn more about the network model, click here.
All modern database management systems like SQL, MS SQL Server, IBM DB2, ORACLE,
My-SQL, and Microsoft Access are based on RDBMS.
How it works
From 1970 to 1972, E.F. Codd published a paper to propose using a relational database
What is table/Relation?
Everything in a relational database is stored in the form of relations. The RDBMS database
uses tables to store data. A table is a collection of related data entries and contains rows and
columns to store data. Each table represents some real-world objects such as person, place, or
event about which information is collected. The organized collection of data into a relational
table is known as the logical view of the database.
Properties of a Relation:
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
A row of a table is also called a record or tuple. It contains the specific information of each
entry in the table. It is a horizontal entity in the table. For example, The above table contains 5
records.
Properties of a row:
1 Ajeet 24 B.Tech
What is a column/attribute?
A column is a vertical entity in the table which contains all information associated with a
specific field in a table. For example, "name" is a column in the above table which contains all
information about a student's name.
Properties of an Attribute:
The smallest unit of data in the table is the individual data item. It is stored at the intersection
of tuples and attributes.
1 Ajeet 24 B.Tech
Degree:
The total number of attributes that comprise a relation is known as the degree of the
table. For example, the student table has 4 attributes, and its degree is 4.
1 Ajeet 24 B.Tech
2 aryan 20 C.A
3 Mahesh 21 BCA
4 Ratan 22 MCA
5 Vimal 26 BSC
Cardinality:
The total number of tuples at any one time in a relation is known as the table's cardinality. The
relation whose cardinality is 0 is called an empty table.
Domain:
The domain refers to the possible values each attribute can contain. It can be specified using
standard data types such as integers, floating numbers, etc. For example, An attribute entitled
Marital_Status may be limited to married or unmarried values.
NULL Values
The NULL value of the table specifies that the field has been left blank during record creation.
It is different from the value filled with zero or a field that contains space.
SQL
SQL is a database computer language designed for the retrieval and management of data in a
relational database. SQL stands for Structured Query Language. This tutorial will give you
a quick start to SQL. It covers most of the topics required for a basic understanding of SQL and
to get a feel of how it works.
SQL is Structured Query Language, which is a computer language for storing, manipulating
and retrieving data stored in a relational database.
SQL is the standard language for Relational Database System. All the Relational Database
Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres
and SQL Server use SQL as their standard database language.
Also, they are using different dialects, such as −
CREATE: to create a database and its objects like (table, index, views, store procedure, function,
and triggers)
ALTER: alters the structure of the existing database
DROP: delete objects from the database
RENAME: rename an object
GRANT: grant permissions to the user for running DML(SELECT, INSERT, DELETE,…)
commands on the table
REVOKE: revoke permissions to the user for running
Applications of SQL
As mentioned before, SQL is one of the most widely used query language over the databases.
I'm going to list few of them here:
● Allowsusers to access data in the relational database management systems.
● Allows users to describe the data.
● Allows users to define the data in a database and manipulate that data. ∙ Allows to embed
within other languages using SQL modules, libraries & pre-compilers. ∙ Allows users to
create and drop databases and tables.
● Allows users to create view, stored procedure, functions in a database.
● Allows users to set permissions on tables, procedures and views.
Database Transactions
Transaction in Database Management Systems (DBMS) can be defined as a set of logically related
operations. It is the result of a request made by the user to access the contents of the database and
perform operations on it. It consists of various operations and has various states in its completion
journey. It also has some specific properties that must be followed to keep the database consistent.
Operations of Transaction. A user can make different types of requests to access and modify the
contents of a database. So, we have different types of operations relating to a transaction. They are
discussed as follows:
i) Read(X)
A read operation is used to read the value of X from the database and store it in a buffer in the main
memory for further actions such as displaying that value. Such an operation is performed when a
user wishes just to see any content of the database and not make any changes to it. For example,
when a user wants to check his/her account's balance, a read operation would be performed on user's
account balance from the database.
ii) Write(X)
A write operation is used to write the value to the database from the buffer in the main memory. For
a write operation to be performed, first a read operation is performed to bring its value in buffer, and
then some changes are made to it, e.g. some set of arithmetic operations are performed on it
according to the user's request, then to store the modified value back in the database, a write
operation is performed.
For example, when a user requests to withdraw some money from his account, his account balance is
fetched from the database using a read operation, then the amount to be deducted from the account is
subtracted from this value, and then the obtained value is stored back in the database using a write
operation.
iii) Commit
This operation in transactions is used to maintain integrity in the database. Due to some failure of
power, hardware, or software, etc., a transaction might get interrupted before all its operations are
completed. This may cause ambiguity in the database, i.e. it might get inconsistent before and after
the transaction.
To ensure that further operations of any other transaction are performed only after work of the
current transaction is done, a commit operation is performed to the changes made by a transaction
permanently to the database.
iv) Rollback
This operation is performed to bring the database to the last saved state when any transaction is
interrupted in between due to any power, hardware, or software failure. In simple words, it can be
said that a rollback operation does undo the operations of transactions that were performed before its
interruption to achieve a safe state of the database and avoid any kind of ambiguity or inconsistency.
A transaction is a series of operations, so various states occur in its completion journey. They are
discussed as follows:
i) Active
● It is the first stage of any transaction when it has begun to execute. The execution of the
transaction takes place in this state.
● Operations such as insertion, deletion, or updation are performed during this state.
● During this state, the data records are under manipulation and they are not saved to the
database, rather they remain somewhere in a buffer in the main memory.
iii) Commited
This state of transaction is achieved when all the transaction-related operations have been executed
successfully along with the Commit operation, i.e. data is saved into the database after the required
manipulations in this state. This marks the successful completion of a transaction.
iv) Failed
If any of the transaction-related operations cause an error during the active or partially committed
state, further execution of the transaction is stopped and it is brought into a failed state. Here, the
database recovery system makes sure that the database is in a consistent state.
v) Aborted
If the error is not resolved in the failed state, then the transaction is aborted and a rollback operation
is performed to bring database to the the last saved consistent state. When the transaction is aborted,
the database recovery module either restarts the transaction or kills it.
Properties of Transaction
As transactions deal with accessing and modifying the contents of the database, they must have some
basic properties which help maintain the consistency and integrity of the database before and after
the transaction. Transactions follow 4 properties, namely, Atomicity, Consistency, Isolation, and
Durability. Generally, these are referred to as ACID properties of transactions in DBMS. ACID is
the acronym used for transaction properties. A brief description of each property of the transaction is
as follows.
i) Atomicity
This property ensures that either all operations of a transaction are executed or it is aborted. In any
case, a transaction can never be completed partially.
ii) Consistency
This property of a transaction keeps the database consistent before and after a transaction is
completed. Execution of any transaction must ensure that after its execution, the database is either in
its prior stable state or a new stable state.
iii) Isolation
This property states that two transactions must not interfere with each other, i.e. if some data is used
by a transaction for its execution, then any other transaction can not concurrently access that data
until the first transaction has completed.
iv) Durability
This property ensures that the changes made to the database after a transaction is completely
executed, are durable. In the event of any system failures or crashes, the consistent state achieved
after the completion of a transaction remains intact.
Data Centers
At its simplest, a data center is a physical facility that organizations use to house their critical
applications and data. A data center's design is based on a network of computing and storage
resources that enable the delivery of shared applications and data. The key components of a data
center design include routers, switches, firewalls, storage systems, servers, and application-
delivery controllers.
Cloud services
Cloud services are infrastructure, platforms, or software that are hosted by third-party
providers and made available to users through the internet.
Cloud services facilitate the flow of user data from front-end clients (e.g., users’ servers, tablets,
desktops, laptops—anything on the users’ ends), through the internet, to the provider’s systems,
and back. Cloud services promote the building of cloud-native applications and the flexibility
of working in the cloud. Users can access cloud services with nothing more than a computer,
operating system, and internet connectivity.
Examples:
All infrastructure, platforms, software, or technologies that users access through the internet
without requiring additional software downloads can be considered cloud computing
services—including the following as-a-Service solutions.
Clouds are IT environments that abstract, pool, and share scalable resources across a network.
Clouds enable cloud computing, which is the act of running workloads within a cloud
environment. Clouds are a type of PaaS, because hardware and an application software
platform is provided by another party.
Cloud platforms
Cloud service providers can also use their hardware resources to create cloud platforms, which
are online environments where users can develop code or run apps. Building a cloud platform
requires more than abstracting a computer’s capabilities from its hardware components— like
providing cloud infrastructure. Providing a cloud platform requires additional levels of
development to incorporate technologies like containerization, orchestration, application
programming interfaces (APIs), routing, security, management, and automation. User
experience design (UX) is also an important consideration in order to create a navigable online
experience.
Cloud platforms are a type of PaaS. And if the infrastructural components holding up the PaaS
are highly scalable and sharable, it might be considered a cloud. The best examples of PaaS
clouds include public clouds and managed private cloud.