Lecture 31: Transactions/1 : Serializability

Data Base Management System - IITKGP
1 Sept 202129:13

Summary

TLDRThe script discusses database management systems, focusing on the concept of transactions. It explains how data is physically read, modified, and written back to the database. The video emphasizes the importance of ACID properties—atomicity, consistency, isolation, and durability—necessary for maintaining database integrity during concurrent transaction processing. It also explores the potential issues that arise from concurrent transactions and how they can lead to inconsistent database states if not managed properly.

Takeaways

  • 📚 The script discusses database management systems and how data is physically written, read, and transformed within the system.
  • 🔍 It focuses on the concept of a transaction, which is a series of operations that the database system performs, ensuring that data is consistent and accurate.
  • 💡 The importance of transactions is highlighted, with examples given to illustrate how they manipulate data, such as transferring money between accounts.
  • 🔑 The ACID properties of transactions are introduced as crucial for maintaining database integrity: Atomicity, Consistency, Isolation, and Durability.
  • 🔄 Atomicity ensures that all parts of a transaction are completed successfully or not at all, maintaining data integrity.
  • 🔗 Consistency means that a transaction will transition the database from one valid state to another, without corruption.
  • 🏭 Isolation deals with the visibility of transaction operations to other transactions, ensuring that concurrent transactions do not affect each other in an undesired way.
  • 🔒 Durability ensures that once a transaction has been committed, it remains so, even in the event of a system failure.
  • 🤝 The script also touches on the challenges of concurrent transactions, such as ensuring that multiple users operating on the same data do not create conflicts or inconsistencies.
  • 💻 The concept of schedules and serializability is discussed, which is a method to ensure that concurrent execution of transactions does not lead to inconsistent results.

Q & A

  • What is the primary focus of the discussion in the script?

    -The primary focus of the discussion is on database management systems, specifically how data is accessed and the concept of transactions within these systems.

  • What is a transaction in the context of database systems?

    -A transaction in database systems refers to a sequence of operations performed as a single logical unit of work. It involves reading, changing, and then writing data, and is crucial for maintaining database consistency and integrity.

  • Why is it important to focus on what happens during a database transaction?

    -Focusing on what happens during a database transaction is important because it helps ensure the accuracy and consistency of data. It also ensures that the database can recover from any errors or failures that may occur during the transaction process.

  • What are the four key properties of a transaction known as ACID properties?

    -The four key properties of a transaction, known as ACID properties, are Atomicity, Consistency, Isolation, and Durability. These properties ensure that the database maintains its integrity and remains consistent even in the event of errors or concurrent access by multiple users.

  • What does Atomicity in transactions ensure?

    -Atomicity ensures that all operations within a transaction are completed successfully; if one operation fails, the entire transaction is rolled back, leaving the database as if the transaction had never occurred.

  • How is Consistency maintained in database transactions?

    -Consistency is maintained by ensuring that a transaction brings the database from one valid state to another while adhering to all defined rules, constraints, and prerequisites.

  • What is the purpose of Isolation in database transactions?

    -Isolation ensures that concurrent transactions are executed in a way that the outcome is the same as if they were executed sequentially, preventing inconsistent states from being seen by other transactions.

  • Why is Durability important in database transactions?

    -Durability ensures that once a transaction has been committed, it remains so, even in the event of power loss, crashes, or errors. The changes made by the transaction become permanent and are not lost.

  • How do concurrent transactions affect the database?

    -Concurrent transactions can lead to issues like data inconsistency if not managed properly. They can interfere with each other, leading to scenarios where the database's state may not reflect the expected outcomes, thus violating ACID properties.

  • What is the significance of the term 'interleaving' in the context of concurrent transactions?

    -Interleaving refers to the execution of instructions from different transactions in an order that is not sequential. This can lead to inconsistent database states if not properly managed, as transactions may depend on the order of operations.

  • How can database systems ensure that transactions do not violate ACID properties despite concurrent executions?

    -Database systems can ensure that transactions do not violate ACID properties by implementing mechanisms such as locks, transaction queues, and write-ahead logging. These techniques help in controlling access to data and maintaining the order and integrity of transactions.

Outlines

00:00

💾 Database Management and Transaction Basics

This paragraph introduces the concept of database management systems and how data is physically created. It discusses the process that occurs when data is accessed within a database system, focusing on the read, transform, and write operations. The paragraph then delves into the idea of a transaction, an operation that occurs within the database system, which was previously discussed in the context of indexing. It sets the stage for understanding the concept of transactions and the various issues related to their concurrent execution, such as the need for transactions to be atomic and consistent.

05:03

🔄 Challenges of Concurrent Transactions

The paragraph explores the complexities that arise when multiple transactions occur concurrently within a database system. It uses the example of transferring money between accounts to illustrate how transactions must be executed independently yet consistently. The concept of a concurrent execution means that transactions are not happening on separate machines but must be managed within the same database system. The paragraph emphasizes the need for transactions to be executed in a way that ensures database consistency and integrity, despite the potential for hardware or software failures that could affect the execution of a transaction partway through.

10:06

🔒 Ensuring Atomicity and Consistency in Transactions

This section delves into the necessity of atomicity and consistency in transaction processing. It explains that once a transaction starts, it must complete fully to ensure that the database remains in a consistent state. The paragraph uses a hypothetical scenario where a system crash occurs partway through a transaction to illustrate the importance of atomicity. It also discusses the need for consistency constraints, such as maintaining the balance of accounts in a transfer, to ensure that the database's integrity is preserved even when transactions are executed concurrently.

15:07

🔗 Isolation and Durability in Transaction Processing

The paragraph discusses the importance of isolation and durability in transaction processing. Isolation ensures that the effects of concurrent transactions are properly ordered, preventing inconsistencies that could arise from interleaved execution. Durability, on the other hand, ensures that once a transaction has been successfully completed, its changes persist even in the event of subsequent system failures. The paragraph explains these concepts using the acronym ACID, which stands for Atomicity, Consistency, Isolation, and Durability, and emphasizes that transactions must adhere to these properties to maintain database integrity.

20:08

📈 Impact of Concurrent Execution on System Performance

This paragraph examines how concurrent transaction execution can impact system performance. It highlights the potential benefits of increased throughput and reduced response times due to the ability to perform multiple operations simultaneously. The paragraph provides examples of how a transaction might be processing on the CPU while another is reading or writing to the disk, showcasing the efficiency gains from concurrent processing. However, it also notes the need to balance these performance improvements with the maintenance of database consistency and the ACID properties.

25:08

🔁 Transaction Scheduling and Interleaving

The final paragraph explores the concept of transaction scheduling and how different interleavings of transaction instructions can lead to various outcomes, including both consistent and inconsistent states. It uses examples to illustrate how the order in which transactions are executed can affect the final state of the database, emphasizing the importance of proper scheduling to maintain consistency. The paragraph concludes by highlighting the challenges of ensuring consistent database states when transactions are executed concurrently and the need for careful management to uphold the ACID properties.

Mindmap

Keywords

💡Database Management

Database Management refers to the administration and management of database systems. It involves the development, maintenance, and optimization of these systems to ensure they serve the needs of the organization effectively. In the context of the video, database management is central to understanding how data is physically manipulated, read, and written within a system, which is a fundamental aspect of the discussion.

