Qualities • “Basic” implementation - Limited scalability - Single point of failure - Limited Security
Performance Tactics • Control Resource Demand Increase the resource efficiency (caching) - Reduce overhead (pre-generate HTML from PHP) - • Manage Resources Schedule resources (load balancer) - https://www.digitalocean.com/community/tutorials/5-common-server-setups-for-your-web-application
Load Balancing deploy many replicated instances of the server on multiple machines
Caching + Load Balancing FrontEnd (Apache)
Caching + Load Balancing Squid Apache (Caching)
Caching + Load Balancing Squid Apache (Caching)
Caching + Load Balancing LoadBalancer Squid LoadBalancer Apache (Squid)
Caching + Load Balancing LoadBalancer Squid LoadBalancer Apache (Squid) Squid Apache Squid LoadBalancer Apache LoadBalancer Squid Apache
UI Page Static Submit Logic ArticleView Resources Skinning Localization ArticleEdit Parser Writes Reads Backend
UI Page Cache Cache Loader Submit Logic ArticleView Skinning Localization Static Cache Resources Cache ArticleEdit Parser Writes Reads Backend
Performance Tactics • Control Resource Demand Prioritize events (deferred article updates) - • Manage Resources Introduce concurrency (distributed database) - Schedule resources (load balancer) - Multiple copies of data and computations - https://www.digitalocean.com/community/tutorials/5-common-server-setups-for-your-web-application
Master/Slave split a large job into smaller independent partitions which can be processed in parallel
Distribution + Replication Database More reads than writes Near-live updates (no strict consistency requirements)
Distribution + Replication Load Balancer Writes Reads DB Master DB Slave More reads than writes Near-live updates (no strict consistency requirements)
Distribution + Replication Data Sharding Clear data separation (Article Name: A-B, C-D, etc..)
Distribution + Replication Load Balancer Writes Reads DB Master DB Slave
Distribution + Replication Partition Logic Load Balancer (Sharding, (Master) Relication Reads Writes DB Master DB Slave (Shard)
Visualization
UI Page Cache Cache Loader Submit Logic ArticleView Skinning Localization Static Cache Resources Cache ArticleEdit Parser Writes Reads Backend
UI Page Cached Cached Loader Submit Logic HTML File Skinning Localization Cache Static Resources ArticleView Cached Parser ArticleEdit Cache Job Queue Parser Writes Job Runner Reads Backend Writes Precompile/Recompile Regenerate/Invalidate
Security/Availability Tactics • Prevent Attacks • Challenge Tokens (CSRF) • Validation (User) and Sanitization (SQL Injection, XSS) • Resist Attacks • Maintain multiple copies of computations • Maintain multiple copies of data • Recover from Attacks • DB Versioning (Recovery from data loss)
UI Page Cache Cache Loader Submit Logic ArticleView Skinning Localization Static Cache Resources Cache ArticleEdit Parser Writes Reads Backend
UI Page Cache Cache Submit Logic Loader ArticleView Skinning Localization Static Resources Sanitizer Cache Pipeline Cache Parser ArticleEdit Reads Writes User Access Backend
UI Page Cache Cache Submit Logic Loader ArticleView Skinning Localization Static Resources Cache Cache Sanitizer Parser ArticleEdit Reads Writes Backend
Additional Qualities
Extensibility UI Page Cache Cache Submit Logic Loader ArticleView Skinning Localization Static Resources Cache Cache Sanitizer Parser ArticleEdit Reads Writes Backend
Extensibility UI Page Cache Cache Submit Logic Loader ArticleView Localization Skinning Static Resources Notify Cache Cache Sanitizer Notify Notify ArticleEdit Parser Notify Notify Reads Writes Register Callback External Hook Engine Backend Module
Recommend
More recommend