Locks, Blocks, and Snapshots: Maximizing Database Concurrency (Chicago Suburb...Bob Pusateri
This document provides an overview of database concurrency and transaction isolation levels in SQL Server. It begins by defining concurrency and how it allows for parallel operations on shared data. It then discusses concurrency conflicts like dirty reads, non-repeatable reads and lost updates. The document proceeds to explain different isolation levels like read committed, repeatable read and serializable, and how they guarantee consistency. It also covers concepts like locking, multi-version concurrency control and snapshot isolation. Overall, the document serves as a good primer on database concurrency fundamentals in SQL Server.
This document provides an overview of database concurrency and transaction isolation levels in SQL Server. It begins with an introduction to concurrency basics and potential concurrency conflicts. It then details the different isolation levels in SQL Server from READ UNCOMMITTED to SERIALIZABLE, explaining their characteristics and tradeoffs. The document also covers topics like locking, multi-version concurrency control, and In-Memory OLTP. Overall, it serves as a comprehensive primer on database concurrency and isolation levels in SQL Server.
JS Fest 2019. Александр Хотемский. Способы распараллеливания тестов в JavaScriptJSFestUA
This document discusses various ways to parallelize tests in JavaScript, including:
1. Concurrent execution by taking advantage of asynchronous code to run multiple tests simultaneously.
2. Parallelism using Node.js processes by distributing test files across multiple processes.
3. Parallelism using worker threads enabled in Node.js to run tests concurrently in separate threads.
4. Potential approaches using Functions as a Service (FaaS) or isolates to parallelize tests across isolated environments.
The document compares the approaches in terms of performance, resource usage, isolation, and support from test frameworks. It recommends worker threads as a promising approach being adopted by test frameworks.
This document provides guidance on contributing to the Node.js core codebase. It recommends writing tests before submitting code changes, explains Node's test structure and best practices for writing good tests, and gives an overview of Node's core source code structure and key modules like http and tcp. The document concludes by assigning homework for attendees to read CONTRIBUTING.md, write a test, and submit a patch to fix a bug on GitHub.
This document discusses testing strategies for the iOS Sync Engine. It provides overall test stats, including that unit tests make up 80% of tests and integration tests make up 20%. The main testing strategy is to test against a fake backend called MockTransportSession, which provides advantages like speed, flexibility and independence over using stubs. MockTransportSession simulates the real backend by making fake requests, managing an internal database, and responding to requests. Future plans include splitting tests into smaller frameworks to reduce runtime, running tests on pull requests, and using record/replay to keep MockTransportSession in sync with the real backend.
About a wide range of spectrum of Data Consistency models.
Created thanks to a lot of smart and generous people that shared their knowledge and insights into the subject. Thanks to you all !
Hope this can help you scratch the surface of the subject of consistency models too.
This document discusses implementing closures in Java using inner classes and lambda expressions. It explains that inner classes can capture local variables and implement closures. Lambda expressions allow treating functions as values and auto-converting between functional interfaces. The document also covers proposed syntax for lambda expressions and how default methods allow adding methods to interfaces without breaking backward compatibility.
Locks, Blocks, and Snapshots: Maximizing Database Concurrency (Chicago Suburb...Bob Pusateri
This document provides an overview of database concurrency and transaction isolation levels in SQL Server. It begins by defining concurrency and how it allows for parallel operations on shared data. It then discusses concurrency conflicts like dirty reads, non-repeatable reads and lost updates. The document proceeds to explain different isolation levels like read committed, repeatable read and serializable, and how they guarantee consistency. It also covers concepts like locking, multi-version concurrency control and snapshot isolation. Overall, the document serves as a good primer on database concurrency fundamentals in SQL Server.
This document provides an overview of database concurrency and transaction isolation levels in SQL Server. It begins with an introduction to concurrency basics and potential concurrency conflicts. It then details the different isolation levels in SQL Server from READ UNCOMMITTED to SERIALIZABLE, explaining their characteristics and tradeoffs. The document also covers topics like locking, multi-version concurrency control, and In-Memory OLTP. Overall, it serves as a comprehensive primer on database concurrency and isolation levels in SQL Server.
JS Fest 2019. Александр Хотемский. Способы распараллеливания тестов в JavaScriptJSFestUA
This document discusses various ways to parallelize tests in JavaScript, including:
1. Concurrent execution by taking advantage of asynchronous code to run multiple tests simultaneously.
2. Parallelism using Node.js processes by distributing test files across multiple processes.
3. Parallelism using worker threads enabled in Node.js to run tests concurrently in separate threads.
4. Potential approaches using Functions as a Service (FaaS) or isolates to parallelize tests across isolated environments.
The document compares the approaches in terms of performance, resource usage, isolation, and support from test frameworks. It recommends worker threads as a promising approach being adopted by test frameworks.
This document provides guidance on contributing to the Node.js core codebase. It recommends writing tests before submitting code changes, explains Node's test structure and best practices for writing good tests, and gives an overview of Node's core source code structure and key modules like http and tcp. The document concludes by assigning homework for attendees to read CONTRIBUTING.md, write a test, and submit a patch to fix a bug on GitHub.
This document discusses testing strategies for the iOS Sync Engine. It provides overall test stats, including that unit tests make up 80% of tests and integration tests make up 20%. The main testing strategy is to test against a fake backend called MockTransportSession, which provides advantages like speed, flexibility and independence over using stubs. MockTransportSession simulates the real backend by making fake requests, managing an internal database, and responding to requests. Future plans include splitting tests into smaller frameworks to reduce runtime, running tests on pull requests, and using record/replay to keep MockTransportSession in sync with the real backend.
About a wide range of spectrum of Data Consistency models.
Created thanks to a lot of smart and generous people that shared their knowledge and insights into the subject. Thanks to you all !
Hope this can help you scratch the surface of the subject of consistency models too.
This document discusses implementing closures in Java using inner classes and lambda expressions. It explains that inner classes can capture local variables and implement closures. Lambda expressions allow treating functions as values and auto-converting between functional interfaces. The document also covers proposed syntax for lambda expressions and how default methods allow adding methods to interfaces without breaking backward compatibility.
The main challenge in growing an ecosystem on the JVM is providing stable interfaces without halting evolution. We look at the most popular dependency management solutions in Java-land and how Scala fits in.
Implementing JSP tag extensions discusses developing custom JSP tags. Custom tags are translated into servlets with tag handlers that operate on the JSP page. There are three types: simple tags without attributes or body; tags with attributes; and tags with body content. Creating a custom tag requires a tag handler class, a Tag Library Descriptor (TLD) file describing the tag, and a JSP page importing and using the tag. The tag handler outputs content or invokes the body. Attributes are handled via set methods, and body content via getJspBody().invoke().
This document provides an overview and summary of key concepts related to advanced databases. It discusses relational databases including MySQL, SQL, transactions, and ODBC. It also covers database topics like triggers, indexes, and NoSQL databases. Alternative database systems like graph databases, triplestores, and linked data are introduced. Web services, XML, and data journalism are also briefly summarized. The document provides definitions and examples of these technical database terms and concepts.
AJAX allows for asynchronous data retrieval and dynamic display. It uses technologies like XML, XSLT, DOM, and JavaScript. Servlet 3.0 includes annotations and methods to support asynchronous processing, allowing requests to be processed asynchronously without blocking the original thread. The AsyncContext class provides an execution context for asynchronous operations and wraps the request and response.
Conditional Logging Considered Harmful - Sean ReillyJAXLondon2014
The document discusses the issues with conditional logging frameworks and advocates for an alternative approach using enum-based logging designed specifically for operations. It proposes logging through enums where each value has a unique code and format string. The output is designed to be easy to read and parse. An open source Java library called OpsLogger is introduced that follows this pattern and is testable, generates documentation, and is optimized for log file rotation.
This document describes EhTrace, a tool for tracing the execution of binary programs through hooking and branch stepping. EhTrace uses the Windows VEH exception handler to single step programs by setting flags in the CPU context. It can be used to analyze program control flow at the basic block level for purposes like malware analysis, debugging, and code coverage. The document discusses techniques for maintaining control during tracing and fighting attempts by the target program to detect or alter the tracing.
The document discusses problems that arose with scaling a Smalltalk web server called Silt without any initial planning. Key problems included supporting multiple blogs, slow page loads from repetitive file reads, slow category and keyword searches, and spam issues. Solutions involved refactoring code into separate classes, adding caching at various levels, offloading expensive searches to background threads, and updating anti-spam mechanisms. The author notes that problems were only solved reactively as they emerged and that Smalltalk proved capable of handling the scaling needs.
Concurrency and Multithreading Demistified - Reversim Summit 2014Haim Yadid
Life as a software engineer is so exciting! Computing power continue to rise exponentially, software demands continue to rise exponentially as well, so far so good. The bad news are that in the last decade the computing power of single threaded application remains almost flat.
If you decide to continue ignoring concurrency and multi-threading the gap between the problems you are able to solve and your hardware capabilities will continue to rise. In this session we will discuss different approaches for taming the concurrency beast, such as shared mutability,shared immutability and isolated mutability actors, STM, etc we will discuss the shortcomings and the dangers of each approach and we will compare different programming languages and how they choose to tackle/ignore concurrency.
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
This document summarizes new features and enhancements in Java SE 7, including allowing strings in switch statements, binary and underscored numeric literals, try-with-resources for automatic resource management, and the diamond operator for simplifying generic object creation. It also briefly mentions features like multiple exception handling in a catch clause, the Path API for type-safe file paths, directory streaming and watching capabilities in NIO.2, and the future of Java focusing on productivity, performance, and modularization.
This document provides an introduction to dependency injection. It explains that dependency injection allows code to request dependencies rather than create them directly, making code more flexible and testable. It demonstrates how to define interfaces for dependencies and configure a dependency injection container to resolve them. Writing unit tests is easier with dependency injection because mock dependencies can be passed in instead of real implementations. The document also discusses additional features of dependency injection containers like lifetime management and configuration options.
MEF (Managed Extensibility Framework) is a framework for creating extensible applications that focuses on discovery of parts at runtime. It allows for exposing and importing functionality through composable parts defined with attributes. Catalogs define which parts are available to the system and can be filtered. The composition container wires everything together and satisfies dependencies. Export providers determine the lifetime of parts as shared, non-shared, or any. MEF demonstrates composition, filtering, recomposition, and creation policies through examples. While MEF puts components together, it is not an inversion of control container that defines dependencies.
The document provides a 12 step guide to writing efficient and maintainable LotusScript code. The steps include how to code with a focus on maintenance, testing early and often, planning before coding with the "measure twice, cut once" approach, using defensive coding practices, leveraging built-in data types like NotesDateTime instead of strings, and using functions like Evaluate and GetThreadInfo to get runtime information. Logging is also recommended for applications with scheduled agents or a diverse user base. The overall emphasis is on writing code that is well-structured, tested, and optimized for long-term maintenance and support.
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Haganderpgdayrussia
Доклад был представлен на официальной российской конференции PG Day'14 Russia, посвященной вопросам разработки и эксплуатации PostgreSQL.
PostgreSQL supports several options for securing communications when deployed outside of the typical webserver/database combination, or in a high security environments. This talk will go into some details about the features that make this possible. The main areas discussed are:
Securing the PostgreSQL infrastructure and runtime environment.
Securing the channel between client and server using SSL, including an overview of the threats and how to secure against them.
Securing the login process with methods including LDAP, Kerberos or SSL certificates.
NET is a software framework developed by Microsoft which provides a controlled programming environment where development, installation and execution of the software can be done on windows based operating system. The .NET Training offers knowledge about .NET framework that supports the building and running of next gen applications and XML web services.
The importance of search for modern applications is evident and nowadays it is higher than ever. A lot of projects use search forms as a primary interface for communication with a user. Though implementation of an intelligent search functionality is still a challenge and we need a good set of tools.
In this presentation, I will talk through the high-level architecture and benefits of Elasticsearch with some examples. Aside from that, we will also take a look at its existing competitors, their similarities, and differences.
This document provides an outline for a presentation on concurrency in SQL Server. The presentation introduction discusses sessions, locking, blocking, deadlocks, and pressure. It then covers transactions, isolation levels, and phenomena like dirty reads, non-repeatable reads, and phantom reads. The document discusses the speaker's background and certifications. It concludes with an outline of topics to be covered, including locking basics, advanced locking concepts, controlling locking, pessimistic and optimistic concurrency approaches.
The nightmare of locking, blocking and isolation levels!Boris Hristov
am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The main challenge in growing an ecosystem on the JVM is providing stable interfaces without halting evolution. We look at the most popular dependency management solutions in Java-land and how Scala fits in.
Implementing JSP tag extensions discusses developing custom JSP tags. Custom tags are translated into servlets with tag handlers that operate on the JSP page. There are three types: simple tags without attributes or body; tags with attributes; and tags with body content. Creating a custom tag requires a tag handler class, a Tag Library Descriptor (TLD) file describing the tag, and a JSP page importing and using the tag. The tag handler outputs content or invokes the body. Attributes are handled via set methods, and body content via getJspBody().invoke().
This document provides an overview and summary of key concepts related to advanced databases. It discusses relational databases including MySQL, SQL, transactions, and ODBC. It also covers database topics like triggers, indexes, and NoSQL databases. Alternative database systems like graph databases, triplestores, and linked data are introduced. Web services, XML, and data journalism are also briefly summarized. The document provides definitions and examples of these technical database terms and concepts.
AJAX allows for asynchronous data retrieval and dynamic display. It uses technologies like XML, XSLT, DOM, and JavaScript. Servlet 3.0 includes annotations and methods to support asynchronous processing, allowing requests to be processed asynchronously without blocking the original thread. The AsyncContext class provides an execution context for asynchronous operations and wraps the request and response.
Conditional Logging Considered Harmful - Sean ReillyJAXLondon2014
The document discusses the issues with conditional logging frameworks and advocates for an alternative approach using enum-based logging designed specifically for operations. It proposes logging through enums where each value has a unique code and format string. The output is designed to be easy to read and parse. An open source Java library called OpsLogger is introduced that follows this pattern and is testable, generates documentation, and is optimized for log file rotation.
This document describes EhTrace, a tool for tracing the execution of binary programs through hooking and branch stepping. EhTrace uses the Windows VEH exception handler to single step programs by setting flags in the CPU context. It can be used to analyze program control flow at the basic block level for purposes like malware analysis, debugging, and code coverage. The document discusses techniques for maintaining control during tracing and fighting attempts by the target program to detect or alter the tracing.
The document discusses problems that arose with scaling a Smalltalk web server called Silt without any initial planning. Key problems included supporting multiple blogs, slow page loads from repetitive file reads, slow category and keyword searches, and spam issues. Solutions involved refactoring code into separate classes, adding caching at various levels, offloading expensive searches to background threads, and updating anti-spam mechanisms. The author notes that problems were only solved reactively as they emerged and that Smalltalk proved capable of handling the scaling needs.
Concurrency and Multithreading Demistified - Reversim Summit 2014Haim Yadid
Life as a software engineer is so exciting! Computing power continue to rise exponentially, software demands continue to rise exponentially as well, so far so good. The bad news are that in the last decade the computing power of single threaded application remains almost flat.
If you decide to continue ignoring concurrency and multi-threading the gap between the problems you are able to solve and your hardware capabilities will continue to rise. In this session we will discuss different approaches for taming the concurrency beast, such as shared mutability,shared immutability and isolated mutability actors, STM, etc we will discuss the shortcomings and the dangers of each approach and we will compare different programming languages and how they choose to tackle/ignore concurrency.
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
This document summarizes new features and enhancements in Java SE 7, including allowing strings in switch statements, binary and underscored numeric literals, try-with-resources for automatic resource management, and the diamond operator for simplifying generic object creation. It also briefly mentions features like multiple exception handling in a catch clause, the Path API for type-safe file paths, directory streaming and watching capabilities in NIO.2, and the future of Java focusing on productivity, performance, and modularization.
This document provides an introduction to dependency injection. It explains that dependency injection allows code to request dependencies rather than create them directly, making code more flexible and testable. It demonstrates how to define interfaces for dependencies and configure a dependency injection container to resolve them. Writing unit tests is easier with dependency injection because mock dependencies can be passed in instead of real implementations. The document also discusses additional features of dependency injection containers like lifetime management and configuration options.
MEF (Managed Extensibility Framework) is a framework for creating extensible applications that focuses on discovery of parts at runtime. It allows for exposing and importing functionality through composable parts defined with attributes. Catalogs define which parts are available to the system and can be filtered. The composition container wires everything together and satisfies dependencies. Export providers determine the lifetime of parts as shared, non-shared, or any. MEF demonstrates composition, filtering, recomposition, and creation policies through examples. While MEF puts components together, it is not an inversion of control container that defines dependencies.
The document provides a 12 step guide to writing efficient and maintainable LotusScript code. The steps include how to code with a focus on maintenance, testing early and often, planning before coding with the "measure twice, cut once" approach, using defensive coding practices, leveraging built-in data types like NotesDateTime instead of strings, and using functions like Evaluate and GetThreadInfo to get runtime information. Logging is also recommended for applications with scheduled agents or a diverse user base. The overall emphasis is on writing code that is well-structured, tested, and optimized for long-term maintenance and support.
PG Day'14 Russia, Secure PostgreSQL Deployment, Magnus Haganderpgdayrussia
Доклад был представлен на официальной российской конференции PG Day'14 Russia, посвященной вопросам разработки и эксплуатации PostgreSQL.
PostgreSQL supports several options for securing communications when deployed outside of the typical webserver/database combination, or in a high security environments. This talk will go into some details about the features that make this possible. The main areas discussed are:
Securing the PostgreSQL infrastructure and runtime environment.
Securing the channel between client and server using SSL, including an overview of the threats and how to secure against them.
Securing the login process with methods including LDAP, Kerberos or SSL certificates.
NET is a software framework developed by Microsoft which provides a controlled programming environment where development, installation and execution of the software can be done on windows based operating system. The .NET Training offers knowledge about .NET framework that supports the building and running of next gen applications and XML web services.
The importance of search for modern applications is evident and nowadays it is higher than ever. A lot of projects use search forms as a primary interface for communication with a user. Though implementation of an intelligent search functionality is still a challenge and we need a good set of tools.
In this presentation, I will talk through the high-level architecture and benefits of Elasticsearch with some examples. Aside from that, we will also take a look at its existing competitors, their similarities, and differences.
This document provides an outline for a presentation on concurrency in SQL Server. The presentation introduction discusses sessions, locking, blocking, deadlocks, and pressure. It then covers transactions, isolation levels, and phenomena like dirty reads, non-repeatable reads, and phantom reads. The document discusses the speaker's background and certifications. It concludes with an outline of topics to be covered, including locking basics, advanced locking concepts, controlling locking, pessimistic and optimistic concurrency approaches.
The nightmare of locking, blocking and isolation levels!Boris Hristov
am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The nightmare of locking, blocking and isolation levelsBoris Hristov
This document discusses transaction locking and isolation levels in SQL Server. It begins with an introduction to locks, their types (shared, update, exclusive), and how they are used for concurrency control. It then covers locking troubleshooting topics like lock escalation, deadlocks, and blocking. The document concludes with an overview of the different transaction isolation levels in SQL Server, including the tradeoffs between pessimistic and optimistic concurrency control approaches.
The nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
Aim of this presentation is not to make you masters in Java 8 Concurrency, but to help you guide towards that goal. Sometimes it helps just to know that there is some API that might be suitable for a particular situation. Make use of the pointers given to search more and learn more on those topics. Refer to books, Java API Documentation, Blogs etc. to learn more. Examples and demos for all cases discussed will be added to my blog www.javajee.com.
Welcome to the nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The document discusses asynchronous programming with async and await in C#. It explains that async and await were introduced to address issues with threading like overhead and blocking. Async methods use threads efficiently from the thread pool rather than creating new threads. Await yields threads rather than blocking them. The document demonstrates async programming and best practices like using Task instead of async void. It recommends using async for I/O bound work since it can improve performance over synchronous code.
Welcome to the nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
This presentation was used in a Redis talk that took place in ALT.NET Melbourne at February 25th, 2014. It is aimed for .Net developers, though almost all of the slides solely discuss Redis as the data store server, without any relation to client libraries in general and .Net in particular.
Geek Sync | How to Detect, Analyze, and Minimize SQL Server Blocking and LockingIDERA Software
You can watch the replay for this Geek Sync webcast in the IDERA Resource Center: http://ow.ly/sbap50AJw6b
Learn the good, the bad, and the ugly of blocking. Join IDERA and Hilary Cotter for this Geek Sync to understand how to monitor locking and blocking.
The goals of this session are:
-To discover what is the difference between locking, blocking and deadlocking
-To understand how to minimize blocking during OLTP operations, batch processing, bulk inserts, and large scale deletes
-To study how to use the appropriate isolation levels to reduce/increase blocking and partitioning and blocking
Attend this webinar to detect, analyze, and minimize SQL Server blocking and locking. The session will also discuss what Snapshot and Read Committed Snapshot Isolation levels are all about and when you should use them. Finally, we will go over In-Memory Tables and learn how to monitor and troubleshoot blocking processes.
Speaker: Hilary Cotter is a 20 year IT veteran who has answered over 20,000 questions on the forums. Some of them correctly. He specializes in HA technologies, especially replication, performance tuning, full-text search, and SQL Server Service Broker. Hilary is also an author, or contributor on a number of books on SQL Server.
This document provides an overview of Store and Glorp. Store is a version control system for Cincom Smalltalk that uses a relational database as a repository. It versions bundles, packages, classes, methods, and other entities. Glorp is an object-relational mapping framework that Store now uses instead of hand-coded SQL. This provides benefits like easier querying and administration. The document discusses how Store objects work with Glorp sessions and queries. It also covers opportunities, issues from migrating to Glorp like speed improvements, and planned enhancements for Store in version 7.9.
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
This document provides an overview of locking, blocking, and transaction isolation levels in SQL Server. It begins with an introduction to locking and how SQL Server uses locks for concurrency control. It then discusses the different lock types, lock compatibility, and the lock hierarchy. The document demonstrates how to view locking information and troubleshoot locking problems. It also covers lock escalation, deadlocks, and resolving blocking issues. Finally, it concludes with an explanation of the various transaction isolation levels supported by SQL Server and how they differ in terms of concurrency and consistency.
The document discusses synchronization and consistency issues in distributed file systems. It covers several consistency models including UNIX semantics, session semantics, and immutable files. It also discusses transaction semantics and file locking techniques. The document then focuses on consistency and replication, covering client-side caching, server-side replication, and replication in peer-to-peer systems. It provides examples of caching techniques used in NFS including caching with server control and open delegation. It also discusses the use of leases to maintain consistency across cached copies.
This document discusses various approaches for implementing message queueing in web applications. It describes using a message queue to decouple producers and consumers, improving load handling and allowing more pages to be served quicker. Common solutions discussed include using Gearman, STOMP, and AMQP. Gearman is recommended for simple job queueing, while STOMP provides a simple tried and tested jobs solution. AMQP offers more flexibility but has fewer proven Perl implementations.
Actors provide a solution to issues with traditional concurrent programming like deadlocks and livelocks by treating all work as message passing between isolated entities called actors. Actors communicate asynchronously by message passing and avoid shared state, which simplifies concurrency. Akka is a toolkit for building applications and systems using the actor model that provides features like routing, supervision, and remote deployment of actors across networks.
Automate Server Mastery by Stack Advisors - Automation Nation 2018Scott Wilson
This document provides guidance on keeping an Automate server running optimally. It discusses server configuration best practices, avoiding conflicts with other software, monitoring database growth, performing regular maintenance like trimming data, and troubleshooting issues. The document outlines steps to isolate problems, review logs, check for known issues, attempt fixes, and contact support if needed.
Update locks in SQL Server are used to prevent deadlocks that could occur when multiple transactions try to concurrently update the same resource. Without update locks, transactions would first acquire shared locks before updating data. However, this could lead to deadlocks if two transactions simultaneously tried to convert their shared locks to exclusive locks in order to perform an update. To avoid this, SQL Server uses update locks, which are incompatible with other locks and ensure that only one transaction can update a resource at a time by first acquiring an update lock before converting it to an exclusive lock.
Semelhante a Locks, Blocks, and Snapshots: Maximizing Database Concurrency (PASSDC User Group) (20)
STATATHON: Unleashing the Power of Statistics in a 48-Hour Knowledge Extravag...sameer shah
"Join us for STATATHON, a dynamic 2-day event dedicated to exploring statistical knowledge and its real-world applications. From theory to practice, participants engage in intensive learning sessions, workshops, and challenges, fostering a deeper understanding of statistical methodologies and their significance in various fields."
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeWalaa Eldin Moustafa
Dynamic policy enforcement is becoming an increasingly important topic in today’s world where data privacy and compliance is a top priority for companies, individuals, and regulators alike. In these slides, we discuss how LinkedIn implements a powerful dynamic policy enforcement engine, called ViewShift, and integrates it within its data lake. We show the query engine architecture and how catalog implementations can automatically route table resolutions to compliance-enforcing SQL views. Such views have a set of very interesting properties: (1) They are auto-generated from declarative data annotations. (2) They respect user-level consent and preferences (3) They are context-aware, encoding a different set of transformations for different use cases (4) They are portable; while the SQL logic is only implemented in one SQL dialect, it is accessible in all engines.
#SQL #Views #Privacy #Compliance #DataLake
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataKiwi Creative
Harness the power of AI-backed reports, benchmarking and data analysis to predict trends and detect anomalies in your marketing efforts.
Peter Caputa, CEO at Databox, reveals how you can discover the strategies and tools to increase your growth rate (and margins!).
From metrics to track to data habits to pick up, enhance your reporting for powerful insights to improve your B2B tech company's marketing.
- - -
This is the webinar recording from the June 2024 HubSpot User Group (HUG) for B2B Technology USA.
Watch the video recording at https://youtu.be/5vjwGfPN9lw
Sign up for future HUG events at https://events.hubspot.com/b2b-technology-usa/
End-to-end pipeline agility - Berlin Buzzwords 2024Lars Albertsson
We describe how we achieve high change agility in data engineering by eliminating the fear of breaking downstream data pipelines through end-to-end pipeline testing, and by using schema metaprogramming to safely eliminate boilerplate involved in changes that affect whole pipelines.
A quick poll on agility in changing pipelines from end to end indicated a huge span in capabilities. For the question "How long time does it take for all downstream pipelines to be adapted to an upstream change," the median response was 6 months, but some respondents could do it in less than a day. When quantitative data engineering differences between the best and worst are measured, the span is often 100x-1000x, sometimes even more.
A long time ago, we suffered at Spotify from fear of changing pipelines due to not knowing what the impact might be downstream. We made plans for a technical solution to test pipelines end-to-end to mitigate that fear, but the effort failed for cultural reasons. We eventually solved this challenge, but in a different context. In this presentation we will describe how we test full pipelines effectively by manipulating workflow orchestration, which enables us to make changes in pipelines without fear of breaking downstream.
Making schema changes that affect many jobs also involves a lot of toil and boilerplate. Using schema-on-read mitigates some of it, but has drawbacks since it makes it more difficult to detect errors early. We will describe how we have rejected this tradeoff by applying schema metaprogramming, eliminating boilerplate but keeping the protection of static typing, thereby further improving agility to quickly modify data pipelines without fear.
Build applications with generative AI on Google CloudMárton Kodok
We will explore Vertex AI - Model Garden powered experiences, we are going to learn more about the integration of these generative AI APIs. We are going to see in action what the Gemini family of generative models are for developers to build and deploy AI-driven applications. Vertex AI includes a suite of foundation models, these are referred to as the PaLM and Gemini family of generative ai models, and they come in different versions. We are going to cover how to use via API to: - execute prompts in text and chat - cover multimodal use cases with image prompts. - finetune and distill to improve knowledge domains - run function calls with foundation models to optimize them for specific tasks. At the end of the session, developers will understand how to innovate with generative AI and develop apps using the generative ai industry trends.
4. • The ability for an operation to be broken up into multiple parts that can be
worked on independently
• The ability for multiple operations to access or modify a shared resource at
the same time
• More parts/users == more concurrency!
• Until a limiting factor appears…
5. • 5 Philosophers, bowls of spaghetti, and forks
• To eat, 2 forks are required
• Can pick up one fork at a time
• Once finished, both forks must
be returned to the table
• When not eating, a philosopher is thinking
https://en.wikipedia.org/wiki/File:An_illustration_of_the_dining_philosophers_problem.png
6. What if everyone picks up one fork?
https://en.wikipedia.org/wiki/File:An_illustration_of_the_dining_philosophers_problem.png
What if there’s a time limit?
What if someone never gets to eat?
8. • Preventable Read Phenomena (ANSI-defined*)
Dirty Reads
Non-Repeatable Reads
Phantom Reads
• Lost Updates
• Deadlocks
*ANSI specifies which behaviors to allow at each level, but not how to implement them
New Hampshire Dept. of Transportation
9. • Reading data that is not yet committed
• Changes are still “in flight” in another process
• You can read data multiple times or not at all
• “But it’s faster!”
10. • A.K.A. “Inconsistent Analysis”
• Multiple queries in the same transaction get differing results
• Cause: A different transaction commits changes between reads
11. • Only affects queries with a predicate (WHERE clause)
• Membership in the result set changes
• Multiple queries using the same predicate in the same transaction return
differing results https://flic.kr/p/4xqWnG
12. • “Update Conflict”
• One user’s update overwrites another user’s (simultaneous) update
• Appears as though the first update never happened
*SQL Server will not permit lost updates in any isolation level
13. • Two or more tasks block each other
• Each has a lock on a resource that the other task needs a lock on
• SQL Server detects and resolves these by choosing a victim
• Victim is rolled back, releasing all its locks
Process
A
Process
B
Resource 1 Resource 2
14. • Pessimistic Concurrency
Conflicts are expected; locks taken to prevent them
Readers block writers, writers block readers
Only option available pre-2005
• Optimistic Concurrency
Conflicts are considered possible, but unlikely
Row versioning means less locking
18. • Can be set at the connection or query level
• Cannot be changed server-wide
• Default isolation level is READ COMMITTED
• To change at connection level:
• Change applies to all queries for the current connection
SET TRANSACTION ISOLATION LEVEL {READ UNCOMMITTED
| READ COMMITTED | REPEATABLE READ | SNAPSHOT
| SERIALIZABLE } [;]
19. • To change at the query level, use table hints
• This is on a per-table basis
SELECT column
FROM table WITH (NOLOCK);
25. • A.K.A “NOLOCK”
• May read rows multiple times
• May read rows zero times
• May return results that were NEVER true!
• Only applies to SELECT queries
Ignored if used for data modification queries
Could cause index corruption if you tried it (since fixed)
Dirty Nonrepeatable Phantom
Yes Yes Yes
27. • “No locks are taken”
WRONG!
No shared locks are taken when reading data
Other locks are still taken as normal
• “It makes this query faster”
WRONG(ish)!
Only true if query had a lot of blocking on SELECT statements
28.
29. • Not a terrible setting, it exists for a reason
• BUT make sure you understand the risks and consequences
30. • The Default Default Isolation level
• Guarantee: Data that is read is guaranteed to be committed.
No Dirty Reads
No other guarantees
Dirty Nonrepeatable Phantom
No Yes Yes
31. • Ensure only committed data is read by locking
• (Locks only last as long as the read, released immediately after)
Rows already read.
Unlocked.
Row currently being
read. Locked.
Rows not yet read.
Unlocked.
SCAN
34. • Unlocked rows can move at any time
Rows already read.
Unlocked.
Row currently being
read. Locked.
Rows not yet read.
Unlocked.
SCAN
35. • Unlocked rows can move at any time
Rows already read.
Unlocked.
Row currently being
read. Locked.
Rows not yet read.
Unlocked.
SCAN
36.
37. • Builds on READ COMMITTED
• If a query is repeated within the same transaction, records read the first
time will not change
• Once a row is read, locks are held for length of the transaction
Even rows that don’t qualify as results
• These locks will not stop additional rows from being added or included in
subsequent queries
Dirty Nonrepeatable Phantom
No No Yes
38.
39. • Once read, rows are locked for duration of transaction
Rows already read.
Locked.
Row currently being
read. Locked.
Rows not yet read.
Unlocked.
SCAN
40. • On a second scan, new rows may enter
Rows already read.
Locked.
Row currently being
read. Locked.
Rows not yet read.
Unlocked.
SCAN
41.
42. • Builds on REPEATABLE READ
• If a query is repeated within the same transaction, results will be the same
• No data seen previously will change; no new results will appear
• We now need to lock data that doesn’t exist!
Dirty Nonrepeatable Phantom
No No No
43. • Key-range locks
• Prevent phantom reads by defining a range that other transactions cannot
insert rows within
• If you select a row/range that doesn’t exist, that gets locked too
44. • Range Locks cover the entire range AND the first row outside it
Rows already read.
Locked.
Row currently being
read. Locked.
Rows not yet read.
Locked.
RANGE BEING SELECTED
First key outside
range. Locked.
45.
46. • Uses row versioning to prevent concurrency conflicts
• Fewer locks are needed, so blocking is reduced
Readers no longer block writers
Writers no longer block readers
Writers still block writers
• Uses a version store to do this
• Version Store lives in tempdb
• Remember, it’s OPTIMISTIC!
47. • Whenever a row is updated, previous version is stored in the version store
• New version of row has a pointer to the previous version
• Versions are stored for as long as operations exist that might need them
All versions of rows modified by a transaction must be kept for as long as that
transaction is open
53. • Same guarantees as READ COMMITTED, just an optimistic implementation
• Statement-level snapshot isolation
Queries will see the most recent committed values as of the beginning of that
statement (not the transaction)
Dirty Nonrepeatable Phantom
No Yes Yes
57. • When enabled, RCSI becomes the default isolation level for this database.
• Command will block if DB has other connections
NO_WAIT will prevent blocking and just fail instead
ROLLBACK_IMMEDIATE will rollback other transactions
Dirty Nonrepeatable Phantom
No Yes Yes
ALTER DATABASE <DB_NAME>
SET READ_COMMITTED_SNAPSHOT ON
[WITH (NO_WAIT | ROLLBACK IMMEDIATE)];
58.
59. • Same guarantees as SERIALIZABLE, just an optimistic implementation
• Transaction-level snapshot isolation
Queries will see the most recent committed values as of the beginning of that
transaction (the first data read in it)
Dirty Nonrepeatable Phantom
No No No
60. • First statement merely allows snapshot isolation
Dirty Nonrepeatable Phantom
No No No
ALTER DATABASE <DB_NAME>
SET ALLOW_SNAPSHOT_ISOLATION ON;
SET TRANSACTION ISOLATION LEVEL SNAPSHOT;
61. • Process 1 reads data in a transaction, does not commit
• Process 2 reads/updates same data,
• Process 1’s snapshot does not see Process 2’s update
• Process 1 tries to update, gets blocked
• As soon as Process 2 commits, Process 1 errors out
• This will raise error 3960 on process 1
https://flic.kr/p/4WHW81
62.
63. • Everything I’ve covered here behaves the same in Azure SQL Database
• Exception: RCSI is enabled by default
65. • This could be its own presentation by itself
• Optimistic multi-version concurrency control
No locks required at any time
(Not even for data modification)
No waiting because of blocking!
No latches or spinlocks either
• Waits can still occur….
(Waiting for log writes to disk following a transaction)
66. • No existing row is ever modified
UPDATE creates a new version of a row
There may be multiple versions in play at once
• Transactions needing to read are presented with the correct version
67. 10 <inf> 1 Red
Begin
Time
End
Time Data Columns
10 <inf> 3 Green
Now at time 20, let’s:
Delete (1, Red)
Update (3, Green) to (3, Blue)
Insert (6, Pink)
10 20 1 Red
10 20 3 Green
20 <inf> 3 Blue
20 <inf> 6 Pink
Begin
Time
End
Time Data Columns
68. • Craig Freedman’s posts on SQL Server Isolation Levels
https://blogs.msdn.microsoft.com/craigfr/tag/isolation-levels/
• SQL Server Concurrency: Locking, Blocking, and Row Versioning
(Kalen Delaney, Simple Talk Publishing)
• Myths and Misconceptions about Transaction Isolation Levels
http://www.sqlpassion.at/archive/2014/01/21/myths-and-misconceptions-about-transaction-isolation-levels/