💡Transaction

A transaction in the video script refers to a series of operations performed as a single unit of work in a database system. It is atomic, consistent, isolated, and durable (ACID), which are properties that ensure reliability and data integrity. The script uses the concept of transactions to explain how data operations are handled within a database, such as transferring money between accounts.

💡Atomicity

Atomicity is one of the ACID properties and it ensures that all operations within a transaction are completed successfully; if one operation fails, the entire transaction is rolled back to its initial state. The script emphasizes the importance of atomicity to prevent partial completion of transactions, which could lead to data inconsistencies.

💡Consistency

Consistency in the context of the video means that a transaction will bring the database from one valid state to another, maintaining data integrity rules. It is crucial for ensuring that the database remains in a consistent state even after a transaction has occurred, as exemplified in the script by the need for account balances to remain consistent before and after a transfer.

💡Isolation

Isolation is another ACID property that ensures that concurrent transactions are executed in a way that their effects are isolated from each other until they are fully completed. The script discusses how isolation prevents inconsistencies that can arise when transactions interfere with each other, such as when multiple transactions read from and write to the same data.

💡Durability

Durability ensures that once a transaction has been committed, it remains so, even in the event of power loss, crashes, or errors. The script touches on durability by explaining that even if a system failure occurs after a transaction has been completed, the effects of that transaction on the database will persist.

💡Concurrency Control

Concurrency Control is the mechanism used to manage access to the database by multiple users or processes at the same time. The script highlights the need for concurrency control to handle situations where multiple transactions are executed concurrently, ensuring that the database remains consistent and that the ACID properties are maintained.

💡Rollback

Rollback in the script refers to the process of undoing all the changes made by a transaction if it fails to meet the ACID properties. This is important for maintaining database integrity, as it allows the system to return to a consistent state when a transaction cannot be completed successfully.

💡Commit

Commit is the operation that marks the successful completion of a transaction and makes its changes permanent in the database. The script discusses the point at which a transaction is considered complete and the data changes are committed to the database, ensuring that the transaction's effects are saved.

💡Interleaving of Transactions

Interleaving of Transactions in the script refers to the execution of instructions from different transactions in an overlapping manner. This concept is important for understanding how concurrent transactions can affect each other and the database's state, potentially leading to inconsistencies if not managed correctly.

💡Schedule

A schedule in the context of the video is an ordered sequence of transactions and their instructions. The script uses the term to explain how transactions can be executed in different orders and how this can impact the database's consistency, emphasizing the importance of proper scheduling to maintain ACID properties.

Highlights

Introduction to database management and how data can be physically manipulated within a system.

Explanation of what happens when data is accessed in a database system, focusing on the process of reading, transforming, and writing data.

Definition of a transaction in database systems as a series of operations that must be executed in a certain order.

Discussion on the concept of transactions and the importance of their current execution in relation to consistency.

Example of a transaction involving transferring money between two accounts, illustrating the process of debit and credit.

Clarification of the atomic nature of transactions, ensuring that all parts of a transaction are completed successfully or not at all.

Importance of consistency in database systems and how it is affected by the values of data.

Explanation of the need for isolation in transactions to prevent inconsistencies when multiple transactions occur concurrently.

Discussion on the durability of transactions, ensuring that once a transaction is successfully completed, it remains so even in the event of system failures.

Introduction to the ACID properties of transactions: Atomicity, Consistency, Isolation, and Durability.

Exploration of the states a transaction goes through, from active to partially committed, and the implications for database consistency.

Example of how a transaction can fail and the need for rollback mechanisms to restore the database to a consistent state.

Discussion on the benefits of concurrent execution of transactions, such as increased throughput and reduced response time.

Challenges of concurrent transaction execution, including the potential for interference and the violation of ACID properties.

Explanation of how different schedules of transaction execution can lead to different outcomes, impacting database consistency.

Conclusion on the necessity of maintaining a consistent database state and the challenges that come with concurrent transaction processing.

Transcripts

play00:07

ডাটাবেস ম্যানেজমেন্ট সিস্টেমের করতে পারি।

play00:11

আমরা দেখেছি কিভাবে ডেটা ফিজিক্যালি

play00:16

করা যায়। এখন আমরা যখন একটি ডাটাবেস

play00:22

সিস্টেমে ডেটা অ্যাক্সেস করা হয়, এটি পড়া

play00:28

হয়, স্থানীয়ভাবে পরিবর্তিত হয় এবং

play00:32

তারপরে লেখা হয় তখন কী হয় তার উপর

play00:39

আমরা ফোকাস করব। খুব সহজভাবে এটি

play00:44

এমন একটি অপারেশন যা ডাটাবেস সিস্টেমে

play00:50

ঘটতে থাকে, যা আমরা চিহ্নিত করব যাকে

play00:56

আমরা ট্রাঞ্জাকসন বলি।

play00:58

এটাই আমরা গত সপ্তাহে করেছিলাম ইনডেক্স

play01:04

নিয়ে আলোচনা করেছিলাম।

play01:06

এবং আমরা এখন ট্রাঞ্জাক্সনের এই ধারণাটি বোঝা

play01:12

শুরু করি, এবং আমরা ট্রাঞ্জাক্সনের

play01:17

কঙ্কারেন্ট এক্সিকিউসনের সাথে সম্পর্কিত বিভিন্ন

play01:21

সমস্যাগুলি দেখব। সুতরাং, আমরা এর অর্থ

play01:26

কী তা আরও বিশদে ব্যাখ্যা করব।

play01:32

এবং এই 3টি বিষয় যা আমরা এই মডিউলে ফোকাস

play01:39

করব।

play01:40

আসুন প্রথমে একটি ট্রাঞ্জাকসনের অর্থ

play01:45

কী তা দেখে নেওয়া যাক। আমরা বলি ট্রাঞ্জাকসনের

play01:52

হল প্রোগ্রাম এক্সিকিউশনের ।

play01:54

সুতরাং, এটি সম্ভবত কিছু স্থানীয় পরিবর্তন

play01:59

করে এবং তারপরে এটি আবার লেখে। এখানে

play02:06

একটি ট্রাঞ্জকসনের একটি উদাহরণ রয়েছে।

play02:10

সেই অপ্রয়োজনীয় বিশদ বিবরণ ছাড়া

play02:14

যেটা সেখানে রয়েছে যে দুটি অ্যাকাউন্ট

play02:20

কত। সুতরাং, যে প্রথম

play02:23

ইন্সট্রাকশনটা করি। অ্যাকাউন্ট ব্যালেন্সে

play02:27

যেখানে এটি 200 ডলার ছিল, এখন এই 50 ডলার

play02:34

ডেবিট করে 100 এবং 50 ডলার হয়ে যাবে।

play02:41

তারপর আমাদের অ্যাকাউন্ট B-তে ক্রেডিট প্রক্রিয়া

play02:47

করতে হবে। সুতরাং, চতুর্থ নির্দেশে

play02:51

আমরা B কে রিড করি। আসুন আমরা ধরি যে

play03:01

অ্যাকাউন্ট B-এর বর্তমান ব্যালেন্স ছিল 300

play03:08

ডলার, তারপর B কে রিড করলে B-কে 300 হিসাবে

play03:15

