Moving Web Apps From Synchronous to Asynchronous Processing Jason Carreira Architect, ePlus Systems OpenSymphony member.

Slides:



Advertisements
Similar presentations
MQ Series Cross Platform Dominant Messaging sw – 70% of market Messaging API same on all platforms Guaranteed one-time delivery Two-Phase Commit Wide EAI.
Advertisements

1 Symbian Client Server Architecture. 2 Client, who (a software module) needs service from service provider (another software module) Server, who provide.
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Resource Containers: A new Facility for Resource Management in Server Systems G. Banga, P. Druschel,
Smartphone Apps Development Team Weiqing Li Lijun Zhu Man Li.
Web Applications Development Using Coldbox Platform Eddie Johnston.
28.2 Functionality Application Software Provides Applications supply the high-level services that user access, and determine how users perceive the capabilities.
Threads vs. Processes April 7, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Lecture 8 Epidemic communication, Server implementation.
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
DEV-14: Understanding and Programming for the AppServer™
Chapter 26 Client Server Interaction Communication across a computer network requires a pair of application programs to cooperate. One application on one.
The Client/Server Database Environment
Scalability By Alex Huang. Current Status 10k resources managed per management server node Scales out horizontally (must disable stats collector) Real.
DIANE Overview Germán Carrera, Alfredo Solano (CNB/CSIC) EMBRACE COURSE Monday 19th of February to Friday 23th. CNB-CSIC Madrid.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
Configuration Management and Server Administration Mohan Bang Endeca Server.
Exploring Real-time apps with ColdFusion and Blaze DS / Live Cycle Data Services ES Dan Blackman
Putting What We Learned Into Context – WSGI and Web Frameworks A290/A590, Fall /16/2014.
Integration Broker PeopleTools Integration Broker Steps –Introduction & terminologies –Application Server PUB/SUB services (Application Server)
How did the internet develop?. What is Internet? The internet is a network of computers linking many different types of computers all over the world.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Standalone Java Application vs. Java Web Application
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Tunis International Centre for Environmental Technologies Small Seminar on Networking Technology Information Centers UNFCCC secretariat offices Bonn, Germany.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Orbited Scaling Bi-directional web applications A presentation by Michael Carter
Open Search Office Web Services Database Doc Mgt Sys Pipeline Index Geospatial Analysis Text Search Faceting Caching Query parsing Clustering Synonyms.
Google Docs and Wikis February 1, Google Tools Google began as a simple search engine in Around 2001, Google began developing new areas of.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Client Web Service HTTP Tunnel 1 2 Synchronous Message BLK.
Developing TCP/IP-based Server Applications using Indy Components  Christian Wilkerson.
Distributed Information Systems. Motivation ● To understand the problems that Web services try to solve it is helpful to understand how distributed information.
Struts 2 introduction. Struts 2 framework Struts 2 A full-featured web application framework for the Java EE platform The Java Servlet API exposes the.
HTML5 AND THE FUTURE JAVASCRIPT PLATFORM Marcelo Lopez Ruiz Senior Software Design Engineer Microsoft Corporation.
Esri UC 2014 | Technical Workshop | Creating Geoprocessing Services Kevin Hibma.
Getting started with ASP.NET MVC Dhananjay
Don’t Disconnect Me! The challenges of building offline-enabled web apps Matthias Oßwald,
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Threads. Readings r Silberschatz et al : Chapter 4.
Designing a Middleware Server for Abstract Database Connection.
Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner.
JetB2. 2 About the Project New perspective development Project starts – October 2010 B2 is now on Web.
(re)-Architecting cloud applications on the windows Azure platform CLAEYS Kurt Technology Solution Professional Microsoft EMEA.
Ajax! Ajax Programming Ajax! Ajax Programming. Ajax! Ajax Programming Take a look at a typical desktop application (Spreadsheet app, etc.) The program.
R Some of these slides are from Prof Frank Lin SJSU. r Minor modifications are made. 1.
START Application Spencer Johnson Jonathan Barella Cohner Marker.
 Project Team: Suzana Vaserman David Fleish Moran Zafir Tzvika Stein  Academic adviser: Dr. Mayer Goldberg  Technical adviser: Mr. Guy Wiener.
