The workshop "All About Firebird Transactions" will take place on the 2nd day of the Firebird Conference 2019, the duration of the workshop will be 3 hours.
||Vlad Khorsun - Firebird core developer, responsible (along with other things) for the implementation of transactions in the engine.
||Dmitry Kuzmenko - lead developer and trainer at IBSurgeon. Dmitry has more than 25 years of the experience with InterBase and Firebird, with a focus on the database performance and applications development.
Understanding transactions is crucial for every experienced Firebird developer to be able to create fast, scalable multi-user applications.
In this workshop, we will go through the basics of transactions and in-depth details of their implementation, and we will also consider the impact that transactions have on database performance.
The practical part of the workshop will include the demonstration of the debugging methods, investigation of deadlock reasons, and best practices for the various tasks.
Attention! Before the workshop: it is recommended to attend the presentation "New transactions' features in Firebird 4" at the Day 1, and read these introductory articles (1st, 2nd), as well as take a look on this presentation.
Below you can find the detailed topics for the workshop "All About Firebird Transactions":
1. Transaction basics
- What is ACID
- Transaction parameters
- read only\write
- wait and nowait
- What is a deadlock
- Isolation levels of transactions:
- read committed rec version | no rec version | read consistency
- snapshot table stability
2. Transaction inventory page, versions and how transactions work in the multi-generation database.
- Managing transaction: SET TRANSACTION and TPB parameters
- Some undocumented parameters
- Who create transactions
- System transaction (tx #0)
- Garbage collector
- Autonomous transactions
- Triggers ON CONNECT\ON DISCONNECT
- Versioning basics
- How versions are being created
- States of transaction in Firebird (active, committed, rolled back, limbo)
- Visibility of record versions in transactions
- Key differences between Read Committed and Snapshot
- Triggers for transactions start and stop
- Context variables at the transaction’s level
3. Inside Firebird transactions: what happens inside the engine during transactions’ start, commit, rollback.
- What happens at transactions’ start
- Global transaction markers (OAT, OST, OIT) and their meaning
- What happens at transaction commit
- How DWF works
- DDL queries
- Dispatching events
- Flush of dirty pages
- TIP processing
- What happens at rollback
- Standard rollback with cache flush
- Forces rollback without cache flush
- Rollback transactions with undo-log
- Rollback without undo-log
- What is retaining
- Managing memory for transactions
- Temporary BLOBs
- Local TIP and related issues
4. Transactions interaction and best practices for application development. Conflicts between transactions.
- Transactions interactions types
- Templates for transaction usage in application development
- Scenarios breakdown: Readers and Readers, Readers and Writers, Writers and Writers
- Best practices
- Splitting read and write transactions
- Locking record with empty Update
- Locking with SELECT WITH LOCK
- Serialization: how to build effective queues
5. Garbage collection mechanism and sweep in details
- Types of garbage collection: cooperative, background, background
- Why do we need to sweep?
- How sweep works
- Differences between sweep and garbage collection
- Autosweep: pro and contras
- Examples of application design mistakes which lead to excessive garbage
6. Practical transactions management
- How to manage transactions lifetime in various drivers
- How to implement edit dialogs in an effective and safe way
- Commit retaining
- When garbage collection does not work?
- Transaction markers dynamics analysis - how to identify sweep
- How to determine the number of garbage versions
- How to find long transactions with MON$ tables
- Transactions monitoring with MON$ and TraceAPI.
- How to track deadlocks
- Legacy applications: workarounds for error in transactions management