অস্থায়ী ভেরিয়েবল করবে। ক্রেডিট 300;

play03:19

অর্থাৎ, আমরা 50 ডলার যোগ করি আর এটি 350 হয়ে

play03:26

যায়, এবং তারপর আমরা B এর অ্যাকাউন্টে

play03:31

ব্যালেন্সটা লিখি। অ্যাকাউন্টে ব্যালেন্স

play03:33

এখন 350 ডলার হবে। সুতরাং, এই ছয়টি ইন্সট্রাকশনের

play03:38

এই সম্পূর্ণ ক্রমটিকে একটি ট্রাঞ্জাকসন

play03:41

বলা হয়। এবং আপনি বুঝতেই পারছেন যে

play03:45

অ্যাকাউন্ট A থেকে B এর একাউন্টে 50 ডলার

play03:51

স্থানান্তর করাই আমাদের লক্ষ্য ছিল,

play03:55

এই ছয়টি ইন্সট্রাকশন এই ক্রমে কার্যকর

play04:00

করতে হবে যাতে আমরা পছন্দসই ফলাফল পেতে

play04:06

পারি। এখন প্রশ্ন হল; এটি বেশ সহজ, এটি

play04:12

একটি খুব সাধারণ নিম্ন-স্তরের প্রোগ্রামের

play04:16

মতো। তবে দুটি প্রধান সমস্যা রয়েছে যা

play04:21

আমাদের মোকাবেলা করতে হবে। প্রথমত,

play04:25

একবার প্রথম ইন্সট্রাকসনটি শুরু হলে তার নিশ্চয়তা

play04:31

কী? কি নিশ্চয়তা রয়েছে যে সেটা ইন্সট্রাকসন

play04:36

6 পর্যন্ত চলবে? ডিস্কের মধ্যে কিছু

play04:41

ব্যর্থতা থাকতে পারে হার্ডওয়্যার ব্যর্থ

play04:45

হতে পারে সিস্টেম -এ কাজ করছি, আমি অন্য

play04:51

পক্ষের কাছে স্থানান্তর করছি যাকে আমাকে

play04:56

টাকা দিতে হবে। একই সময়ে, আরও বেশ কয়েকজন

play05:02

ব্যক্তি তাদের অ্যাকাউন্টে, নিজ নিজ অ্যাকাউন্টে

play05:07

অপারেশন করছেন। অন্যান্য অনেক অপারেশন

play05:11

ডাটাবেস থেকেই হতে পারে। উদাহরণস্বরূপ,

play05:15

যখন আমি একটি স্থানান্তর করছি একই সময়ে ডাটাবেস

play05:21

আমার অ্যাকাউন্টে কিছু ত্রৈমাসিক সুদ

play05:25

জমা করতে পারে। এই সমস্ত ট্রাঞ্জাকসনগুলো,

play05:30

প্রকৃতপক্ষে কঙ্কারেন্টলি এক্সিকিউট হয়, যার

play05:34

অর্থ হল, তারা সব স্বাধীনভাবে এক্সিকিউট করছে।

play05:39

তারা একই CPU ব্যবহার করে, কিন্তু তারা

play05:45

একই সময়ে ফলাফল অর্জন করে। সুতরাং,

play05:49

ট্রাঞ্জাকসনগুলো আসলে আলাদা মেশিনে

play05:52

ঘটছে এমন নয়, ট্রাঞ্জাকসনগুলো একই ডাটাবেসে কার্যকর

play05:58

হতে হবে। তাদের একটি কঙ্কারেন্ট

play06:02

পদ্ধতিতে ঘটতে হবে, যেটি আমরা দেখতে

play06:07

পাচ্ছি এটি একটি কঙ্কারেন্ট পদ্ধতি

play06:11

কারণ তারা একসাথে ঘটে। এবং যখন এটি

play06:16

চলছে, আমরা কীভাবে নিশ্চিত করব, তবে

play06:21

একটি সিপিইউ বলি।

play06:23

সুতরাং, আমরা প্রথমে একটি ট্রাঞ্জাকসনের

play06:27

কিছু প্রয়োজনীয় বৈশিষ্ট্য রেখে লক্ষ্যমাত্রা

play06:31

নির্ধারণ করি। প্রথম প্রয়োজন হল এটোমিসিটি

play06:36

। আবার ধরুন একই ট্রাঞ্জাকশনটি

play06:39

দেখুন, ধরুন সিস্টেম ক্র্যাশ হয়ে গেল

play06:44

প্রথম তিনটি ইন্সট্রাকশনের পরে এবং চতুর্থ ইন্সট্রাকশনটি

play06:49

ঘটতে চলেছে এমন সময়। তো, কি হবে? ইতিমধ্যে

play06:55

A অ্যাকাউন্ট থেকে 50 ডলার ডেবিট করা

play07:00

হয়েছে এবং অ্যাকাউন্ট B-তে এখনও সেই 50 ডলার

play07:07

জমা হয়নি। সুতরাং, এই মুহুর্তে, যদি

play07:12

ট্রাঞ্জাকশন সিস্টেমে ব্যর্থতা ঘটে তবে

play07:16

কেবলমাত্র 50 ডলার সিস্টেম থেকে অদৃশ্য

play07:21

হয়ে যাবে আর এটির কোন অস্তিত্ব থাকবে

play07:27

না। সুতরাং, মৌলিক প্রয়োজনীয়তা হল

play07:31

যে একবার একটি ট্রাঞ্জাকশন শুরু হলে এটি সম্পূর্ণরূপে

play07:37

ঘটতে হবে এই ক্ষেত্রের হিসাবে ছয়টি ইন্সট্রাকশনই

play07:43

করা উচিত বা এগুলির কোনটিই করা উচিত

play07:49

নয়৷ তাহলে হয় সবগুলিই

play07:52

হবে নয়তো কোনটিরই প্রয়োজন নেই যা

play07:57

আমরা বলি এটির মতো। সুতরাং, একটি উপায়ে

play08:03

ট্রাঞ্জাকশনগুলি ইনভিসিবল বা এটোমিক

play08:06

এবং এটিই হল এটোমিসিটির প্রয়োজনীয়তা।

play08:10

দ্বিতীয় প্রয়োজনীয়তাকে বলা হয় কন্সিস্ট্যান্সি

play08:14

মানগুলির কন্সিস্ট্যান্সি প্রভাবিত হওয়া উচিত

play08:18

নয়। সুতরাং, যদি আমাদের

play08:21

কিছু নির্দিষ্ট ইন্টিগ্রিটি কন্সট্রেইন্ট ইত্যাদির

play08:26

কথা বলেছি। এবং ইমপ্লিসিট ডোমেন ইন্টিগ্রিটি

play08:30

কন্সট্রেন্ট থাকতে পারে। উদাহরণ স্বরূপ,

play08:35

এই অ্যাকাউন্টিং এর ক্ষেত্রে যদি

play08:39

আমরা ট্রান্সফার করি, তাহলে অ্যাকাউন্ট

play08:43

A থেকে অ্যাকাউন্ট B-এ ট্রান্সফার করার

play08:48

সময় অ্যাকাউন্ট A এবং অ্যাকাউন্ট

play08:51

B-এর ব্যালেন্সের যোগফল ট্রান্সফারের

play08:55

