Adding scalability to legacy PHP web applications Overview Mario A. Valdez-Ramirez.

Slides:



Advertisements
Similar presentations
Implementing Tableau Server in an Enterprise Environment
Advertisements

Distributed Data Processing
The Lucernex Cloud: A software-as-a-service solution delivered via the Cloud What is the Cloud? Cloud Computing is the future of all software applications,
COM vs. CORBA.
The State of the Art in Distributed Query Processing by Donald Kossmann Presented by Chris Gianfrancesco.
Amazon RDS (MySQL and Oracle) and SQL Azure Emil Tabakov Telerik Software Academy academy.telerik.com.
CS 415 N-Tier Application Development By Umair Ashraf July 2nd,2013 National University of Computer and Emerging Sciences Lecture # 7 N-Tier Architecture.
Technical Architectures
Web Caching Schemes1 A Survey of Web Caching Schemes for the Internet Jia Wang.
Distributed Information Systems - The Client server model
Chapter 3 : Distributed Data Processing
NoSQL and NewSQL Justin DeBrabant CIS Advanced Systems - Fall 2013.
Nikolay Tomitov Technical Trainer SoftAcad.bg.  What are Amazon Web services (AWS) ?  What’s cool when developing with AWS ?  Architecture of AWS 
Distributed Systems: Client/Server Computing
Introduction to client/server architecture
© 2001 by Prentice Hall8-1 Local Area Networks, 3rd Edition David A. Stamper Part 3: Software Chapter 8 Client/Server Architecture.
Tiered architectures 1 to N tiers. 2 An architectural history of computing 1 tier architecture – monolithic Information Systems – Presentation / frontend,
DATABASE MANAGEMENT SYSTEMS 2 ANGELITO I. CUNANAN JR.
Build a CMS Website. The topics this chapter covers are: What is CMS ? What you can do with CMS The benefits and disadvantages of using a content management.
Web Application Architecture: multi-tier (2-tier, 3-tier) & mvc
Introduction to Databases Transparencies 1. ©Pearson Education 2009 Objectives Common uses of database systems. Meaning of the term database. Meaning.
N-Tier Architecture.
A Study in NoSQL & Distributed Database Systems John Hawkins.
How WebMD Maintains Operational Flexibility with NoSQL Rajeev Borborah, Sr. Director, Engineering Matt Wilson – Director, Production Engineering – Consumer.
Object Oriented Databases by Adam Stevenson. Object Databases Became commercially popular in mid 1990’s Became commercially popular in mid 1990’s You.
22-Aug-15 | 1 |1 | Help! I need more servers! What do I do? Scaling a PHP application.
PHASE 3: SYSTEMS DESIGN Chapter 8 System Architecture.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 12 Slide 1 Distributed Systems Architectures.
Database Architectures and the Web Session 5
— Build your own enterprise-class PaaS platform. Master Cloudset Cloudset1 Cloudset Resource Pool cloud Dedicated resource can be assigned to a cloudset.
Mobile Application Architectures CSE 390 Fall 2010.
DAT602 Database Application Development Lecture 12 C/S Model Database Application.
Modern Databases NoSQL and NewSQL Willem Visser RW334.
Scalable Web Server on Heterogeneous Cluster CHEN Ge.
Week 5 Lecture Distributed Database Management Systems Samuel ConnSamuel Conn, Asst Professor Suggestions for using the Lecture Slides.
Component Technology. Challenges Facing the Software Industry Today’s applications are large & complex – time consuming to develop, difficult and costly.
PHP Features. Features Clean syntax. Object-oriented fundamentals. An extensible architecture that encourages innovation. Support for both current and.
A Presentation to Oracle OpenWorld Blistering Web Applications with Oracle TimesTen In Memory Option.
Middleware for FIs Apeego House 4B, Tardeo Rd. Mumbai Tel: Fax:
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
Kjell Orsborn UU - DIS - UDBL DATABASE SYSTEMS - 10p Course No. 2AD235 Spring 2002 A second course on development of database systems Kjell.
Distributed Information Systems. Motivation ● To understand the problems that Web services try to solve it is helpful to understand how distributed information.
Server Performance, Scaling, Reliability and Configuration Norman White.
1 Chapter 1 Introduction to Databases Transparencies.
Distributed database system
Introduction Database integral part of our day to day life Collection of related database Database Management System : software managing and controlling.
Chapter 2 Database Environment.
1 CEG 2400 Fall 2012 Network Servers. 2 Network Servers Critical Network servers – Contain redundant components Power supplies Fans Memory CPU Hard Drives.
Background Computer System Architectures Computer System Software.
BIG DATA/ Hadoop Interview Questions.
Cofax Scalability Document Version Scaling Cofax in General The scalability of Cofax is directly related to the system software, hardware and network.
Amazon Web Services. Amazon Web Services (AWS) - robust, scalable and affordable infrastructure for cloud computing. This session is about:
Google App Engine. Contents Overview Getting Started Databases Inter-app Communications Modes.
Introduction The concept of a web framework originates from the basic idea that every web application obtains its foundations from a similar set of guidelines.
The Holmes Platform and Applications
Business System Development
Component and Deployment Diagrams
Netscape Application Server
N-Tier Architecture.
Integrating HA Legacy Products into OpenSAF based system
StratusLab Final Periodic Review
Modern Databases NoSQL and NewSQL
1. Public Network - Each Rackspace Cloud Server has two networks
Storage Virtualization
Introduction to Databases Transparencies
Lecture 1: Multi-tier Architecture Overview
Database System Architecture
Cloud Computing Architecture
Presentation transcript:

Adding scalability to legacy PHP web applications Overview Mario A. Valdez-Ramirez

The scalability problems of legacy applications Usually were not designed with scalability in mind. Usually have monolithic design. Even modular applications use a fake separation. For example, multiple modules using the same framework, communicating each other using framework functions. The framework is still monolithic.

Monolithic web application User mgmt Session and authentication Catalog Content mgmt Social networking Online sales Etc. Framework Database Filesystem

Why the scalability problem should be solved in your application The longer it takes to fix this, higher the cost and time. The problem won't go away, it will only get worst as the user base grows, with each new feature added. Application will become costlier to maintain. Then one day it will be unmaintainable. There are software development issues that can be solved too by fixing this.

Vertical scaling Adding more power to the current hardware. Usually more disk, memory, processors and bandwidth. Quickly becomes very expensive. Does not scale very well, because of technological limitations you can only go as far as the fastest processor, the largest disk, the biggest network link, etc.

Vertical scaling However it is very simple to implement. Does not require changes to the application. It is usually the first attempted solution.

Single server, multiple jobs Web server, file server database server

Single server, multiple jobs, vertical scaling Web server, file server database server

Horizontal scaling Adding more nodes (servers). Usually requires splitting the job done by the server and the application. Allows to use cheaper resources. Requires changes to the application. Increases complexity. Scales better than vertical scaling. Can be used to build redundant solutions.

How to start fixing a legacy application?

Easy fixes Leverage separation already present in any PHP application. Separate database, data files, PHP scripts. Different servers for each.

Easy fixes, separations presents in most PHP applications FilesystemDatabase PHP application PHP framework Third-party PHP code PHP runtime C libThird-party libraries PHP extensions Operative system Web daemon

Easy fixes Two servers, one for PHP/files and one for database. Three servers, one for PHP, one for database, one for files. Move static (or even public dynamic files) to another server (or CDN). Use multiple servers for PHP application. Use a load balancer.

Multiple servers, different jobs Database server Web server, file server

Multiple servers, different jobs Database server File server Web server

Multiple servers, different jobs Web server File server Static files server (or CDN) Database server

Multiple servers, different jobs Database server File server Web server Load balancer

Advantages of these easy fixes Require minor changes to the web application. Relatively cheap usually cheaper than using one very large server. Easy for most programmers to implement mostly changes to session and file management. With the load balancing option, it is very easy to add more web servers. With proper monitoring the load balancing option provides some redundancy.

