0% found this document useful (0 votes)
8 views5 pages

Dbmsco 3,4 Part 2

The document provides comprehensive notes on transaction management, including transaction states, ACID properties, concurrency control techniques, and recovery methods. It also covers indexing techniques, query optimization strategies, NoSQL databases, big data concepts, and security considerations in database management systems. The information is structured to aid in exam preparation, highlighting essential topics and their significance.

Uploaded by

jeonjaswikakook
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Dbmsco 3,4 Part 2

The document provides comprehensive notes on transaction management, including transaction states, ACID properties, concurrency control techniques, and recovery methods. It also covers indexing techniques, query optimization strategies, NoSQL databases, big data concepts, and security considerations in database management systems. The information is structured to aid in exam preparation, highlighting essential topics and their significance.

Uploaded by

jeonjaswikakook
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Alright bro, here’s your complete easy-to-understand, long-paragraph notes for all the

topics you listed — perfect for your Mid-2 and Semester prep. You can use this directly
for creating your PDF!

Introduction to Transaction Management & Processing Issues

Transaction management is the process of making sure that a set of database


operations are completed successfully without any errors. A transaction is a group of
tasks that must all succeed or all fail together. For example, transferring money
between two accounts involves deducting from one and adding to another – both
should happen, or neither. Issues in transaction processing include system crashes,
power failures, or two users trying to access the same data at once. These issues can
lead to data inconsistency, lost updates, or dirty reads. That’s why proper transaction
control is necessary to ensure that the database remains accurate and safe.

Transaction States

A transaction goes through different states during its lifetime:

• Active – The transaction is being executed.

• Partially Committed – Final operations are done, but not yet saved.

• Committed – All changes are saved permanently.

• Failed – An error occurred, so the transaction can’t proceed.

• Aborted – All operations are undone (rollback happens).


These states help the system keep track of what is happening in the transaction
and decide whether to commit it or undo the changes.

ACID Properties

ACID properties make sure that transactions are reliable.

• A - Atomicity ensures that either the whole transaction happens or none of it


does.

• C - Consistency keeps the database valid before and after the transaction.

• I - Isolation makes sure each transaction runs independently, even with multiple
users.
• D - Durability guarantees that once a transaction is committed, the changes are
saved permanently, even if the system crashes.
These properties are the backbone of safe and secure transaction processing in
databases.

Problems During Multiple Transaction Processing

When many transactions run at the same time, problems like lost updates, temporary
inconsistencies, and uncommitted data access can occur. For example, two users
editing the same record might overwrite each other’s work. This leads to wrong or
incomplete data. Other issues include deadlocks, where two transactions wait forever
for each other to release resources. To prevent these issues, proper concurrency
control and transaction scheduling are needed.

Concurrency Control Techniques (Locking Protocols)

Concurrency control makes sure that multiple transactions can work together without
interfering with each other. Locking protocols are used to manage data access.

• Shared lock allows multiple transactions to read but not write.

• Exclusive lock allows only one transaction to write and blocks others.

• Two-Phase Locking (2PL) is a popular method where all locks are acquired first
(growing phase), and then released (shrinking phase).
This helps avoid conflicts and ensures safe execution of transactions.

Timestamp-Based Protocols & Deadlock Prevention Techniques

Timestamp-based protocols assign a unique time to each transaction. These times


decide the order in which data is read or written. This helps avoid conflicts. If a newer
transaction tries to change something that an older transaction is using, it will be
delayed or aborted.
Deadlock prevention ensures that transactions don’t wait forever. Methods like wait-
die and wound-wait are used to control which transaction should proceed and which
should wait or abort. These techniques help keep the system running smoothly without
getting stuck.

Recovery Techniques – Rollback & Redo


If a system crashes or a transaction fails, recovery techniques are used to bring the
database back to a consistent state.

• Rollback is used to undo all changes made by a failed transaction.

• Redo is used to reapply changes from a successful transaction that were not
saved permanently due to a crash.
Logs are maintained to keep track of all actions, which helps in performing
rollback and redo operations.

Indexing Techniques