আগে এবং ট্রান্সফারের পরে একই হতে হবে।

play09:00

সুতরাং, টাকা অদৃশ্য হওয়া উচিত নয়, তা

play09:06

তৈরি হওয়াও উচিত নয়। আমরা ধরে নিই

play09:11

যে একটি ট্রাঞ্জাকসন যখন এটি এক্সিকিউট

play09:16

করতে শুরু করে। এটি অবশ্যই একটি কন্সিস্ট্যান্স

play09:21

ডাটাবেসে শুরু হবে যা প্রতিটি ক্ষেত্রে

play09:26

সঠিক। ট্রাঞ্জাকসনের সময় সাময়িক অসঙ্গতি

play09:30

হতে পারে। উদাহরণস্বরূপ, আপনি যদি এই সময়ে

play09:35

ইন্সট্রাকশন 4 বা ইন্সট্রাকশন 5 দেখেন,

play09:40

A অ্যাকাউন্টটি ইতিমধ্যে 50 ডলার ডেবিট হয়েছে

play09:48

এবং B অ্যাকাউন্টটিতে সেই 50 ডলার দ্বারা

play09:51

ক্রেডিট করা হয়নি। সুতরাং, আপনি যদি

play09:54

ইন্সট্রাকশন 4 যোগ করেন আপনি যদি দেখার

play09:56

চেষ্টা করেন, A এবং অ্যাকাউন্ট B এ ব্যালেন্সের

play09:59

যোগফল কত আপনি দেখতে পাবেন যে যোগফল 50

play10:05

ডলার কম। কিন্তু যখন ট্রাঞ্জাকসন

play10:09

সম্পূর্ণ হয়, এটি ছয়টি ইন্সট্রাকশন

play10:12

সম্পূর্ণ হয়, তারপর আবার, যোগফল শুরুতে

play10:17

যেমন ছিল তেমনই হবে। সুতরাং, এক্সিকিউসনের

play10:21

শুরুতে, এবং একটি সফল এক্সিকিউসনের

play10:24

শেষে ডাটাবেসটি অবশ্যই কন্সিস্ট্যান্ট

play10:27

হতে হবে এর মধ্যে ক্ষণস্থায়ী ইকনন্সিস্ট্যান্সি

play10:32

থাকতে পারে। সুতরাং, একে বলা হয় কন্সিস্ট্যান্সি

play10:37

প্রয়োজন।

play10:38

তৃতীয়টি আবার প্রথমে বাম দিকের উদাহরণটি

play10:42

দেখুন T1 একটি ট্রাঞ্জাকসন যার কথা আমরা বলছি।

play10:47

এবং ধরুন আরেকটি ট্রাঞ্জাকসন T2 আছে

play10:52

যা একই সাথে ঘটে। যদি এটি কঙ্কারেন্টলি

play10:57

ঘটে তাহলে ট্রাঞ্জাকসন T2 তে ধরুন আমাদের

play11:02

তিনটি ইন্সট্রাকশন রিড রয়েছে। সুতরাং,

play11:05

এটি A এবং B এর অ্যাকাউন্টের ব্যালেন্স পড়ার

play11:10

চেষ্টা করে এবং তাদের যোগফল প্রিন্ট করে।

play11:14

স্পষ্টতই, যদি ট্রানঞ্জাকসন T2 কে অনুমোদন দেওয়া

play11:18

হয় ট্রানঞ্জাকসন T2-এর এই তিনটি ইন্সট্রাকশন

play11:21

যদি তাদের এক্সিকিউট করার অনুমতি দেয়;

play11:25

ট্রানঞ্জাকসন T1 এর ইন্সট্রাকশন 3 এবং

play11:28

ইন্সট্রাকশন 4 এর মধ্যে, তাহলে T2 A + B

play11:34

এর একটি যোগফল প্রিন্ট করবে যা শুরুতে A +

play11:43

B - 50 ছিল। সুতরাং, এটি এমন হবে যেন কিছু

play11:49

ইনকন্সিস্ট্যান্সি ঘটেছে।

play11:50

আইসোলেসন প্রয়োজনীয়তা বলে যে যখন ট্রাঞ্জাকসনগুলি

play11:54

কঙ্কারেন্টলি ঘটে, তখন ট্রাঞ্জাকসনগুলির

play11:56

নেট প্রভাব এমন হওয়া উচিত যেন সেগুলিতে

play12:00

প্রথমে T1 ঘটেছে এবং তারপর T2 ঘটবে৷ প্রথমে

play12:05

T2 এক্সিকিউট করবে এবং তারপর T1 এক্সিকিউট

play12:10

করবে। যদিও তারা একযোগে বা মিশ্র

play12:13

পদ্ধতিতে চালাতে পারে, ডাটাবেসের

play12:16

এই ধরনের ইনকন্সিস্ট্যান্সির ফলাফল অন্যান্য ট্রাঞ্জাকশনের

play12:20

জন্য হওয়া উচিত নয়। সুতরাং, একে

play12:23

বলা হয় আইসোলেসন প্রয়োজনীয়তা।

play12:26

সুতরাং, ট্রাঞ্জাকশনগুলিকে যথাযথভাবে আইসোলেটেড

play12:28

, আপনার কর্মক্ষমতা খুব কম হবে। কঙ্কারেন্টলি

play12:32

ঘটার জন্য আমাদের ট্রাঞ্জাকসন প্রয়োজন,

play12:35

তবে আইসোলেসন অবশ্যই সিদ্ধ হতে হবে।

play12:39

চতুর্থটিকে ডিউরেবিলিটি ব্যর্থতা এলেও তা

play12:42

অব্যাহত থাকতে হবে। A থেকে B তে 50 ডলার স্থানান্তরের

play12:48

এই ট্রাঞ্জাকসনটি সফলভাবে সম্পন্ন

play12:51

হয়েছে ছয়টি ইন্সট্রাকশন এক্সিকিউট করা হয়েছে

play12:55

এবং টাকা স্থানান্তর করা হয়েছে, এটি অব্যাহত

play13:00

থাকবে যদিও পরবর্তীকালে ডাটাবেসে কিছু ত্রুটি

play13:04

কিছু ব্যর্থতা ঘটবে। সুতরাং, পরিবর্তনগুলি

play13:07

অবশ্যই ডিউরেবল হতে হবে।

play13:10

সুতরাং, এই চারটি বৈশিষ্ট্যকে একত্রে

play13:14

একটি ট্রাঞ্জাকসন ব্যবস্থার অ্যাসিড

play13:17

বৈশিষ্ট্য বলা হয়। অ্যাসিড মানে a হল

play13:21

এটোমিসিটির জন্য এই যে হয় ট্রাঞ্জাকসনের

play13:26

সমস্ত ক্রিয়াকলাপগুলি ডাটাবেসে সঠিকভাবে

play13:30

প্রতিফলিত হয় বা তাদের কোনটিই প্রতিফলিত

play13:35

হয় না কন্সিস্ট্যান্সি c হল ট্রাঞ্জাকসনের

play13:40

কন্সিস্ট্যান্সি এক্সিকিউসনে আইসোলেসন

play13:41

ডাটাবেসের ধারাবাহিকতা রক্ষা করে।

play13:44

আইসোলেসন প্রয়োজন, যদি একাধিক ট্রাঞ্জাকসন

