|
Building Scalable Web Sites
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.
Building Scalable Web Sites looks at a variety of techniques for creating sites which 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 websites can handle countless requests. You'll learn how to take 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.
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 website, 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.
Preface
1. Introduction
What Is a Web Application?
How Do You Build Web Applications?
What Is Architecture?
How Do I Get Started?
2. Web Application Architecture
Layered Software Architecture
Layered Technologies
Software Interface Design
Getting from A to B
The Software/Hardware Divide
Hardware Platforms
Hardware Platform Growth
Hardware Redundancy
Networking
Languages, Technologies, and Databases
3. Development Environments
The Three Rules
Use Source Control
One-Step Build
Issue Tracking
Scaling the Development Model
Coding Standards
Testing
4. i18n, L10n, and Unicode
Internationalization and Localization
Unicode in a Nutshell
The UTF-8 Encoding
UTF-8 Web Applications
Using UTF-8 with PHP
Using UTF-8 with Other Languages
Using UTF-8 with MySQL
Using UTF-8 with Email
Using UTF-8 with JavaScript
Using UTF-8 with APIs
5. Data Integrity and Security
Data Integrity Policies
Good, Valid, and Invalid
Filtering UTF-8
Filtering Control Characters
Filtering HTML
Cross-Site Scripting (XSS)
SQL Injection Attacks
6. Email
Receiving Email
Injecting Email into Your Application
The MIME Format
Parsing Simple MIME Emails
Parsing UU Encoded Attachments
TNEF Attachments
Wireless Carriers Hate You
Character Sets and Encodings
Recognizing Your Users
Unit Testing
7. Remote Services
Remote Services Club
Sockets
Using HTTP
Remote Services Redundancy
Asynchronous Systems
Exchanging XML
Lightweight Protocols
8. Bottlenecks
Identifying Bottlenecks
CPU Usage
I/O
Memory and Swap
External Services and Black Boxes
Databases
9. Scaling Web Applications
The Scaling Myth
Scaling the Network
Scaling PHP
Load Balancing
Scaling MySQL
MySQL Replication
Database Partitioning
Scaling Large Database
Scaling Storage
Caching
Scaling in a Nutshell
10. Statistics, Monitoring, and Alerting
Tracking Web Statistics
Application Monitoring
Alerting
11. APIs
Data Feeds
Mobile Content
Web Services
API Transports
API Abuse
Authentication
The Future
Index
|