Issues in the Development of Transactional Web Applications R. D. Johnson D. Reimer IBM Systems Journal Vol 43, No 2, 2004 Presenter: Barbara Ryder

Similar documents
DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

Concurrency Control & Recovery

T ransaction Management 4/23/2018 1

CS322: Database Systems Transactions

Database Management Systems 2010/11

Chapter 15: Transactions

Memory management, part 2: outline. Operating Systems, 2017, Danny Hendler and Amnon Meisels

Memory management, part 2: outline

Transactions. Lecture 8. Transactions. ACID Properties. Transaction Concept. Example of Fund Transfer. Example of Fund Transfer (Cont.

DATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25

Evictor. Prashant Jain Siemens AG, Corporate Technology Munich, Germany

What are Transactions? Transaction Management: Introduction (Chap. 16) Major Example: the web app. Concurrent Execution. Web app in execution (CS636)

Topics. File Buffer Cache for Performance. What to Cache? COS 318: Operating Systems. File Performance and Reliability

Overview. Introduction to Transaction Management ACID. Transactions

J2EE: Best Practices for Application Development and Achieving High-Volume Throughput. Michael S Pallos, MBA Session: 3567, 4:30 pm August 11, 2003

Transaction Management: Introduction (Chap. 16)

Real-Time Garbage Collection Panel JTRES 2007

Understanding Performance in Large-scale Framework-based Systems

Transaction Management: Concurrency Control, part 2

Locking for B+ Trees. Transaction Management: Concurrency Control, part 2. Locking for B+ Trees (contd.) Locking vs. Latching

Chapter 13: Transactions

Birth of Optimistic Methods. On Optimistic Methods for Concurrency Control. Basic performance arg

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

Transactions. Prepared By: Neeraj Mangla

Database Systems. Announcement

Advanced Databases (SE487) Prince Sultan University College of Computer and Information Sciences. Dr. Anis Koubaa. Spring 2014

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

Operating System Concepts

The team that wrote this redbook

Chapter 14: Transactions

Page 1. CS194-3/CS16x Introduction to Systems. Lecture 8. Database concurrency control, Serializability, conflict serializability, 2PL and strict 2PL

About BigMemory Go. Innovation Release. Version 4.3.5

Concurrency Control & Recovery

FAULT TOLERANT SYSTEMS

CISQ Weakness Descriptions

Roadmap of This Lecture

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Database Management Systems

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Data Management in Application Servers. Dean Jacobs BEA Systems

Chapter 15: Transactions

transaction - (another def) - the execution of a program that accesses or changes the contents of the database

How to get realistic C-states latency and residency? Vincent Guittot

1 Performance Optimization in Java/J2EE

CS 347 Parallel and Distributed Data Processing

Chapter 9: Transactions

Transaction Management Overview

IBM WebSphere Application Server 8. Clustering Flexible Management

CSC 261/461 Database Systems Lecture 20. Spring 2017 MW 3:25 pm 4:40 pm January 18 May 3 Dewey 1101

Chapter 8: Virtual Memory. Operating System Concepts

UNIT:2. Process Management

Recall from deadlock lecture. Tuesday, October 18, 2011

Concurrency Control Algorithms

Transactions These slides are a modified version of the slides of the book Database System Concepts (Chapter 15), 5th Ed

Module 6: Deadlocks. Reading: Chapter 7

) Intel)(TX)memory):) Transac'onal) Synchroniza'on) Extensions)(TSX))) Transac'ons)

CS 153 Design of Operating Systems Winter 2016

Chapter 25: Advanced Transaction Processing

Improving Data Access of J2EE Applications by Exploiting Asynchronous Messaging and Caching Services

Overview of Transaction Management

ICOM 5016 Database Systems. Chapter 15: Transactions. Transaction Concept. Chapter 15: Transactions. Transactions

5. Distributed Transactions. Distributed Systems Prof. Dr. Alexander Schill

Database System Concepts

Hazard Pointers. Number of threads unbounded time to check hazard pointers also unbounded! difficult dynamic bookkeeping! thread B - hp1 - hp2

Guide to Mitigating Risk in Industrial Automation with Database

CSIT5300: Advanced Database Systems

Transactions. Kathleen Durant PhD Northeastern University CS3200 Lesson 9

Using Automated Network Management at Fiserv. June 2012

Advanced HTTP session management with Oracle Coherence

WebSphere Portal Application Development Best Practices using Rational Application Developer IBM Corporation

Intro to Transactions

Lecture: Transactional Memory, Networks. Topics: TM implementations, on-chip networks

Transaction Concept. Two main issues to deal with:

TSW Reliability and Fault Tolerance