play13:47

কঙ্কারেন্টলি ঘটা, ট্রাঞ্জাকসন Ti, Tj কঙ্কারেন্টলি

play13:51

ঘটছে অর্থাৎ Ti-এর কিছু ইন্সট্রাকশন

play13:54

ঘটবে তারপর Tj-এর কিছু ইন্সট্রাকশন ঘটবে

play13:58

তারপর Ti-এর কিছু ইন্সট্রাকশন আবার ঘটবে এবং এইভাবে

play14:03

চলবে। তারপরেও, চূড়ান্ত ফলাফলটি এমন হওয়া

play14:06

উচিত যেন Ti ঘটেছে তার পরে Tj বা Tj প্রথমে

play14:10

এক্সিকিউট হয়েছে তারপরে Ti । আইসোলেসন

play14:12

i হল আইসোলেসনের জন্য এবং পরিশেষে, ডিউরাবিলিটি

play14:17

একবার সফলভাবে ট্রাঞ্জাকসন সম্পন্ন হলে ডাটাবেসের

play14:21

পরিবর্তনগুলি অব্যাহত থাকা উচিত। সুতরাং,

play14:25

A C I D অ্যাসিড বৈশিষ্ট্যগুলি ট্রাঞ্জাকসন ব্যবস্থার

play14:30

গুরুত্বপূর্ণ বৈশিষ্ট্য এবং সর্বদা সিদ্ধ

play14:34

হতে হবে। পরবর্তীতে আমরা যা

play14:38

দেখি তা হল ট্রাঞ্জাকসনের প্রতিটি ইন্সট্রাক্সন

play14:43

দিয়ে যেতে যেতে।

play14:45

ট্রাঞ্জাকসনটি বিভিন্ন স্টেটের একটিতে ঘটেছে।

play14:49

ট্রাঞ্জাকসন শুরু হওয়ার সাথে সাথে

play14:53

ট্রাঞ্জাকসনটি শুরু হওয়ার সাথে সাথে

play14:57

এটি একটি সক্রিয় অবস্থায় থাকে। সুতরাং,

play15:01

বিবেচনা করুন যে এই একই ট্রাঞ্জাকসন

play15:06

করা হয়েছে পড়ুন এটি সক্রিয় অবস্থায়

play15:11

রয়েছে এটি A কে 50 দ্বারা হ্রাস করেছে এটি

play15:17

সক্রিয় অবস্থায় রয়েছে ইত্যাদি।

play15:20

সুতরাং, যতক্ষণ এটি এক্সিকিউট হচ্ছে,

play15:24

এটি সক্রিয় অবস্থায় রয়েছে, যদি না এটি

play15:29

প্রথমে সাফল্যের কথা বলে।

play15:33

সুতরাং, একবার এটি শেষ কাজটা এক্সিকিউট

play15:37

করার পরে, শেষ ইন্সট্রাকসনটি যা এখানে ইন্সট্রাকসন

play15:43

6, এটি এমন অবস্থায় রয়েছে যাকে বলা

play15:48

হয় পারসিয়ালি কমিটেড । সুতরাং, এটি সফলভাবে

play15:53

সমস্ত ইন্সট্রাকসন সম্পন্ন করতে পেরেছে।

play15:57

অথবা এটি এমন ঘটতে পারে যে সক্রিয়

play16:02

অবস্থায় থাকার সময়, বা পারসিয়ালি কমিটেড

play16:07

অবস্থায় থাকার সময় কিছু ত্রুটি ঘটেছে

play16:11

যাতে স্বাভাবিক এক্সিকিউসন আর এগোতে পারে না।

play16:17

তারপর, ট্রাঞ্জাকসনটি ব্যর্থ অবস্থায়

play16:20

আসে। ব্যর্থ অবস্থায় থাকা একটি ট্রাঞ্জাকসন

play16:25

শেষ পর্যন্ত বাতিল হয়ে যাবে, কারণ কখন

play16:30

ব্যর্থ হয়েছে তা জানা যায় না।

play16:35

সুতরাং, স্বাভাবিকভাবেই ব্যর্থতার সময় এই

play16:39

ট্রাঞ্জাকশনের চতুর্থ ইন্সট্রাকশনের একটি

play16:42

ইনকন্সিস্ট্যান্সি ব্যর্থতা ঘটতে পারে

play16:45

এবং আপনি ইতিমধ্যেই উল্লেখ করেছেন। যে

play16:49

A থেকে ইতিমধ্যেই 50 ডলার ডেবিট করা

play16:55

হয়েছে এবং B তে 50 ডলার ক্রেডিট করা হয়নি,

play17:01

তাই এটি একটি ইনকন্সিস্ট্যানট স্টেটে রয়েছে। ধরুন

play17:06

ব্যর্থতা যদি ট্রাঞ্জাকশনটি একটি ব্যর্থ স্টেটে

play17:11

থাকে তখন এটি আমাদের রোলব্যাক করতে হবে,

play17:16

আমরা যে পরিবর্তনগুলি করেছি সেগুলি পূর্বাবস্থায়

play17:20

ফিরিয়ে আনতে হবে৷ A থেকে ডেবিট করা 50

play17:25

ডলার আমাদের ফেরত দিতে হবে, যাতে আমরা

play17:31

একটি কন্সিস্ট্যান্ট স্টেটে পৌঁছাতে পারি।

play17:35

এবং একবার আমরা সফলভাবে এই রোলব্যাকটি সম্পন্ন

play17:40

করার পরে, ট্রাঞ্জাকসনটি একটি বাতিল স্টেটে

play17:45

চলে যায় অর্থাৎ এটি ঘটে না, এবং এর

play17:51

পরে আপনার কাছে দুটি পছন্দ রয়েছে হয়

play17:57

আপনি ট্রাঞ্জাকসনটি পুনরায় চালু করতে

play18:00

পারেন, অথবা আপনি ট্রাঞ্জাকসনটি সম্পূর্ণভাবে

play18:04

বন্ধ করতে পারেন, বিভিন্ন পরিস্থিতির

play18:08

উপর নির্ভর করে এটা করা হয়। অন্য ক্ষেত্রে

play18:14

যদি এটি পার্সিয়ালি কমিটেড হয়, তাহলে

play18:19

সমস্ত ইন্সট্রাকশন সম্পন্ন হয়েছে,

play18:22

এখন হিসাবরক্ষণ এবং অন্যান্য কাজের প্রয়োজন

play18:27

ছিল। পার্সিয়ালি কমিটেডে যদি কিছু

play18:31

ব্যর্থতা থাকে তবে এটি ব্যর্থ স্টেটে

play18:36

আসে এবং তারপরে আমি ইতিমধ্যেই ব্যাখ্যা

play18:40

করেছি যে সেটা বাতিল স্টেটে চলে যায়।

play18:46

অথবা এটি আসলে সমস্ত পরিবর্তনগুলি সঠিকভাবে

play18:50

কমিট করে এবং এটি সফলভাবে সম্পন্ন

play18:55

হয়েছে এবং এটি একটি কমিটেড স্টেটে যায়

play19:01

যেখানে ট্রাঞ্জাকসনটি সফলভাবে শেষ হয়েছে।

play19:04

