Recherche
Recherche
tables = set of tuplet , and each tuplet has same structure of attributes (infos
details ) , an ID , and might have foreigner key that is an ID for one of the tables to
make a relation with another table
The ACID properties (Atomicity, Consistency, Isolation, and Durability) ensure reliable transactions in
databases.
1. Atomicity
Example:
○ If you transfer ₹500 to A, your account should be debited, and A’s account should be
credited.
updates.
2. Consistency
Example:
○ After transferring ₹500, you should have ₹1000, and A should have ₹3000.
3. Isolation
Example:
○ If two transactions read your balance as ₹2500 and both try to deduct ₹500, they
4. Durability
Example:
○ If you transfer ₹500 and the system crashes afterward, your updated balance should
1. Normalization involves dividing large tables into smaller, related tables and
defining relationships between them.
● Reduce data redundancy
● Maintain data integrity
● Optimize storage
● Improve or speed up queries
First Normal Form (1NF) – Ensures that all columns contain atomic
(indivisible) values and each row is unique.
Fourth Normal Form (4NF) and Fifth Normal Form (5NF) – Used for
handling multi-valued dependencies and complex relationships
● Query Performance
Fewer joins needed
Faster read operations
Simpler queries
Better response time
● Reporting Efficiency
Direct access to data
Simpler report queries
Faster aggregations
Better user experience
○ Use appropriate data types for efficiency (e.g., INTEGER instead of VARCHAR
for IDs).
○ Limit string sizes with VARCHAR(N) instead of TEXT.
6. Optimize Pagination
○ Some notions :
1. Different databases :
2. Joins in sql :
3. Indexing, Transactions, and Constraints
● Involves upgrading the existing database server (e.g., increasing CPU, RAM, or
storage).
● Does not require changes in SQL queries but often involves optimizing indexes,
caching, and upgrading hardware.
● Ensures high availability and fault tolerance by copying data from a master to one or
more slave databases.
● Horizontal Partitioning (Divides rows across multiple tables)
1. MySQL
2. PostgreSQL
3. Oracle Database
1. Non-Relational Databases
● Also called NoSQL databases, they do not follow the traditional relational model.
● Designed for scalability, flexibility, and handling diverse data structures.
● Common types: Document-oriented, Key-value, Column-family, Graph
databases.
2. Document-Oriented Databases (e.g., MongoDB)
● Store data in columns instead of rows for better query performance on large
datasets.
● Optimized for distributed, high-volume writes.
● Used in log processing, IoT, and recommendation systems.
● Use nodes, edges, and properties to store and query relationships efficiently.
● Best suited for social networks, fraud detection, recommendation engines.
● Supports complex queries like shortest path, recommendations, and pattern
matching.
8. Schema-Less Design
● Big Data → Massive volumes of data that require distributed storage & processing
(e.g., Hadoop, Spark).
● Unstructured Data → No predefined format (e.g., images, videos, logs).
● Semi-Structured Data → Partially organized (e.g., JSON, XML, NoSQL documents).
SQL vs NoSQL Performance Comparison
● Big Data Challenges: Handling large volumes, high velocity, and variety of data.
● NoSQL for Big Data:
○ MongoDB (Document storage for flexibility).
○ Cassandra (Scalable column-family storage).
○ HBase (Real-time analytics on Hadoop).
○ Elasticsearch (Full-text search on large datasets).
● Key Advantage: Distributed architecture allows handling petabytes of data efficiently.
● Hybrid Databases combine SQL and NoSQL features (e.g., PostgreSQL with JSON
support, Azure Cosmos DB).
● Use Cases:
○ Store structured financial data in SQL, but customer interactions in NoSQL.
○ Use NoSQL for real-time analytics while keeping SQL for long-term reporting.
○ Combine graph and relational databases for better relationship analysis.