Indexing is a way to make searching and data retrieval faster in a database. Without an
index, the database has to check every row, which is slow. Indexes work like a table of
contents in a book. When you search for something, it tells you where to find it. Indexes
are created on one or more columns of a table, especially those used in WHERE or JOIN
conditions. This makes data access more efficient and reduces load on the database.

B-Tree and Hash Indexing

B-Trees are a type of index used for sorted data and range queries. They allow fast
insertion, deletion, and search operations and are widely used in databases like MySQL
and Oracle.
Hash Indexing uses a hash function to convert a key (like an ID) into a location in
memory. It is very fast for exact match lookups but doesn’t work well for range-based
searches.
Both indexing techniques help speed up query execution but are used in different
scenarios depending on the type of data.

Query Optimization Strategies

Query optimization is the process of writing and executing SQL queries in the most
efficient way possible. This involves choosing the best way to fetch data with minimum
time and resource usage. Strategies include:

• Using indexes properly

• Avoiding unnecessary columns (SELECT *)

• Using joins smartly

• Filtering data early with WHERE clauses


• Checking execution plans using tools like EXPLAIN in MySQL
Well-optimized queries help in improving overall database performance,
especially in systems with heavy data loads.

Introduction to NoSQL Databases

NoSQL databases are designed to handle large volumes of unstructured, semi-


structured, or rapidly changing data that traditional relational databases can’t manage
well. Unlike SQL, they don’t store data in rows and columns. NoSQL stands for “Not
Only SQL.” These databases are flexible, scalable, and used in big data and real-time
web applications. Examples include MongoDB, Redis, and Cassandra.

NoSQL Database Characteristics

NoSQL databases come in different types:

• Key-Value stores – Data is stored like a dictionary (e.g., Redis)

• Document stores – Data is stored in JSON-like documents (e.g., MongoDB)

• Column-family stores – Store data in columns instead of rows (e.g., Cassandra)

• Graph databases – Store relationships between data (e.g., Neo4j)


These databases are known for high performance, flexibility, and horizontal
scalability (adding more machines to handle more data).

Big Data Concepts

Big Data refers to datasets that are so large and complex that traditional data
processing tools can’t handle them. It is described by the 3Vs – Volume (huge size),
Velocity (speed of data flow), and Variety (different types like text, images, videos).
Companies use big data to analyze customer behavior, detect fraud, and improve
services. Big data needs special tools and platforms for storage and processing.

Distributed Storage (DFS)

Distributed File Systems (DFS) break big data into smaller parts and store them across
multiple computers. This makes the system faster, more fault-tolerant, and scalable. If
one machine fails, another can continue the task. DFS is the foundation for big data
frameworks like Hadoop. It helps store massive data reliably and allows parallel
processing for faster results.
Hadoop Framework (HDFS)

Hadoop is an open-source framework used for processing big data. Its main part is
HDFS (Hadoop Distributed File System) which stores large files across many
computers. Another part, MapReduce, processes the data in parallel. Hadoop is fault-
tolerant, scalable, and cheap, which makes it perfect for big data analytics in
companies. It can store both structured and unstructured data.

Security Considerations in DBMS

Security in a DBMS is about protecting data from unauthorized access, hacking, or


misuse. It includes features like access control, authentication, and monitoring. A good
DBMS ensures that only the right people can access the right data. It also logs activities
to detect suspicious behavior and protects against SQL injection, data leaks, and cyber-
attacks.

Access Control in DBMS – Role-Based Access Control (RBAC)

Role-Based Access Control (RBAC) means that users are given roles, and each role
has specific permissions. For example, an "Admin" can read, write, and delete data,
while a "User" can only read data. This makes it easy to manage large numbers of users
and ensure everyone gets only the access they need. RBAC improves security and
reduces the chances of accidental or unauthorized data changes.

Database Security Techniques – Encryption & Decryption

Encryption is the process of converting data into a secret format so that only authorized
users can read it. Decryption is turning it back into its original form. These techniques
are important for protecting sensitive data like passwords, bank details, and personal
information. Even if a hacker gets access to the database, encrypted data stays safe
because they can’t read it without the key. Modern databases support both at-rest
encryption (for stored data) and in-transit encryption (for data being transferred).

Let me know if you want this converted into a PDF, or if you'd like a summary version or
flashcards too. I'm here to help you ace your exams bro!

You might also like