সুতরাং, প্রতিটি ট্রাঞ্জাকসনই এই

play19:08

অবস্থার মধ্য দিয়ে যাবে যেকোন সময়ে

play19:12

একটি ট্রাঞ্জাকসন স্টেটগুলির একটিতে

play19:15

হবে এবং এক্সিকিউসন করার উপর নির্ভর

play19:20

করে এটি সেই স্টেটেই থাকবে বা স্টেটের

play19:26

পরিবর্তন হবে৷

play19:27

সুতরাং, ট্রাঞ্জাকসনের জন্য এই স্টেটের

play19:31

রূপান্তর চিত্রটি খুবই গুরুত্বপূর্ণ,

play19:34

এবং আপনাকে অবশ্যই ভালভাবে বুঝতে হবে

play19:39

যে কী ঘটছে এবং এই বিশেষ স্টেটের রূপান্তরটি

play19:45

ঠিক আছে মনে রাখবেন। এখন আসুন প্রকৃত

play19:50

বাস্তব এক্সিকিউসন পরিস্থিতিটি দেখি।

play19:54

সুতরাং, কঙ্কারেন্ট এক্সিকিউসনের পরিস্থিতিতে,

play19:57

আমাদের কাছে যা আছে আমাদের একাধিক ট্রাঞ্জাকসন

play20:02

রয়েছে যা একই সময়ে সিস্টেমে চলে। এটির

play20:08

সুবিধাগুলি হল এটি থ্রুপুট বৃদ্ধি করবে,

play20:12

এটি প্রসেসর উপলব্ধি বাড়াবে। উদাহরণস্বরূপ,

play20:16

যখন একটি ট্রাঞ্জাকসন CPU-তে কিছু ক্রিয়াকলাপ

play20:20

করছে, ডিস্কে কিছু অভ্যন্তরীণ গণনা

play20:24

চলছে তখনও অন্য ট্রাঞ্জাকসনের মাধ্যমে পড়ার জন্য

play20:28

সেটা অ্যাক্সেস করা যেতে পারে বা কিছু

play20:33

মান লেখাও যেতে পারে। সুতরাং, থ্রুপুট

play20:37

বাড়বে এবং গড় প্রতিক্রিয়ার সময়ও হ্রাস পাবে

play20:42

কারণ একটি ছোট ট্রাঞ্জাকসন হতে পারে যা যদি সিরিয়ালি

play20:48

করা হয় তবে এটিকে একটি দীর্ঘ ট্রাঞ্জাকসনের

play20:53

জন্য অপেক্ষা করতে হবে, যা ইতিমধ্যেই

play20:57

কার্যকর করা হয়েছে, কিন্তু যদি আমরা

play21:01

অনুমতি দিই কঙ্কারেন্ট এক্সিকিউসনের তাহলে

play21:05

সেই দীর্ঘ ট্রাঞ্জাকসনের মধ্যে ছোট ট্রাঞ্জাকসনটি

play21:09

সম্পাদন করতে কয়েকটি চক্র নেওয়া যেতে

play21:13

পারে এবং গড় প্রতিক্রিয়া সময় উন্নত হবে।

play21:18

সুতরাং, এটাই আমাদের মৌলিক চাহিদা। স্বাভাবিকভাবেই

play21:22

আমাদের এটি একটি নিয়ন্ত্রিত পদ্ধতিতে

play21:26

করতে হবে যাতে আমরা নিশ্চিত করতে পারি

play21:30

যে ডাটাবেসের কন্সিস্টেন্সি এবং অ্যাসিড বৈশিষ্ট্যগুলি

play21:35

বজায় রাখা হয়।

play21:37

তাহলে, এই কাজ করার জন্য আমরা যাকে বলা

play21:42

হয় সিডিউল ট্রাঞ্জাকসন সেটের জন্য এটির

play21:46

একটি সেট সংজ্ঞায়িত করবে। এবং এটি অবশ্যই

play21:51

সেই ট্রাঞ্জাকসনের সমস্ত নির্দেশাবলী

play21:54

নিয়ে গঠিত। এবং একটি নির্দিষ্ট ক্রমে,

play21:58

এবং মৌলিক প্রয়োজনীয়তা হল যে এই ক্রমানুসারে

play22:03

এই সময়সূচীতে, এই প্রদত্ত ট্রাঞ্জাকসনের

play22:06

যেকোনো নির্দেশের মূল ক্রম, আপনার একটি

play22:10

পৃথক ট্রাঞ্জাকসনের সংরক্ষণ করা আবশ্যক।

play22:14

কিন্তু বিভিন্ন ট্রাঞ্জাসন থেকে ইন্সট্রাকশন

play22:17

ইন্টারলিভ করব ঠিক আছে।

play22:20

সুতরাং, আসুন একটি উদাহরণ নেওয়া যাক,

play22:24

আবার আমরা একই উদাহরণে ফিরে যাচ্ছি। সুতরাং,

play22:29

আমাদের দুটি ট্রাঞ্জাকসন T1 এবং T2 আছে। T1 A থেকে

play22:35

B তে 50 ডলার স্থানান্তর করে যেমনটি আমরা

play22:39

দেখেছি। এবং T2 A থেকে B তে ব্যালেন্সের

play22:43

10 শতাংশ স্থানান্তর করে। একটি ট্রাঞ্জাকসন

play22:47

50 ডলার ডেবিট করে একটি ট্রাঞ্জাকসন

play22:51

A থেকে B এর অ্যাকাউন্ট ব্যালেন্সের 10 শতাংশ

play22:56

ডেবিট করে। সুতরাং, যদি সেগুলি ক্রমিকভাবে

play23:00

চালানো হয় যেমন আপনি এখানে দেখতে

play23:05

পাচ্ছেন আমরা সিরিয়ালি সেগুলিকে কার্যকর

play23:08

করছি। প্রথমে আপনি আপনার সম্পূর্ণ T1

play23:13

এক্সিকিউট করছেন, এবং একবার এটি কমিটেড

play23:17

হয়ে গেলে, এটি সফলভাবে শেষ হয়ে গেলে T2 এক্সিকিউট

play23:23

করছে। সুতরাং, শুরুতে যদি

play23:26

আমরা ধরে নিই যে এটি কেবল একটি অনুমান।

play23:32

আমরা যদি শুরুতে ধরে নিই যে A এর 100 ডলার

play23:37

এবং B এর 200 ডলার ছিল, তাহলে যোগফল ছিল

play23:43

300 ডলার। সুতরাং, যদি A রিড হয় 100 ডলার পড়া

play23:52

হয় তবে এটি 50 হয়ে যায় তারপর আপনি

play24:02

এই A লিখুন। সুতরাং, আপনি যখন এখানে থাকবেন,

play24:09

আপনি দেখতে পাচ্ছেন, এটি আপনার কাছে থাকবে

play24:16

কারণ A 100 থেকে 50 এ পরিবর্তিত হয়েছে কারণ আপনি

play24:20

B ডেবিট করেছেন B-তে কিছুই ঘটেনি, যোগফল

play24:24

হল 250। সুতরাং, আপনি দেখতে পাচ্ছেন তাই

play24:28

আমি বিভিন্ন রঙ দেখিয়েছি যা আপনি 250-এ দেখতে

play24:32

