Skip to Main Content
Adding Ajax
book

Adding Ajax

by Shelley Powers
June 2007
Intermediate to advanced content levelIntermediate to advanced
400 pages
9h 52m
English
O'Reilly Media, Inc.
Content preview from Adding Ajax

Performance and Two-Phase Commits

The resources that need the most protection in a web application are Input/Output (I/O)-specific: file writes and database connections. Both typically have a limited number of "threads"—parallel paths of execution—and if you're adding hundreds of new Ajax requests that result in either of these I/O activities, you could be running into blocking problems; Ajax requests waiting for a response from the server, which is blocking on the request because a resource is not available. In particular, a database update frequently results in both types of action—a database connection and a file write. Based on this, you're going to want to evaluate each use of Ajax against the number of concurrent users who might be using the Ajax service at a time, and how many concurrent database connections your system supports.

Ajax That Plays Well with Others

In-page deletion, discussed previously in this chapter, can add to the burden of a web application. Using the traditional approach where each item to be deleted is checked, one database connection is made for all of the deletions, and it is managed as one transaction that establishes a connection, begins the delete transaction, deletes all the items, ends the transaction, then ends the connection.

The Ajax deletion method does require a separate connection for each deletion. The burden of having to open a connection for each Ajax delete request is offset by how simple and fast the request is, and how quickly the database ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ajax: The Definitive Guide

Ajax: The Definitive Guide

Anthony T. Holdener III
Ajax Design Patterns

Ajax Design Patterns

Michael Mahemoff
Web Development with JavaScript and Ajax Illuminated

Web Development with JavaScript and Ajax Illuminated

Richard Allen, Kai Qian, Lixin Tao, Xiang Fu

Publisher Resources

ISBN: 9780596529369Supplemental ContentErrata Page