How PHP 7 Fits into SaaS App Development Goals
Saturday, February 27, 2016
PHP 7 introduces significant performance improvements that will save you infrastructure dollars and improve your users’ wait time, but it also comes with some breaking changes on a range from obvious to subtle.
Given the tradeoffs, how should you prioritize a stack update? While PHP 7 promises incredible speed improvements, the best path to optimizing app performance is through a holistic approach. PHP 7 is a part of that on its own, but there are many pieces to the puzzle.
Let’s step back and take a look at where PHP 7 fits in with SaaS app developers’ two key goals.
1. Performance & Availability
PHP 7 is a huge upgrade for the app developer community, with better performance out of the box. Zend reports that PHP 7 is up to 2x faster compared to PHP 5.6, and also cuts memory usage significantly thanks to improvements in handling of data structures.
But benchmarks on someone else’s app are just benchmarks: performance enhancements will vary from application to application. The only way to really know how much your performance will be/is improved is to have a sense of where your bottlenecks are.
If you’ve got a bunch of app servers that are all maxing on CPU/RAM, you probably stand to gain significantly. This was the case for older PHP deployments that weren’t using opcode caches: you are wasting time and money - just do it already! Check top, or use some basic host metric monitoring to check for this.
If that’s not the case, though, you may be in a larger population with more complex optimization problems. Maybe your application is spending most of its time blocking on the database, or in calls out to external services? In this case, there’s probably other more important bottlenecks to clear up instead of (or in addition to) a PHP7 upgrade. Knowing that a query is slow, you could add a proper index, or cache the results of the query to offload work from the database.
The best way to know for sure is monitoring that can provide analysis along both these dimensions: showing where requests are spending the most time, and what resources are getting used in serving them. There’s a number of free tools and commercial tools with free trials that can help here.
Good app monitoring before an upgrade will help make sure you actually want to cross that bridge; afterwards it will help you celebrate your success, and also pinpoint where you may want to modify your app next.
What PHP 7 and any other performance improvements translate to is: (1) support for more concurrent users without additional hardware resources, and (2) happier users overall.
2. Speed of Development
While performance makes for happier users, it’s rarely a feature. Speed of development, adding new features and polishing rough edges, makes for happy SaaS app developers and owners. For app owners in particular, software engineers are often going to be their biggest investment – usually more expensive than infrastructure when it comes to cost. Therefore, making engineers efficient is vital to the bottom line.
Tying back to some of the points about performance and agility, PHP7 has some nice new capabilities around typing and other areas that might help your team work more efficiently, but they aren’t necessarily going to be huge wins. And the upgrade will likely require a bit of engineering. Good news? There’s tools like php7cc that can help ensure you a safe upgrade.
The monitoring you put into place to help with performance and availability above may help here again with speed of development, by the way: when less time needs to be spent tracking down bugs and performance problems, more time is being spent on feature dev. That monitoring is not only useful to speed your site, but also your team!
The Economic Argument
If you are a SaaS app developer looking to sell PHP 7 to upper management, the core of the issue will really come down to cost and ROI. In this case, it’s very parallel to other big advances like cloud-based deployments: on first read, it may sound expensive and with unclear returns, but in fact it pays dividends in some tangible ways.
Infrastructure costs can be cut by ensuring performant systems, and PHP7 will help you get there. The key to proving this and showing ROI is monitoring. You can see where you’re using resources inefficiently and where you can optimize code to dramatically cut request time and use less server resources overall.
Development costs can be cut by ensuring that engineers are able to use their time effectively. Where your engineers could be dealing with operations problems, many cloud architecture vendors will ensure your systems are up to date and manage the infrastructure maintenance for you.
Monitoring tools speed problem resolution and help companies avoid frustrated customers, which saves cost when it comes to both employees and users. (Often times, in the absence of monitoring tools, engineers will end up building something to do the job themselves, which can detract time and attention from what’s really important –maintaining the product itself!)
For SaaS app developers and owners, performance, speed, and cost are inextricably linked, so understanding how they fit together is an excellent first step.
Read more: https://www.appneta.com/
This content is made possible by a guest author, or sponsor; it is not written by and does not necessarily reflect the views of App Developer Magazine's editorial staff.
Become a subscriber of App Developer Magazine for just $5.99 a month and take advantage of all these perks.
MEMBERS GET ACCESS TO
- - Exclusive content from leaders in the industry
- - Q&A articles from industry leaders
- - Tips and tricks from the most successful developers weekly
- - Monthly issues, including all 90+ back-issues since 2012
- - Event discounts and early-bird signups
- - Gain insight from top achievers in the app store
- - Learn what tools to use, what SDK's to use, and more