পাচ্ছেন। ডাটাবেসের এই অবস্থা সাময়িকভাবে

play24:35

ইনকন্সিস্ট্যান্ট কারণ যোগফল 300 থেকে

play24:38

আলাদা হয়ে গেছে। তারপর এটি B কে রিড

play24:42

করে এটি 200 যোগ করে সেই 250 এটি B তে লেখে।

play24:47

আপনি এই বিন্দুতে আসেন যেখানে এই লেখার

play24:51

পরে, যখন এই B তে লেখার পরে কমিট হচ্ছে।

play24:53

তারপর T1 আসলে সম্পূর্ণ হয়েছে, এবং 50 ডলার

play24:54

B এর অ্যাকাউন্টে স্থানান্তরিত হয়েছে,

play24:55

এবং যোগফল আবার 300-এ ফিরে আসে তাই, সামঞ্জস্য

play24:56

রক্ষা করা হয়। তারপর ট্রাঞ্জাকসন 2 শুরু

play24:57

হয়। তাই, A কে রিড করা হয় 50 ডলার অস্থায়ীভাবে

play24:58

পড়া হয় আপনি সেই 50 ডলারের 10 শতাংশ গণনা

play24:59

করেন আপনি a কে 5 ডলার কমিয়ে সেটা আবার

play25:00

লেখেন। সুতরাং, আপনি যখন

play25:01

এটি লিখবেন, আপনি 45 ডলার লিখবেন। আবার,

play25:02

স্বাভাবিকভাবেই যোগফল 5 ডলার কম হয়ে

play25:03

যায়, আপনি এই টেম্পে ভাবে ইনকন্সিস্ট্যান্ট

play25:04

হয়ে ওঠে। তারপর আপনি B কে রিড করবেন,

play25:05

সেই অস্থায়ী 5 ডলারকে B-তে ফেরত দিয়ে লিখবেন

play25:06

এবং তারপর আপনি শেষ পর্যন্ত, যখন আপনি

play25:07

এখানে B তে লিখবেন তখন 200 এবং 50 থেকে আপনি

play25:08

5 ডলার যোগ করেছেন 255, এবং আবার যোগফল

play25:09

300 হয়ে গেছে আপনি আবার ফিরে এসেছেন

play25:10

কন্সিস্ট্যান্সি স্টেটে।

play25:11

সুতরাং, আপনি এই প্রক্রিয়াটির মাধ্যমে দেখতে পাচ্ছেন

play25:12

যে যখন ট্রাঞ্জাকসনগুলি আসলে সিরিয়াল পদ্ধতিতে

play25:13

ঘটে, তখন জিনিসগুলি এভাবেই এগিয়ে যাবে,

play25:14

যেটা বেশ বোধগম্য।

play25:15

সুতরাং, এটি একটি অন্য সিডিউল যা আপনি

play25:16

দেখতে পাচ্ছেন, তবে এটি এখানে একটি সিরিয়াল

play25:17

সিডিউল দেখতে পারেন, কিন্তু শেষ পর্যন্ত

play25:18

ডাটাবেসটি একটি কন্সিস্ট্যানট স্টেটে রয়েছে।

play25:19

এবং আপনি লক্ষ্য করতে পারেন যে এখন

play25:20

A এর শেষ মান 40 ডলার এবং B এর n এর মান 260

play25:25

ডলার। আগের সিডিউলে মূল্য ছিল 45 ডলার,

play25:31

আর 255 ডলার এই দুটি আলাদা। কিন্তু তাদের

play25:37

উভয়ই প্রকৃতপক্ষে সঠিক তাদের উভয়ই

play25:40

কন্সিস্ট্যান্ট, কারণ যখন জিনিসগুলি

play25:43

এই বিতরণ পদ্ধতিতে ঘটে, তখন প্রথমে 50

play25:49

ডলার ডেবিট করা উচিত এবং তারপর 10 ডলার

play25:55

স্থানান্তর করা উচিত কিনা সে বিষয়ে আমাদের

play26:00

কোনও নিয়ন্ত্রণ নেই। অথবা প্রথমে

play26:04

10 ট্রান্সফার করা উচিত নাকি 50 ডলার

play26:09

এর পরে কোথায় ট্রান্সফার করা হবে, যে কোন একটি

play26:16

সঠিক কনসিস্ট্যান্ট স্টেট।

play26:18

সুতরাং, বিভিন্ন সিডিউল আপনাকে বিভিন্ন

play26:21

ফলাফল দিতে পারে যা কোনও উদ্বেগের

play26:26

বিষয় নয় কারণ উভয়ই সম্ভাব্য বৈধ ফলাফল।

play26:31

কিন্তু প্রশ্ন হল অবশেষে, ডাটাবেসের

play26:35

একটি কন্সিস্ট্যান্ট স্টেট থাকতে হবে

play26:39

তাই, এই দুটিই কন্সিস্ট্যান্ট।

play26:42

এখন, একটি আকর্ষণীয় উদাহরণ নিন, যেখানে

play26:46

সিডিউল 3 যেখানে এখানে আপনি, যদি আপনি মনোযোগ

play26:52

সহকারে দেখেন তবে T1 এর কয়েকটি ইন্সট্রাকশন

play26:57

এক্সিকিউট করা হয়েছে। এবং তারপর টেম্পোরাল

play27:02

অর্ডারে কিছু অন্যান্য ইন্সট্রাকশন, T2 এর

play27:06

কিছু ইন্সট্রাকশন এক্সিকিউট করা হয়,

play27:10

তারপর আবার T1 তারপর আবার T2।

play27:15

সুতরাং, দুটি আলাদা ট্রাঞ্জাকসনের ইন্সট্রাকশন

play27:18

পরস্পর বিচ্ছিন্ন হয়ে যাচ্ছে। এবং

play27:22

এটা হল এক্সিকিউসনের অবস্থা। সুতরাং,

play27:26

আপনি দেখতে পাচ্ছেন যে আপনি যখন T1 এ A কে

play27:32

লেখেন এখানে আপনি 50 ডলার ডেবিট হয়েছে।

play27:35

তারপরে যখন T2 পরবর্তীতে A তে লেখে, তখন আরও

play27:39

5 ডলার ডেবিট করা হয়, তাই এটি 45 হয়ে যায়।

play27:44

তারপরে আপনার কাছে T1 আবার এক্সিকিউট

play27:47

করতে হবে এবং এতে B যোগ করতে হবে। এবং

play27:51

এর দ্বারা এটি কেবলমাত্র যে এটি একটি ইনকন্সিস্ট্যান্ট-এ

play27:53

চলে গেছে তা নয়, এটি ইতিমধ্যেই একটি ইনকন্সিস্ট্যান্ট

play27:56

অবস্থায় ছিল, তবে এটি ক্ষণস্থায়ী

play27:57

ছিল যা অস্থায়ী ছিল। কিন্তু এখন

play27:59

T1 ট্রাঞ্জাকসন সম্পূর্ণভাবে সম্পন্ন হয়েছে।

play28:01

এটা তার এক্সিকিউসন সম্পন্ন করেছে এটা

play28:02

কমিট হয়, কিন্তু আপনার ডাটাবেস একটি

play28:04

ইনকন্সিস্ট্যান্ট স্টেটে এখনও আছে।

play28:06