Ajax 101 for CF Programmers Randy Brown – Michigan State University
6. Application Server Issues for the Project
Processes and threads.
Remote execution of long-running CGIs
Principles of Network Applications
The Client/Server Database Environment
Processes The most important processes used in Web-based systems and their internal organization.
#01 Client/Server Computing
Creating Geoprocessing Services
SharePoint Cloud hosted Apps
Node.Js Server Side Javascript
MVC in ASP.NET Core: The new kid on the block
Threaded Programming in Python
HCI Project.
Threads vs. Processes Hank Levy 1.
J2EE Lecture 13: JMS and WebSocket
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
CS703 – Advanced Operating Systems
Running C# in the browser
Exceptions and networking
#01 Client/Server Computing
Message Passing Systems
Presentation transcript:

Moving Web Apps From Synchronous to Asynchronous Processing Jason Carreira Architect, ePlus Systems OpenSymphony member

Normal web processing Users make requests and wait for the response Each user’s browser holds an open connection, waiting for the server to send back the page or file

What if requests come too fast?

What if requests come too fast? (continued) Requests back up Each request requires some resources on the server side Users are left waiting with no feedback Requests start to take LONGER, making the problem escalate

What causes the problem? Too many users / too many requests Popularity can be a curse

What causes the problem? (continued) Processing requests takes too long Too much work Some things just take a long time

What causes the problem? (continued) Integrating with backend systems Remote roundtrips take a long time

So what do we do? Some ideas… Faster Hardware Clustering Worker Threads Messaging Middleware (JMS)

Hardware and Clustering Works well for scaling up number of users Long running processing and system integrations still take a long time

Worker Threads and JMS: Asynchronous Processing Separates processing web request and doing the work Users get a response quickly, get full response when work is done

What can asynchronous processing solve? Too many users / too many requests Long running processing Time consuming calls to backend systems

What can asynchronous processing solve? Too many users / too many requests Long running processing Time consuming calls to backend systems

Giving the user feedback The user gets a response showing a “working” page The page refreshes periodically to check if the work is done When the work is done, the server redirects the user to see the final result

An example: Searching for flights

So how do we build it?

Normal Web MVC Processing The controller routes the request to the correct Action The Action executes (calling services, DAOs, etc) and specifies which view to render The view is rendered and returned to the user

Normal Web MVC: Each user request is handled synchronously

Executing in a Worker Thread

Executing in a Worker Thread (continued) The first request creates a thread to execute the Action A working page is shown to the user which refreshes to check if the Action is done When the Action is done, the final view is rendered

The ExecuteAndWait Interceptor Catches the request processing before it gets to the Action Creates a Thread and gives it the Action to execute Sends the user to the working page

Let’s Look at Some Code (Finally)! Based on XWork / WebWork Show the same Action executed synchronously and asynchronously Look at the framework code that makes it work

Executing from a Message Queue The controller is a JMS MessageListener (can be an MDB) The Result can send a message on a response queue, send messages on the same work queue, etc.

Bridging the Synchronous / Asynchronous Gap The SendMessageAction creates a MapMessage with the request and configuration parameters Can be configured to execute any Action

Looking at a Message Driven Example Uses MessageWork, based on XWork Shows the same Action configured to be executed from a JMS Queue

Some Implementation Challenges with MessageWork JMS vs. 1.1 compatibility Implementing Session / Application contexts and propagation Integration and System testing

Further Ideas Federated web applications Online and Batch mode web applications

Questions?

For More Information The WebWork and XWork projects from OpenSymphony ( The Xwork-Optional project (home of MessageWork) at optional.dev.java.net/ optional.dev.java.net/ Check out “WebWork in Action” from Manning