Intel Thread Building Blocks, Part IV

CS399 New Beginnings. Jonathan Walpole

Database System Concepts

Verteilte Systeme (Distributed Systems)

Kodewerk. Java Performance Services. The War on Latency. Reducing Dead Time Kirk Pepperdine Principle Kodewerk Ltd.

CS 347: Distributed Databases and Transaction Processing Notes07: Reliable Distributed Database Management

Transaction Management Overview. Transactions. Concurrency in a DBMS. Chapter 16

CSE 306/506 Operating Systems Deadlock. YoungMin Kwon

Plan. Department of Informatics. Advanced Software Engineering Prof. J. Pasquier-Rocha Cours de Master en Informatique - SH 2003/04

TRANSACTION MANAGEMENT

IBM. Enterprise Application Development with IBM Web Sphere Studio, V5.0

BİL 354 Veritabanı Sistemleri. Transaction (Hareket)

Capacity Planning for Application Design

Lectures 8 & 9. Lectures 7 & 8: Transactions

Intro to DB CHAPTER 15 TRANSACTION MNGMNT

OPERATING SYSTEM TRANSACTIONS

CHAPTER 3 RECOVERY & CONCURRENCY ADVANCED DATABASE SYSTEMS. Assist. Prof. Dr. Volkan TUNALI

Transaction Management & Concurrency Control. CS 377: Database Systems

How Scalable is your SMB?

IBM Advanced Rational Application Developer v7. Download Full Version :

Fall 2015 COMP Operating Systems. Lab 06

Databases - Transactions

Caching Memcached vs. Redis

Idle WebSphere Tuning Considerations

Appendix A - Glossary(of OO software term s)

CHAPTER: TRANSACTIONS

Transcription:

Issues in the Development of Transactional Web Applications R. D. Johnson D. Reimer IBM Systems Journal Vol 43, No 2, 2004 Presenter: Barbara Ryder 3/21/05 CS674 BGR 1

Web Applications Transactional processing at their core Resource management & utilization Concurrency & parallelism Failure management Persistent data Configuration management Non-transactional issues Memory leaks, Data thru-put, Dealing with overly general frameworks/components 3/21/05 CS674 BGR 2

Topology of Web Apps Web server between application servers and Internet Static content handled by web server Dynamic content handled by requests to application server (e.g, servlets, JSPs, EJBs, backend data) Choices Vertical scaling: several app servers on one node Horizontal scaling: several app server nodes 3/21/05 CS674 BGR 3

Web-based computing (App Server) Presentation Logic Business logic Database(s) (Fig 1, in Websphere paper) 3/21/05 CS674 BGR 4

Transactional Processing Different from client-side software Unit-of-work properties: Executes with only initial user input Output not done until completion Once started, must complete, unless aborted Concurrency model is complete serializability, but this is not always true Server runs forever Uses notion of requests and responses 3/21/05 CS674 BGR 5

Best Practices Rules for Web SW Developers Many client-side or native libraries should not be used Are not re-entrant or are multi-threaded Must adhere to 2-phase resource-acquisition discipline (more to come) Need to know resource budget (e.g., CPU, memory, I/O, locks) per transaction Avoid concurrency Legitimate multi-threading use for requests to multiple back-end systems to overlap latencies Do not retry failures or errors 3/21/05 CS674 BGR 6

Issues Resource management & utilization Concurrency & parallelism Failure management Persistent data Configuration management 3/21/05 CS674 BGR 7

Resource Management Pool shared resources to avoid creation/ deletion during execution E.g., threads, network or DB connections Consider true resource consumption of code Diff from client code where response time emphasized over resource usage Need to know per transaction CPU secs, #DB operations, read/writes wrt DB, scope/duration of locks etc Important to avoid some transactions freezing entire system 3/21/05 CS674 BGR 8

Resource Management Use 2-phase resource management Upon acquiring a resource, do not release it until it is no longer needed by the remainder of the transaction Likewise, make sure all sub-operations can find the resource when needed 3/21/05 CS674 BGR 9

Issues Resource management & utilization Concurrency & parallelism Failure management Persistent data Configuration management 3/21/05 CS674 BGR 10

Concurrency Server code should be re-entrant Server code assumes that any two instructions can be separated by a context switch Programmers should not explicitly manage shared state Programmers should avoid writing code for DB connection pools or thread pools 3/21/05 CS674 BGR 11

Concurrency Issues involving contended objects, locking and hot locks If shared state accessed frequently and locks used and held for long time periods, then there is contention among threads for access to the locked shared state Degrades performance 3/21/05 CS674 BGR 12

