Data Models
· • Data models are frameworks or blueprints that describe how data is organized, stored, accessed, and managed in databases.
• They provide a structure for
representing data, relationships, and constraints, ensuring efficient
management, reliability, and integrity of data.
Common features
Abstraction of complex real-world scenarios,
· Enforcement
of data integrity and relationships,
· Support
for data operations such as insertion, deletion, updating, and querying.
Levels of Data
Models
• Conceptual Data Model:
- High-level abstraction, not tied to implementation.
- Shows entities, their attributes, and general relationships.
- Visualized with ER diagrams.
• Logical Data Model:
- Details the data structure (tables, columns, normalization,
constraints) without physical storage specifics.
- Used to create blueprints for database design and ensure data
integrity.
• Physical Data Model:
- Concerns about how data is actually stored on disk, including indexes, file
placement, partitions, and storage parameters.
- Used for implementation and performance tuning.
Characteristics
and Benefits
• Abstraction hides implementation complexity, allowing for easier management and understanding.
• Well-defined structures help
maintain data integrity, consistency, and organization.
• Operations are supported for
managing and querying data.
• Constraints, like primary keys
and data types, enforce rules and relationships.
• Data models help standardize
communication between developers, designers, and stakeholders.
• Scalability and flexibility
enable databases to handle future changes and growth.
Main Data Model
Types
1. Hierarchical Data Models
• Organizes data in a tree-like structure (single root, parent-child relationships, each child has only one parent).
• Best for data with a clear
hierarchy (e.g., org charts, file systems).
• Advantages: Simple,
straightforward for 1:N relationships, efficient for certain queries.
• Drawbacks: Rigid,
inefficient for many-to-many relations or frequent changes, and redundancy
issues.
=================================================
2. Network Data Models
· Network model was standardized as the CODASYL & DBTG (conference of data system language, database task group).
·
Represents data as a graph: records
(nodes) and sets (edges), allowing multiple relationships (M:N,
many-to-many).
• Suited for complex,
interconnected data (telecom, transport).
• Advantages: Flexible,
efficient for traversals, handles data integrity with owner-member
relationships.
• Drawbacks: Complex to
design and maintain, requires expert knowledge for querying and changes.
=================================================
3. Relational Data Models
• Organizes data in tables (relations), where each row is a record and each column is an attribute.
• Relationships handled using keys
(primary, foreign).
• Supports powerful querying (SQL),
normalization to reduce redundancy.
• Advantages: Easy to
understand and update, ensures consistency, flexible with schema changes,
widely used in business and transactional systems.
• Drawbacks: May be less
efficient at a massive scale or for unstructured data, joins can impact
performance, and schema updates require planning.
=================================================
Entity-Relationship
(ER) Model
• Used at the conceptual design
phase.
Visualizes data as entities
(objects), attributes, and relationships, often through ER diagrams.
• Clarifies the high-level organization
before implementation.
• Not directly implemented, but
serves as a foundation for creating relational databases.
Object-Oriented
Data Model
• Integrates object-oriented
programming principles (encapsulation, inheritance) with database storage.
• Entities are objects, containing
both data (attributes) and methods (behaviours).
• Useful for multimedia or
engineering data, or where OOP and database need to work together.
• Advantages: Manages
complex data and structures, reusability, and encapsulation.
• Drawbacks: Complex, not
well-supported in some DBMS, querying can be harder.
NoSQL Data
Models
Designed for handling large-scale,
flexible, and often unstructured data, usually in distributed systems.
Main types include:
• Key-Value: Simple pairs (e.g., Redis) – best for fast,
scalable, simple lookups.
• Document: Schema-less documents (JSON/BSON, e.g., MongoDB) –
flexible, supports complex structures.
• Column-Family: Organizes data into dynamic columns (e.g.,
Cassandra) – great for analytics and time-series data.
• Graph: Nodes and relationships (e.g., Neo4j) – best for highly
interconnected data, such as social networks.
• Advantages: Scalability, flexibility, rapid
lookups, schema-less storage.
• Drawbacks: Weak consistency (eventually over
strong), limited standards, querying complexity varies by model.
Usage Scenarios
• Hierarchical: File
systems, org charts, manufacturing bill of materials.
• Network: Telecom,
transport, manufacturing, complex GIS data.
• Relational: Business,
finance, healthcare, customer management, e-commerce.
• Object-Oriented:
Multimedia, scientific, and spaces requiring OOP–DB integration.
• NoSQL: Caching, real-time
analytics, IoT, e-commerce, social media, big data.
==================================================================
0 Comments