وبلاگ بلیان

Building Scalable Web Sites : Building, Scaling, and Optimizing the Next Generation of Web Applications

معرفی کتاب «Building Scalable Web Sites : Building, Scaling, and Optimizing the Next Generation of Web Applications» نوشتهٔ Cal Henderson, Cal Henderson، منتشرشده توسط نشر O'Reilly Media در سال 2006. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.

Slow websites infuriate users. Lots of people can visit yourweb site or use your web application - but you have to be prepared forthose visitors, or they won't come back. Your sites need to be built towithstand 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 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. Table of Contents 7 Preface 11 What This Book Is About 13 What You Need to Know 14 Conventions Used in This Book 16 Using Code Examples 17 Safari® Enabled 17 How to Contact Us 17 Acknowledgments 18 Introduction 19 What Is a Web Application? 19 How Do You Build Web Applications? 20 What Is Architecture? 21 How Do I Get Started? 22 Web Application Architecture 24 Layered Software Architecture 24 Layered Technologies 27 Software Interface Design 29 Getting from A to B 32 The Software/Hardware Divide 33 Hardware Platforms 34 Shared Hardware 35 Dedicated Hardware 36 Co-Located Hardware 36 Self-Hosting 37 Hardware Platform Growth 37 Availability and Lead Times 38 Importing, Shipping, and Staging 38 Space 39 Power 39 NOC Facilities 39 Connectivity 40 Hardware Redundancy 40 Networking 41 Languages, Technologies, and Databases 43 Development Environments 45 The Three Rules 45 Use Source Control 46 What Is Source Control? 46 Versioning 46 Rollback 47 Logs 47 Diffs 47 Multiuser editing and merging 47 Annotation (blame) 48 The locking debate 49 Projects and modules 50 Tagging 50 Branching 50 Merging 50 Utilities—the “Nice to Haves” 51 Shell and editor integration 51 Web interfaces 52 Commit-log mailing list 52 Commit-log RSS feed 52 Commit database 53 Commit hooks 53 Source-Control Products 54 The Revision Control System (RCS) 54 The Concurrent Versions System (CVS) 54 Subversion (SVN) 57 Perforce 58 Visual Source Safe (VSS) 60 And the rest... 61 Summary 61 What to Put in Source Control 62 Documentation 62 Software configurations 62 Build tools 63 What Not to Put in Source Control 63 One-Step Build 64 Editing Live 64 Creating a Work Environment 65 Development 65 Staging 65 Production 66 The Release Process 67 Build Tools 67 Release Management 70 What Not to Automate 72 Database schema changes 72 Software and hardware configuration changes 73 Issue Tracking 73 The Minimal Feature Set 74 Issue-Tracking Software 74 FogBugz 75 Mantis Bug Tracker 75 Request Tracker ( RT) 76 Bugzilla 76 Trac 77 What to Track 77 Bugs 77 Features 78 Operations 78 Support requests 78 Issue Management Strategy 78 High-level categorization 79 CADT 80 Scaling the Development Model 81 Coding Standards 82 Testing 84 Regression Testing 84 Manual Testing 85 i18n, L10n, and Unicode 87 Internationalization and Localization 88 Internationalization in Web Applications 88 Localization in Web Applications 89 String substitution 90 Multiple template sets 90 Multiple frontends 91 Unicode in a Nutshell 91 Unicode Encodings 93 Code Points and Characters, Glyphs and Graphemes 94 Byte Order Mark 96 The UTF-8 Encoding 97 UTF-8 Web Applications 98 Handling Output 98 Handling Input 100 Using UTF-8 with PHP 100 Using UTF-8 with Other Languages 101 Using UTF-8 with MySQL 102 Using UTF-8 with Email 103 Using UTF-8 with JavaScript 105 Using UTF-8 with APIs 107 Data Integrity and Security 108 Data Integrity Policies 108 Good, Valid, and Invalid 110 Filtering UTF-8 111 Filtering Control Characters 116 Filtering HTML 117 Why Use HTML? 117 HTML Input Filtering 118 Blacklists and Whitelists 119 Balancing 119 Dealing with HTML 120 Cross-Site Scripting (XSS) 120 The Canonical Hole 121 User Input Holes 123 Tag and Bracket Balancing 123 Protocol Filtering 126 SQL Injection Attacks 128 Mitigating SQL Injection Attacks 129 Avoiding SQL Injection Attacks 130 Email 135 Receiving Email 135 Injecting Email into Your Application 137 An Alternative Approach 138 The MIME Format 139 Parsing Simple MIME Emails 141 Parsing UU Encoded Attachments 142 TNEF Attachments 144 Wireless Carriers Hate You 146 Character Sets and Encodings 148 Recognizing Your Users 150 Unit Testing 152 Remote Services 154 Remote Services Club 154 Sockets 155 Using HTTP 158 The HTTP Request and Response Cycle 158 HTTP Authentication 160 Making an HTTP Request 161 Remote Services Redundancy 163 Asynchronous Systems 167 Exchanging XML 171 Parsing XML 171 REST 173 XML-RPC 173 SOAP 175 Lightweight Protocols 175 Memory Usage 176 Network Speed 176 Parsing Speed 177 Writing Speed 177 Downsides 177 Rolling Your Own 178 Bottlenecks 180 Identifying Bottlenecks 180 Application Areas by Software Component 183 Application Areas by Hardware Component 185 CPU Usage 186 Code Profiling 188 Opcode Caching 190 Speeding Up Templates 191 General Solutions 192 I/O 193 Disk I/O 193 Network I/O 197 Memory I/O 202 Memory and Swap 203 External Services and Black Boxes 206 Databases 206 Query Spot Checks 207 Query Profiling 209 Query and Index Optimization 210 Caching 215 Denormalization 218 Scaling Web Applications 220 The Scaling Myth 220 What Is Scalability? 221 Scaling a Hardware Platform 222 Vertical Scaling 222 Horizontal Scaling 223 Ongoing Work 225 Redundancy 226 Scaling the Network 229 Scaling PHP 230 Load Balancing 232 Load Balancing with Hardware 233 Load Balancing with Software 235 Layer 4 236 Layer 7 236 Huge-Scale Balancing 241 Balancing Non-HTTP Traffic 243 Scaling MySQL 245 Storage Backends 246 MyISAM 248 InnoDB 248 BDB 249 Heap 250 MySQL Replication 250 Master-Slave Replication 250 Tree Replication 252 Master-Master Replication 254 Replication Failure 256 Replication Lag 257 Database Partitioning 258 Clustering 258 Federation 260 Scaling Large Database 262 Scaling Storage 264 Filesystems 264 Protocols 265 RAID 267 Federation 269 Caching 271 Caching Data 272 Caching HTTP Requests 273 Scaling in a Nutshell 274 Statistics, Monitoring, and Alerting 275 Tracking Web Statistics 275 Server Logfiles 276 Analysis 277 Using Beacons 277 Spread 281 Load Balancers 282 Tracking Custom Metrics 283 Application Monitoring 285 Bandwidth Monitoring 286 Long-Term System Statistics 287 MySQL statistics 291 Apache statistics 294 memcached statistics 296 Squid statistics 296 Custom Visualizations 301 Alerting 303 Uptime Checks 303 Resource-Level Monitoring 304 Threshold Checks 304 Low-Watermark Checks 304 APIs 306 Data Feeds 306 RSS 307 RDF 310 Atom 311 The Others 312 Feed Auto-Discovery 312 Feed Templating 313 OPML 315 Feed Authentication 315 Mobile Content 318 The Wireless Application Protocol (WAP) 318 XHTML Mobile Profile 320 Web Services 322 API Transports 325 REST 325 XML-RPC 326 SOAP 329 Transport Abstraction 331 API Abuse 333 Monitoring with API Keys 333 Throttling 334 Caching 335 Authentication 336 None at All 337 Plain Text 337 Message Authentication Code (MAC) 338 Token-Based Systems 338 The Future 339 Index 341 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. From the back cover: "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][1] lead developer, *Building Scalable Websites* offers techniques for creating fast sites that your users will enjoy." [1]: http://flickr.com
دانلود کتاب Building Scalable Web Sites : Building, Scaling, and Optimizing the Next Generation of Web Applications