Synopses & Reviews
Slow websites infuriate users. Lots of people can visit your web site or use your web application - but you have to be prepared for those visitors, or they won't come back. Your sites need to be built to withstand the problems success creates.
Building Scalable Web Sites looks at a variety of techniques for creating sites that can keep users cheerful, even when there are thousands or millions of them. Flickr.com developer, Cal Henderson, explains how to build sites so that large numbers of visitors can enjoy them. Henderson examines techniques that go beyond sheer speed, exploring how to coordinate developers, support international users, and integrate with other services from email to SOAP to RSS to the APIs exposed by many Ajax-based web applications.
This book uncovers the secrets that you need to know for back-end scaling, architecture, and failover so your web sites can handle countless requests. You'll learn how to take the poor man's web technologies, like Linux, Apache, MySQL, PHP, or other scripting languages, and scale them to compete with established store bought enterprise web technologies. Toward the end of the book, you'll discover techniques for keeping web applications running with event monitoring and long-term statistical tracking for capacity planning.
If you're about to build your first dynamic web site, then Building Scalable Web Sites isn't for you. But if you're an advanced developer who's ready to realize the cost and performance benefits of a comprehensive approach to scalable applications, then let your fingers do the walking through this convenient guide.
Synopsis
With this resource, readers will learn how to take what some call the "poor man's web technologies"--Linux, Apache, MySQL, and PHP or other scripting languages--and scale them to compete with established "store bought" enterprise web technologies.
Synopsis
Learn the tricks of the trade so you can build and architect applications that scale quickly--without all the high-priced headaches and service-level agreements associated with enterprise app servers and proprietary programming and database products. Culled from the experience of the Flickr.com lead developer, Building Scalable Web Sites offers techniques for creating fast sites that your visitors will find a pleasure to use.
Creating popular sites requires much more than fast hardware with lots of memory and hard drive space. It requires thinking about how to grow over time, how to make the same resources accessible to audiences with different expectations, and how to have a team of developers work on a site without creating new problems for visitors and for each other.
Presenting information to visitors from all over the world
Integrating email with your web applications
Planning hardware purchases and hosting options to have as much as you need without breaking your wallet
Partitioning and distributing databases to support large datasets and simultaneous transactions
Monitoring your applications to find and clear bottlenecks
* Providing services APIs and using services from other providers to increase your site's reach and capabilities
Whether you're starting a small web site with hopes of growing big or you already have a large system that needs maintenance, you'll find Building Scalable Web Sites to be a library of ideas for making things work.
About the Author
Cal Henderson has been a web applications developer for far too long and should really start looking for a serious job. Originally from England, he currently works at Yahoo! Inc in San Francisco, California as the Director of Engineering for the photo-sharing service Flickr. Before Flickr, he was the technical director of Special Web Projects at emap, a UK media company. By night he works for a whole slew of web sites and communities, including the creative community B3TA and his personal site, iamcal. In his spare time, he writes windows software, develops web publishing tools, and writes occasional articles about web application development and security.
Table of Contents
Preface; ; What This Book Is About; What You Need to Know; Conventions Used in This Book; Using Code Examples; Safari® Enabled; How to Contact Us; Acknowledgments; Chapter 1: Introduction; 1.1 What Is a Web Application?; 1.2 How Do You Build Web Applications?; 1.3 What Is Architecture?; 1.4 How Do I Get Started?; Chapter 2: Web Application Architecture; 2.1 Layered Software Architecture; 2.2 Layered Technologies; 2.3 Software Interface Design; 2.4 Getting from A to B; 2.5 The Software/Hardware Divide; 2.6 Hardware Platforms; 2.7 Hardware Platform Growth; 2.8 Hardware Redundancy; 2.9 Networking; 2.10 Languages, Technologies, and Databases; Chapter 3: Development Environments; 3.1 The Three Rules; 3.2 Use Source Control; 3.3 One-Step Build; 3.4 Issue Tracking; 3.5 Scaling the Development Model; 3.6 Coding Standards; 3.7 Testing; Chapter 4: i18n, L10n, and Unicode; 4.1 Internationalization and Localization; 4.2 Unicode in a Nutshell; 4.3 Unicode Encodings; 4.4 The UTF-8 Encoding; 4.5 UTF-8 Web Applications; 4.6 Using UTF-8 with PHP; 4.7 Using UTF-8 with Other Languages; 4.8 Using UTF-8 with MySQL; 4.9 Using UTF-8 with Email; 4.10 Using UTF-8 with JavaScript; 4.11 Using UTF-8 with APIs; Chapter 5: Data Integrity and Security; 5.1 Data Integrity Policies; 5.2 Good, Valid, and Invalid; 5.3 Filtering UTF-8; 5.4 Filtering Control Characters; 5.5 Filtering HTML; 5.6 Cross-Site Scripting (XSS); 5.7 SQL Injection Attacks; Chapter 6: Email; 6.1 Receiving Email; 6.2 Injecting Email into Your Application; 6.3 The MIME Format; 6.4 Parsing Simple MIME Emails; 6.5 Parsing UU Encoded Attachments; 6.6 TNEF Attachments; 6.7 Wireless Carriers Hate You; 6.8 Character Sets and Encodings; 6.9 Recognizing Your Users; 6.10 Unit Testing; Chapter 7: Remote Services; 7.1 Remote Services Club; 7.2 Sockets; 7.3 Using HTTP; 7.4 Remote Services Redundancy; 7.5 Asynchronous Systems; 7.6 Exchanging XML; 7.7 Lightweight Protocols; Chapter 8: Bottlenecks; 8.1 Identifying Bottlenecks; 8.2 External Services and Black Boxes; Chapter 9: Scaling Web Applications; 9.1 The Scaling Myth; 9.2 Scaling the Network; 9.3 Load Balancing; 9.4 Scaling MySQL; 9.5 MyISAM; 9.6 MySQL Replication; 9.7 Database Partitioning; 9.8 Scaling Large Database; 9.9 Scaling Storage; Chapter 10: Statistics, Monitoring, and Alerting; 10.1 Tracking Web Statistics; 10.2 Application Monitoring; 10.3 Alerting; Chapter 11: APIs; 11.1 Data Feeds; 11.2 Mobile Content; 11.3 Web Services; 11.4 API Transports; 11.5 API Abuse; 11.6 Authentication; 11.7 The Future; Colophon;