Issues Resource management & utilization Concurrency & parallelism Failure management Persistent data Configuration management 3/21/05 CS674 BGR 13

Failure Management Client apps options in face of failure Automatically retry Communicate with user for instructions Exit, crash, cancel or stop Server apps are different Need to determine whether failure is transient or persistent, whether retries may aggravate something else Some operations cannot be retried Programmers should abort their transaction and allow higher-level mechanisms to retry Need to unwind any side effects, unless the transaction is a non-failure 3/21/05 CS674 BGR 14

Failure Management Exception handling Need to record exception info in log files BEFORE attempting remedial action Never catch one exception and raise another, without logging the original exception or wrapping it in the 2nd exception Never use high-level serv ices (e.g., DBs, publish/subscribe or messaging mechanisms) to log or deal with exceptions Otherwise, problem determination when failure occurs can be impossible 3/21/05 CS674 BGR 15

Failure Management Minimize number of components and complexity involved Independent failures in multiple components may lead to complex failures Note this goes against design principles of data abstraction which encourages the separation of concerns in implementation E.g., presentation vs business logic 3/21/05 CS674 BGR 16

Issues Resource management & utilization Concurrency & parallelism Failure management Persistent data Configuration management 3/21/05 CS674 BGR 17

Persistent Data DBs have to contend with persistent and nonpersistent (derived) data Cost of transferring data from persistent storage may be prohibitive Cost of converting data to and from persistent form may be prohibitive Data may be captured as persistent when it does not need to be Confusion may result if an object is persisted and then brought back while a live original version still exists 3/21/05 CS674 BGR 18

Persistent Data High-level frameworks shield programmer from details Container-managed persistence (but may persist more info than necessary) Automatic HTTP persistence may result in saving of arbitrarily large data objects and even illegitimate objects (e.g., DB connection) 3/21/05 CS674 BGR 19

Problems with Hiding Details of Persistence Programmers unaware of sizes of serialized objects (and its resource needs) Programmers use session state as a place to store transient objects, which end up persisted -- bad for performance Objects can be unsafe to persist (e.g., objects with native components) 3/21/05 CS674 BGR 20

Issues Resource management & utilization Concurrency & parallelism Failure management Persistent data Configuration management 3/21/05 CS674 BGR 21

Configuration How to deploy and update a Web app? Depends on configuration data stored at various nodes of distributed system Cached in central DB with local caches per node Live update possible Stored on each node separately May require address space restarts Neither ensures atomic update across system or even atomicity for a node 3/21/05 CS674 BGR 22

Configuration Observations Updates to config parameters at high-load times Updates to program files (e.g., JSP) during highload periods Configuration changes under operator verification All may be causes of instability and lack of reproducibility of consequent errors 3/21/05 CS674 BGR 23

Configuration Updates Best practices Do configuration operations for Web apps during nonload periods (I.e., service window) To minimize time taken, use scripts for configuration operations and deploy NEW modified version (do not modify in real time ) Web app is complex distributed DB Extremely difficult to impossible Ensure that the running app reflect DB config at all times Allow arbitrary series of updates to be reflected aomically in running app configuration Allow arbitrary rollback of changes, automatically reflected in running app configuration 3/21/05 CS674 BGR 24

Configuration Updates Hot-swap app Build new version of app and hot-swap in running code (cannot always do with data) Difficult, requires more HW Scripted upgrades Use automated scripts to apply and undo upgrades, and use backups Both require a service window to minimize effect on users 3/21/05 CS674 BGR 25

Non-transactional Issues Native memory leaks C/C++ apps which do not free memory Fragmentation due to native allocators GC memory leaks For Java, having long-lived object point to memory and never discard E.g. HTTP table w non-expiring session objects Recomputation of temporary values 3/21/05 CS674 BGR 26

Non-transactional Issues Inadequate reuse of complex intermediate values or buffers Reuse of objects within and across transactions (e.g., formatters) Overly general and factorized frameworks Too many layers of interface Many good client-side tools cannot be used with transactional apps due to Performance cost Difficulty start/stopping transactional servers in production environment Issues of distribution 3/21/05 CS674 BGR 27

Personal Observations Can analysis help? Research Issues Framework layers limits abilities of static analysis given loose coupling and dynamic binding used Dynamic analysis of app-only seems insufficient Possible combination of techniques for specific problem areas Possible pre-analysis of frameworks layers? Performance issues How to observe a transaction-based system discreetly? How to separate out effects of different layers? What areas of CS are involved here? O/S, PLs, DBs? Testing approaches How to get realistic moderate-sized systems to test ideas? What aspects of problem would be the best to address? How is all this related to problems in general distributed systems? 3/21/05 CS674 BGR 28