সুতরাং, এটি এমন কিছু যা সম্ভব, কারণ আপনি

play28:08

সিডিউলে দুটি ট্রাঞ্জাকসনের ইন্সট্রাকশনগুলো

play28:09

ইন্টারলিভিং করছেন। কিন্তু একবার আপনি

play28:11

B এর বাকি ট্রাঞ্জাকসনকে অনুমতি দিলে এই অংশটি

play28:13

B আপডেট হয়ে যায় এবং আপনি এখানে পৌঁছান।

play28:14

এবং সেটাও কমিটেড হয়। সুতরাং, আপনার

play28:15

সিডিউল ট্রাঞ্জাকসন 1 এবং ট্রাঞ্জাকসন

play28:16

2 নিয়ে গঠিত, যখন উভয়ই সম্পূর্ণ হয়ে

play28:17

গেছে আপনি আবার সেই অবস্থায় পৌঁছেছেন

play28:18

যা কন্সিস্ট্যান্ট। এবং আপনি যা অর্জন

play28:19

করেছেন তার ফলাফলগুলি যদি আপনি দেখেন তবে

play28:20

আপনি অবিলম্বে সনাক্ত করতে পারবেন যে এটি

play28:21

সিডিউল 3 অনুযায়ী ট্রাঞ্জাকসন করছে,

play28:22

যা এই পদ্ধতিতে ইন্টারলিভিং করা হচ্ছে এই পদ্ধতিতে

play28:23

ইন্টারলিভিং এর সমতুল্য এই পদ্ধতিতে যা সিডিউল

play28:24

1 । সুতরাং, আপনি একটি

play28:25

সিডিউল পেয়েছেন যা সিডিউল 1 এর সমতুল্য।

play28:26

এবং এটি তাই, এটি দেখানোর জন্য এটি একটি উদাহরণ

play28:27

মাত্র যে দুটি ট্রাঞ্জাকশনের ইন্সট্রাকশনকে ইন্টারলিভ

play28:28

করা সম্ভব, এবং একটি সিডিউল তৈরি করা

play28:29

যা এখনও ক্ষণস্থায়ী বা এমনকি ডেটাবেসের

play28:30

ইন্কন্সিস্ট্যান্ট কমিট স্টেটে থাকতে

play28:31

পারে। কিন্তু অবশেষে, সিডিউল শেষ হলে এটা

play28:32

সম্ভব যে এটি আপনাকে একটি কন্সিস্ট্যান্ট

play28:33

অবস্থায় নিয়ে আসবে।

play28:34

এখন, সেই ট্রাঞ্জাকশনের জন্য আবার দেখুন

play28:35

একটি ভিন্ন ইন্টারলিভিং, একটি ভিন্ন সিডিউল,

play28:36

আবার T1, T2 জড়িত। কিন্তু আপনি এখন একটি ভিন্ন

play28:37

ক্রমে তাদের ইন্টারলিভ করার চেষ্টা করেছেন৷

play28:38

সুতরাং, আগে ইন্টারলিভিং করা হয়েছিল T1 করার

play28:39

পরে A লিখতে হবে, এখানে এটি স্থানীয়ভাবে

play28:40

50 দ্বারা ডেবিট হওয়ার পরে করা হয়েছে।

play28:41

এবং তারপরে এই অংশটি সম্পন্ন হয়েছে এবং

play28:42

তারপরে লেখা হচ্ছে। এবং এখন আপনি যদি

play28:43

ধাপগুলি অতিক্রম করেন তবে আমি এটিকে

play28:44

আপনার জন্য একটি অনুশীলন হিসাবে সিডিউল

play28:45

4 এ রেখে দেব। এখন, আপনি যদি স্টেটের

play28:46

মধ্য দিয়ে যান তবে আপনি দেখতে পাবেন

play28:47

যে যখন ট্রাঞ্জাকসন T1 এখানে কমিট হয়,

play28:48

তখন আপনার একটি ইনকন্সিস্ট্যান্ট স্টেট রয়েছে। এবং

play28:49

অবশেষে, এমনকি যখন সিডিউলটি শেষ হয়

play28:50

যে T2 কমিটেড হয়। সেখানে A আছে, আপনি একটি ইনকন্সিস্ট্যান্ট

play28:51

স্টেটে আছেন যে A এবং B এর যোগফল যা 350 ছিল

play28:52

300 হয়ে গেছে 350 হয়েছে তাহলে, 50 ডলার যা জেনারেট

play28:53

হয়েছে। সুতরাং, এটি আপনি দেখতে পাচ্ছেন

play28:54

যে আপনি যদি ট্রাঞ্জাকসনগুলিকে আলাদা করেন, তবে এটি

play28:55

খুব সম্ভব যে ট্রাঞ্জাকসনগুলি আপনাকে একটি কন্সিস্ট্যান্ট

play28:56

ডেটাবেস দেবে বা নাও দিতে পারে।

play28:57

সুতরাং, এখানে এই মডিউলে, আমরা বুঝলাম

play28:58

যে একটি ডাটাবেস এক্সিকিউট করে থাকে;

play28:59

যা একটি ট্রাঞ্জাকসনের মত করে হয়। এবং আমরা

play29:00

দেখেছি যে তাদের অবশ্যই অ্যাসিড বৈশিষ্ট্য

play29:01

নামে পরিচিত বৈশিষ্ট্যগুলির একটি সেট পূরণ করতে

play29:02

হবে এবং এটোমিসিটি, কন্সিস্ট্যান্সি,

play29:03

আইসোলেসন এবং ডিউরাবিলিটি অবশ্যই সিদ্ধ হতে

play29:04

হবে। এবং যখন ট্রাঞ্জাকসনগুলি কঙ্কারেন্ট পদ্ধতিতে

play29:05

সম্পাদিত হয়, তখন আমরা থ্রুপুট উন্নত

play29:06

করি, কিন্তু ট্রাঞ্জাকসনের কঙ্কারেন্ট এক্সিকিউসন

play29:07

সিরিয়ালাইজিবিলিটির সমস্যাগুলি উত্থাপন

play29:08

করে; অর্থাৎ, দুই বা ততোধিক ট্রাঞ্জাকসনের

play29:09

নির্দেশের ইন্টারলিভড সিডিউল কঙ্কারেন্ট

play29:10

এক্সিকিউসনের ফলে নির্দিষ্ট প্রভাবের

play29:11

জন্ম দিতে পারে যা অ্যাসিড বৈশিষ্ট্য

play29:12

লঙ্ঘন করে। এবং অবশ্যই ইনকন্সিস্ট্যান্ট

play29:13

ডাটাবেস অবশ্যই গ্রহণযোগ্য নয় যেটার সুরাহা

play29:14

করা প্রয়োজন। এবং তাই এটি মৌলিক সমস্যা

play29:15

যা আমরা চিহ্নিত করেছি যা আমাদের

play29:16

আগামী মডিউলগুলিতে সমাধান করতে হবে।

Rate This

5.0 / 5 (0 votes)

الوسوم ذات الصلة
Database ManagementACID PropertiesData ConsistencyTransaction ProcessingConcurrency ControlData IntegrityDatabase SystemsTransaction IsolationDurabilityConsistency
هل تحتاج إلى تلخيص باللغة الإنجليزية؟