Disadvantages of these easy fixes There are still potential bottlenecks and single failure points: The database server. A very common bottleneck for transactional applications. It can be replaced with a DB cluster. The file server. It can be replaced with a SAN or distributed filesystem. The load balancer. It can also be replaced with multiple load balancers.

Harder fixes. Code splitting (module separation) Split the application as simpler modules. Each module is independent. For example, one module for user management, another for content management, another for online sales, another for social networking, etc. Any communication among modules is done through the database (database is shared). There are alternatives, like web services. Each module must be really independent, down to the framework and third-party libraries (if used).

Code splitting Session and authentication User mgmt Framework Content mgmt Framework Catalog Online sales Framework Social networking Framework Database

Advantages of code splitting Each module is simpler to maintain. Each module can be hosted in a different server. Each module can be build using different frameworks, even different languages and use different OS. Remove most licensing issues as each module shares only the data, not the code of other modules.

Harder fixes Code+data splitting Split the application but also the data (multiple databases). For example, the social networking data may be separated from the online sales data, and the content management data from the user management data. Modules still share some databases (for example, the users database). Easier to implement if the application is already split in modules.

Code+data splitting Session and authentication User mgmt Framework Content mgmt Framework Catalog Online sales Framework Social networking Framework Database

Advantages of code/data splitting All the advantages of code splitting plus: Data is stored in multiple databases so, it can be hosted in different servers, and each database can use a different RDBMS, or even use a different kind of DB (like NoSQL).

Harder fixes. Code+data splitting + data sharding Split the application, and data vertically but also split the data horizontally. For example, the content data can be split in multiple databases according to category, or content provider, or the user data according to geographic location. Only make sense with large datasets, with logically separated data.

Code+data splitting+sharding Session and authentication User mgmt Framework Content mgmt Framework Catalog Online sales Framework Social networking Framework Database

Advantages of code/data splitting + data sharding All the advantages of code/data splitting plus: Data is stored in multiple databases, not only per- module, but per other criteria (client, category, region, etc.). It allows for greater scalability and performance, as long as queries don't require data from multiple shards. Useful for multitenant applications. For data requiring high separation between clients (for security, compliance, privacy), the sharding is done per client.

New opportunities for code/data split applications

Software development can be split easily among teams. Each team can develop using whatever language, framework and platform they know. Increase resilience of the project, as each developer is easier to replace affecting temporarily only one module. Potentially more cost-effective development. Allow to outsource the development among multiple providers.

New opportunities for code/data split applications Software development is less risky. Easier to fix bugs as they span single modules. New features can be deployed without affecting other modules. Allow to test new solutions (platform, methodology, technique, language, etc.) without risking the whole application. Allow to integrate third-party applications without licensing issues.

Other useful solutions not covered Caching specially PHP caching, including clustered caches like Memcached. Database clusters master-slave, master-master, clustered RDBMS and cloud databases. Cloud/PaaS scalability however most PaaS providers require the application have already all the easy fixes implemented to leverage their platform.

How to start?

Start with the easy fixes. One step at a time. Plan and implement module splitting. Divide by two. Then by four. Then continue. Any new feature or module should be implemented independently.

How to start? Easy fixes Start implementing the easy fixes in the main application. Usually only the database, session and file management functions require rewriting. If your DB, session and file handling code is not inside a single class or group of functions, first refactor, then split. Spaghetti code should be first untangled, then split.

How to start? Module splitting Use the documented API of your application and start planning how to separate its functions per module. If you don't have a defined API, define it, then refactor. If you have one but is undocumented, document it. Decide what data is shared among all modules. Then refactor. Never refactor without architectural planning! This job is better suited for your current development team. It requires deep knowledge about your application.

How to start? New modules Any new feature or module, should be started as a fully separated module, down to the framework. Design with share-nothing code in mind. Remember each module should be independent. Share data, not code. New modules are good opportunities to test new platforms, languages, frameworks and development teams.

Questions?