Upload
amos-thornton
View
219
Download
3
Embed Size (px)
Citation preview
Object Persistence (Data Base) Design
Chapter 13
Key Definitions
• Object persistence involves the selection of a storage format and optimization for performance.
• Four basic formats used for object persistence are: files, OO databases, and relational databases.
Files
• Sequential Access– Data stored in order based on a particular
attribute – Typically efficient for reports using all or most
of the file’s data• Random Access
– Data stored in unordered fashion– Typically efficient for finding individual
records
Relational Databases
• Primary key• Foreign key• Referential integrity• Structured Query Language (SQL)• Tables• Joining tables• Objects must be converted so they can be stored in
a table
Object-Relational Databases
• Relational databases extended to handle the storage of objects
• Use of user-defined data types• Extended SQL• Inheritance tends to be language dependent
• Repeating groups or multivalued attributes
Object-Oriented Databases
• Two approaches
– Adding persistence extensions to OO languages
– Separate database management systems
• Extents (tables)
• Object ID assigned
• Some inheritance
• Repeating groups or multivalued attributes
• Sharp learning curve
MAPPING PROBLEM DOMAIN OBJECTS TO OBJECT
PERSISTENCE FORMATS
Mapping Problem Domain Objects to RDBMS Schema -- Rules
OPTIMIZING RDBMS-BASED OBJECT STORAGE
Dimensions of Data Storage Optimization
• Storage efficiency (minimizing storage space)
• Speed of access (minimizing time to retrieve desired information)
Optimizing Storage Efficiency
• Reduce redundant data• Limit null values
– Multiple possible interpretations can lead to mistakes
• A well-formed logical data model does not contain redundancy or many null values
The Steps of Normalization
Optimizing Access Speed
• Denormalization
• Clustering– Intra-file– Inter-file
• Indexing
Guidelines for Creating Indexes
• Use indexes sparingly for transaction systems
• Use many indexes to increase response times in decision support systems
• For each table– Create a unique index based on the primary key
– Create an index based on the foreign key
• Create an index for fields used frequently for grouping, sorting, or criteria
Estimating Data Storage Size
Field Average Size (Characters)
Order number 8Date 7Cust ID 4Last name 13First name 9State 2Amount 4Tax rate 2Record Size 49Overhead (30%) 14.7Total Record Size 63.7
Initial Table Size 50,000Initial Table Volume 3,185,000
Growth/Month 1,000Table volume @ 3 years 5,478,200