Uploaded by challengemashava17

DATABASES

advertisement
DATABASE HIERACHY
DATABASE
FILE
RECORD
FIELD
BYTE
BIT
What is a database?
 It is an organized collection of data that is stored on a computer storage
medium, such as a disk, and can only be accessed electronically from a
computer system.
This data can be used for more than one purpose.
 For example, a company that maintains a database containing information
on its employees will be able to use the same data for payroll, personnel, and
other purposes.
What is the purpose of a Databases?
•
•
They store data and provide facilities of searching specific record in given data.
They store special information used to manage the data. This information is called metadata and it is not shown to all the people looking at the
data.
•
•
•
They can solve cases where many users want to access (and possibly change) the same entries of data.
•
Certain attributes are more important than others, they can be used to find other data. This is called indexing. An index contains all the
important data and can be used to find the other data.
•
They ensure that the data always has context. There are a lot of different rules that can be added to tell the database system if the data makes
sense. One of the rules might say November has 30 days. This means if someone wants to enter November 31 as a date, this change will be
rejected.
•
It is used to sort records according to the order indicated by one specific field (e.g. sorting in alphabetical order)
They manage access rights (who is allowed to see the data, who can change it)
When there are many users asking questions to the database, the questions must be answered faster. So, the last person to ask a question, can
get an answer in reasonable time.
ADVANTAGES OF USING DATABASES
•
Ability to store large amounts of information This ability is essential for large companies with a large number of customers and this volume of
information must be handled very precisely.
•
Sharing information Databases allow users to share common information. Therefore, if you have a business with different company locations you
can share your data at same time with the different business locations.
•
Having quick access to information The information is obtained quickly and easily, which greatly facilitates the work and allows you having
better customer service.
•
Eliminating duplications By centralizing all information in a database you prevent duplication of existing information which usually presents a
common problem in business.
•
Increasing productivity. Access to information is faster now than ever before. Information will be structured without any duplication – allowing
you to work better, faster with increased productivity in your company.
•
Reducing storage space. Information is digitized so it takes less space than when stored on paper. You will always have certain documents that
will have to be on paper. Try to scan all of your documentation. It is a large initial effort it will make all your tasks easier.
•
Information Security. A database can have several parts depending on users. You can limit certain access to certain parts of the data for certain
users. That way the security and confidentiality of data will be guaranteed and secured.
•
Easy maintenance. As the information is digitized it is easier and economical to carry out any maintenance.
WHAT ARE THE DISADVANTAGES OF USING
DATABASES
•
•
•
•
•
Databases require a lot of time to design.
Databases are complex and difficult to design.
Substantial hardware and software start-up costs.
Database administrator or user requires training.
Any damage to the database is a damage to all programs using it. Damage to
the database might affect all applications using it.
• Maintenance is required and might induce cost.
FEATURES OF A NETWORK DATABASE
MODEL
• A network database consists of a collection of records connected to one
another through links. Each record is a collection of fields(attributes), each
of which consists of only one data value.
• A link is an association between precisely two records. Thus, a link can be
viewed as a restricted(binary) form of relationship.
FEATURES OF AN OBJECT ORIENTED
DATABASE MODEL
An object-oriented database is a database that subscribes to a model with information
represented by objects. Object-oriented databases are a niche offering in the relational
database management system (RDBMS) field and are not as successful or well-known
as mainstream database engines. As the name implies, the main feature of objectoriented databases is allowing the definition of objects, which are different from
normal database objects. Objects, in an object-oriented database, reference the ability
to develop a product, then define and name it. The object can then be referenced, or
called later, as a unit without having to go into its complexities. This is very similar to
objects used in object-oriented programming.
FEATURES OF A RELATIONAL
DATABASE MODEL
• It is an approach to the management of data using a structure and language consistent with first-order predicate logic.
• All data is represented in terms of tuples, grouped into relations. Relational data model is the primary data model, which is
used widely around the world for data storage and processing. This model is simple and it has all the properties and
capabilities required to process data with storage efficiency.
• Concepts
• Tables − In relational data model, relations are saved in the format of Tables. This format stores the relation among
entities. A table has rows and columns, where rows represents records and columns represent the attributes.
• Tuple − A single row of a table, which contains a single record for that relation is called a tuple.
• Relation instance − A finite set of tuples in the relational database system represents relation instance. Relation instances
do not have duplicate tuples.
• Relation schema − A relation schema describes the relation name (table name), attributes, and their names.
AVANTAGES OF USING A NETWORK
DATABASE MODEL
• The major advantage of network model are• 1.) Conceptual simplicity-Just like the hierarchical model,the network model is also
conceptually simple and easy to design.
• 2.) Capability to handle more relationship types-The network model can handle the one to
many and many to many relationships which is real help in modeling the real life situations.
• 3.) Ease of data access-The data access is easier and flexible than the hierarchical model.
• 4.) Data integrity- The network model does not allow a member to exist without an owner.
• 5.) Data independence- The network model is better than the hierarchical model in isolating
the programs from the complex physical storage details.
• 6.) Database standards
DISADVANTAGES OF A NETWORK
DATABASE MODEL
• 1.) System complexity- All the records are maintained using pointers and hence
the whole database structure becomes very complex.
•
2.) Operational Anomalies- The insertion,deletion and updating operations of
any record require large number of pointers adjustments.
• 3.) Absence of structural independence-structural changes to the database is
very difficult.
•
ADVANTAGES OF AN OBJECT
ORIENTED DATABASE MODEL
•
•
•
OODBMSs can provide appropriate solutions for many types of advanced database applications. However, there are also disadvantages.
•
•
Extensibility
•
•
Capable of handling a large variety of data types
•
Removal of impedance mismatch
Enriched modeling capabilities
The object-oriented data model allows the 'real world' to be modeled more closely. The object, which encapsulates both state and behavior, is a
more natural and realistic representation of real-world objects. An object can store all the relationships it has with other objects, including
many-to-many relationships, and objects can be formed into complex objects that the traditional data models cannot cope with easily.
OODBMSs allow new data types to be built from existing types. The ability to factor out common properties of several classes and form them
into a superclass that can be shared with subclasses can greatly reduce redundancy within system is regarded as one of the main advantages of
object orientation. Further, the reusability of classes promotes faster development and easier maintenance of the database and its applications.
Unlike traditional databases (such as hierarchical, network or relational), the object oriented database are capable of storing different types of
data, for example, pictures, voice video, including text, numbers and so on.
• A single language interface between the Data Manipulation Language (DML) and the programming language
overcomes the impedance mismatch. This eliminates many of the efficiencies that occur in mapping a
declarative language such as SQL to an imperative 'language such as 'C'. Most OODBMSs provide a DML
that is computationally complete compared with SQL, the 'standard language of RDBMSs.
• More expressive query language
• Navigational access from the object is the most common form of data access in an OODBMS. This is in
contrast to the associative access of SQL (that is, declarative statements with selection based on one or more
predicates). Navigational access is more suitable for handling parts explosion, recursive queries, and so on.
• Support for schema evolution
• The tight coupling between data and applications in an OODBMS makes schema evolution more feasible.
• Support for long-duration, transactions
• Current relational DBMSs enforce serializability on concurrent transactions to maintain database consistency. OODBMSs
use a different protocol to handle the types of long-duration transaction that are common in many advanced database
application.
• Applicability to advanced database applications
• There are many areas where traditional DBMSs have not been particularly successful, such as, Computer-Aided Design
(CAD), Computer-Aided Software Engineering (CASE), Office Information System(OIS), and Multimedia Systems. The
enriched modeling capabilities of OODBMSs have made them suitable for these applications.
• Improved performance
• There have been a number of benchmarks that have suggested OODBMSs provide significant performance improvements
over relational DBMSs. The results showed an average 30-fold performance improvement for the OODBMS over the
RDBMS.
DISADVANTAGES OF AN OBJECTORIENTED DATABASE MODEL
• There are following disadvantages of OODBMSs:
• Lack of universal data model: There is no universally agreed data model for an OODBMS, and most
models lack a theoretical foundation. This .disadvantage is seen as a significant drawback, and is comparable
to pre-relational systems.
• Lack of experience: In comparison to RDBMSs the use of OODBMS is still relatively limited. This means
that we do not yet have the level of experience that we have with traditional systems. OODBMSs are still
very much geared towards the programmer, rather than the naïve end-user. Also there is a resistance to the
acceptance of the technology. While the OODBMS is limited to a small niche market, this problem will
continue to exist
• Lack of standards: There is a general lack of standards of OODBMSs. We have already mentioned that
there is not universally agreed data model. Similarly, there is no standard object-oriented query language.
• Competition: Perhaps one of the most significant issues that face OODBMS vendors is the
competition posed by the RDBMS and the emerging ORDBMS products. These products
have an established user base with significant experience available. SQL is an approved
standard and the relational data model has a solid theoretical formation and relational
products have many supporting tools to help .both end-users and developers.
• Query optimization compromises encapsulations: Query optimization requires. An
understanding of the underlying implementation to access the database efficiently. However,
this compromises the concept of incrassation.
• Locking at object level may impact performance Many OODBMSs use locking as the basis
for concurrency control protocol. However, if locking is applied at the object level, locking
of an inheritance hierarchy may be problematic, as well as impacting performance.
• Complexity: The increased functionality provided by the OODBMS (such as the illusion of a
single-level storage model, pointer sizzling, long-duratipntransactions, version management, and
schema evolution--makes the system more complex than that of traditional DBMSs. In
complexity leads to products that are more expensive and more difficult to use.
• Lack of support for views: Currently, most OODBMSs do not provide a view mechanism,
which, as we have seen previously, provides many advantages such as data independence, security,
reduced complexity, and customization.
• Lack of support for security: Currently, OODBMSs do not provide adequate security
mechanisms. The user cannot grant access rights on individual objects or classes.
• If OODBMSs are to expand fully into the business field, these deficiencies must be rectified.
•
ADVANTAGES OF A RELATIONAL
DATABASE MODEL
• Ease of use: The revision of any information as tables consisting 0f rows and
columns is quite natural and therefore even first time users find it attractive.
• · Flexibility: Different tables from which information has to be linked and
extracted can be easily manipulated by operators such as project and join to give
information in the form in which it is desired.
• · Security: Security control and authorization can also be implemented more easily
by moving sensitive attributes in a given table into a separate relation with its own
authorization controls. If authorization requirement permits, a particular attribute
could be joined back with others to enable full information retrieval.
• ·
FUNCTIONS OF A DATABASE
MANAGEMENT SYSTEM
A database management system (DBMS) is system software for creating and
managing databases. The DBMS provides users and programmers with a
systematic way to create, retrieve, update and manage data.
• A DBMS makes it possible for end users to create, read, update and delete data in a
database. The DBMS essentially serves as an interface between the database and end users
or application programs, ensuring that data is consistently organized and remains easily
accessible.
• The DBMS manages three important things: the data, the database engine that allows data
to be accessed, locked and modified -- and the database schema, which defines the
database’s logical structure. These three foundational elements help provide concurrency,
security, data integrity and uniform administration procedures. Typical database
administration tasks supported by the DBMS include change management, performance
monitoring/tuning and backup and recovery. Many database management systems are also
responsible for automated rollbacks, restarts and recovery as well as
the logging and auditing of activity.
• The DBMS is perhaps most useful for providing a centralized view of data that can be accessed
by multiple users, from multiple locations, in a controlled manner. A DBMS can limit what data
the end user sees, as well as how that end user can view the data, providing many views of a
single database schema. End users and software programs are free from having to understand
where the data is physically located or on what type of storage media it resides because the
DBMS handles all requests.
• The DBMS can offer both logical and physical data independence. That means it can protect
users and applications from needing to know where data is stored or having to be concerned
about changes to the physical structure of data (storage and hardware). As long as programs use
the application programming interface (API) for the database that is provided by the DBMS,
developers won't have to modify programs just because changes have been made to the database.
• With relational DBMSs (RDBMSs), this API is SQ
Download