Web hosting has evolved. Say hello to serverless hosting.\r\n\r\nIn the old days, there was only shared hosting. Typically very inexpensive, its primary feature is that hundreds or thousands of websites are packed onto a single server, with each site getting a share of the available resources. Its biggest drawback? Poor security and the \u201cnoisy neighbor\u201d effect.\r\n\r\nThen came VPS hosting, which was a dramatic improvement. Dedicated CPU and enhanced security drove adoption as users sought out dedicated resources and better security and performance for their websites.\r\n\r\nNow, there\u2019s <a href="https:\/\/pagely.com\/blog\/northstack-serverless-hosting-platform-by-pagely\/" target="_blank" rel="noopener">serverless hosting<\/a>. It\u2019s the latest incarnation of \u201cthe cloud\u201d and is quickly becoming the go-to technology for businesses looking to scale, with big brands like Netflix, Nike, and Airbnb already taking advantage of its server management, extreme scaling, and sub-second metering.\r\n\r\nBut what is serverless? And how on earth does it work without servers?\r\n\r\nLet's take a look at how this emerging architecture is allowing developers to focus on code, not infrastructure.\r\n<h2>What Is Serverless?<\/h2>\r\nFirst up, the name \u201cserverless\u201d is somewhat of a misnomer. Just like wireless internet has wires somewhere, serverless architecture has servers somewhere, too.\r\n\r\nWhat \u201cserverless\u201d actually means is that, as a developer, you don't have to deal with the infrastructure side of building an application. Your application still runs on servers, but you no longer have to provision, scale, and maintain servers to run it\u2014you leave all of that to your serverless provider.\r\n\r\nAs the folks at<a href="http:\/\/serverless.com\/" target="_blank" rel="noopener"> Serverless.com<\/a> explain:\r\n\r\n<em>\u201cServerless has become a movement about developer empowerment. As a technology, it abstracts away the most menial parts of building an application, leaving you free to actually spend your days coding.\u201d<\/em>\r\n\r\nIn a nutshell: deploy the application, and go.\r\n\r\nLet Amazon explain it in this quick video.\r\n\r\n<iframe src="https:\/\/www.youtube.com\/embed\/eOBq__h4OJ4" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"><\/iframe>\r\n\r\nServerless is still in its infancy as a technology and there\u2019s still some confusion around what it is. Essentially, it encompasses two different but overlapping areas:\r\n<ul>\r\n \t<li><strong>Backend as a Service (BaaS)<\/strong> \u2013 Applications that significantly depend on third-party services.<\/li>\r\n \t<li><strong>Function as a Service (FaaS)<\/strong> \u2013 Custom code that's run in ephemeral containers.<\/li>\r\n<\/ul>\r\nAmazon introduced the world to FaaS when it launched AWS Lambda in 2014. Since then, Microsoft, Google, and IBM have followed suit with their own offerings. But Lambda is by far the most mature and widely used serverless platform.\r\n\r\nFor the remainder of this article, we'll focus on FaaS since it\u2019s the most popular implementation of serverless.\r\n<h2>How Does Serverless Work?<\/h2>\r\nThe fundamental idea behind serverless architecture is that server-side applications are broken up into individual functions that each perform a distinct task and can be invoked and scaled individually.\r\n\r\nWriting software as a collection of functions is super basic\u2014every CompSci 101 student learns how to program this way. But what serverless architecture does is take this concept to the extreme.\r\n\r\nThe entire application is split into separate, loosely coupled components that can be operated at any scale. When you upload your code, your serverless provider takes your stateless functions and runs them in parallel, isolated containers that can be monitored and scaled separately.\r\n\r\nYou don't need to worry about container orchestration, OS configuration, or the underlying servers or security. Just upload your code and run your function.\r\n\r\n<a href="https:\/\/hackernoon.com\/the-benefits-of-serverless-computing-and-its-impact-on-devops-e75d82c47ac4" target="_blank" rel="noopener">As Augustin Jose explains<\/a>, serverless has evolved to be the ideal solution for apps running in the cloud:\r\n\r\n<em>\u201cThere is no perpetual process of running and waiting for HTTP requests or API calls, but rather, only an event mechanism to help trigger code execution on any of the cloud servers; the provider defines the event type.\u201d<\/em>\r\n\r\nFunctions have to be called in response to predefined events and triggers; they don't start themselves but can be set up to start manually, or upon request. Developers write code only when a certain event needs to take place--the cloud provider takes care of the rest.\r\n\r\nTo illustrate, here's how AWS Lambda's serverless solution works:\r\n\r\n<img class="aligncenter size-full wp-image-593" src="https:\/\/northstack.com\/wp-content\/uploads\/2018\/11\/pagely_serverless.jpg" alt="serverless architecture" width="625" height="189" \/>\r\n\r\n<em>Image: AWS Lambda<\/em>\r\n\r\nA good example of a serverless architecture working well is the processing of data immediately after an upload, such as<a href="https:\/\/aws.amazon.com\/solutions\/case-studies\/the-seattle-times\/" target="_blank" rel="noopener"> The Seattle Times' real-time creation of image thumbnails for viewing on different devices<\/a>.\r\n\r\nTraditionally, each image would first be sent to the app developer\u2019s server, parsed, and then made available for display on different devices. This method works fine for small numbers of simultaneous users, but what about the newspaper's 7 million unique visitors a month? Suddenly, simple image resizing becomes a sluggish nightmare.\r\n\r\nServerless easily solves this problem. The developer writes a function that resizes images in 10 different sizes. The serverless provider wraps the function into a container that can be monitored, cloned, and distributed on any number of servers. The developer then routes all image resizing to the provider, who simply runs more containers as necessary to ensure the logic will work at any scale.\r\n<h2>Serverless WordPress: The Future of WordPress?<\/h2>\r\nNorthStack is the first truly <a href="https:\/\/northstack.com\/">serverless WordPress Hosting<\/a> Solution.\r\n\r\nBut let\u2019s take a step back for a moment to talk about so-called \u201cserverless\u201d WordPress, aka static websites.\r\n\r\nBack in 2016, Shifter emerged as the first \u201cserverless\u201d solution for WordPress. It promised pseudo serverless hosting: in one click your site could be converted into static HTML files, moved to Amazon S3, and delivered via CloudFront.\r\n\r\nThen HardyPress came along in 2017, promising a similar solution that also converted WordPress sites into static files for \u201cserverless\u201d hosting on AWS infrastructure.\r\n\r\nHere\u2019s how these so-called serverless WordPress solutions work:\r\n<ol>\r\n \t<li>Launch a new WordPress site using the Shifter or HardyPress dashboard.<\/li>\r\n \t<li>Import an existing site or create a new one.<\/li>\r\n \t<li>Generate a static version of your site.<\/li>\r\n \t<li>Deploy and go live.<\/li>\r\n<\/ol>\r\nBoth these services offer the security, speed, and elasticity of serverless hosting. But it\u2019s not truly \u201cserverless.\u201d\r\n\r\nShifter and HardyPress are essentially static site generators that strip away the dynamic elements that make WordPress the powerful content management system that it is today. Customers get a somewhat lifeless static version of their WordPress site.\r\n\r\nTo give you an example, AWS architect Yan Cui, aka The Burning Monk, has<a href="https:\/\/theburningmonk.com\/2018\/03\/this-blog-is-now-serverless\/" target="_blank" rel="noopener"> detailed how he hosts his WordPress site with Shifter<\/a>. Using Shifter\u2019s \u201cserverless\u201d solution, his static site is fast, but he\u2019s had to sacrifice dynamic elements like search and comments.\r\n\r\n<strong>NorthStack delivers truly serverless WordPress hosting that maintains all the dynamic and interactive features that make WordPress great.<\/strong>\r\n\r\nNorthStack offers managed application hosting built on a modern serverless AWS stack. You can deploy vanilla or <a href="https:\/\/www.bigcommerce.com\/blog\/headless-commerce\/#what-is-headless-commerce" target="_blank" rel="noopener">headless<\/a> WordPress, Node, and even static sites with ease. Your CPU, database, data transfer, and disk usage are independently metered and elastically autoscaled.\r\n\r\nHere\u2019s how it works.\r\n<ol>\r\n \t<li>Use NorthStack\u2019s pre-packaged docker containers to easily create and package your application.<\/li>\r\n \t<li>Specify build scripts (webpack, Grunt) and health checks to run during atomic deployments.<\/li>\r\n \t<li>Elastic Autoscaling means you always have the power you need and only pay for what you use.<\/li>\r\n<\/ol>\r\nNorthStack\u2019s innovative serverless architecture runs on AWS\u2014the established leader in cloud computing\u2014and is backed by Pagely\u2019s 10 years of experience specializing in high-demand <a href="https:\/\/pagely.com\/blog\/managed-wordpress-hosting\/" target="_blank" rel="noopener">managed WordPress hosting<\/a>. It\u2019s the optimum environment for any WordPress site\u2014big or small.\r\n\r\n<iframe src="https:\/\/www.youtube.com\/embed\/LJQ-rQc4dgM" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"><\/iframe>\r\n\r\nNorthStack is currently best suited for developers and technically savvy users. Pricing is metered and consumption-driven, with paid support options so you only pay for what you use.\r\n\r\nAs Craig Martin, co-founder of Performance Foundry and an early adopter of NorthStack, <a href="https:\/\/performancefoundry.com\/hosting\/welcoming-northstack-serverless-wordpress\/" target="_blank" rel="noopener">explains<\/a>:\r\n\r\n<em>\u201cUp until now, I\u2019ve never seen serverless WordPress done properly. Many solutions look to create static versions of the WordPress site and just serve that, leading to multiple issues with interactions\u2014like making sales or leaving comments.\u201d<\/em>\r\n\r\n<em>\u201cNorthStack\u2019s philosophy matches with ours: high quality infrastructure at a price that meets business objectives.<\/em>\r\n\r\n<em>\u201cThe future is both autoscaling and serverless. We\u2019re excited.\u201d<\/em>\r\n<h2>The Benefits of Serverless Architecture for WordPress<\/h2>\r\nFor years, the responsibility of server management has fallen on developers who've had to wrangle applications on servers they've in turn had to patch, update, and continuously monitor due to all the unexpected errors that can break production.\r\n\r\nServerless technology completely flips this paradigm on its head. With serverless, you can take your mind off infrastructure issues and focus on business goals because you can build, run, and test applications without having your own servers. All you need to do as a developer is focus on your code.\r\n\r\nUltimately, serverless is about allowing you to focus your efforts on what provides value to your users. No matter what you are building, there are plenty of reasons to go serverless.\r\n<h3>1. No Servers to Manage<\/h3>\r\nServerless technology's biggest selling point is that you no longer have to manage servers; you no longer need to spend time and resources on server provisioning, maintenance, updates, security patching, scaling, or capacity planning. Instead, all of these tasks and capabilities are handled by your serverless providers and are completely abstracted away from the developer.\r\n\r\nYou can deploy code without provisioning anything beforehand, or managing anything afterward. You just write your code and your serverless provider automatically runs it for you.\r\n\r\nAs AWS Solutions Architects Thyagarajan and Maitreya Ranganath point out,<a href="https:\/\/www.slideshare.net\/AmazonWebServices\/serverless-patterns-no-server-is-easier-to-manage-than-no-server-aws-security-day" target="_blank" rel="noopener"> \u201cno server is easier to manage than no server.\u201d<\/a>\r\n\r\n[caption id="" align="aligncenter" width="638"]<img class="size-full" src="https:\/\/image.slidesharecdn.com\/awssecuritydayserverlesspatterns6-160622201617\/95\/serverless-patterns-no-server-is-easier-to-manage-than-no-server-aws-security-day-1-638.jpg?cb=1466626702" width="638" height="359" \/> serverless architecture[\/caption]\r\n\r\nOr as developer<a href="https:\/\/hackernoon.com\/five-advantages-of-serverless-technology-68160c1f884e" target="_blank" rel="noopener"> Joe Hanson points out<\/a>, it gives developers more time for user experience:\r\n\r\n<em>\u201cUsers don't care about infrastructure; they care about features and their experience. Serverless architecture allows teams to focus resources on the elements that keep users happy.\u201d<\/em>\r\n<h3>2. Extreme Scalability<\/h3>\r\nEveryone wants their app to be the next big thing. But if you suddenly found you had the next Facebook or Instagram on your hands, could your server handle the load?\r\n\r\nProvisioning infrastructure just in case is a big risk\u2014\u200abut so is being unprepared when success strikes. Serverless architecture means you don't need to make this choice.\r\n\r\nOne of the biggest advantages of serverless is its extreme elasticity. Its immediate and seamless provisioning of functions means you can scale your application in seconds to handle sudden surges of traffic. The underlying system will automatically handle things such as load-balancing and the provisioning of appropriate infrastructure\r\n\r\nLikewise, during lulls when there is no demand, you don't need to have servers running needlessly, waiting for something to happen.\r\n\r\nWith serverless, you don't need to fire alerts or write scripts to scale up and down\u2014\u200ayour provider manages scaling challenges for you.\r\n\r\nA great example of how serverless can scale is A Cloud Guru. In six months, the online training platform<a href="https:\/\/read.acloud.guru\/why-serverless-with-aws-is-a-game-changer-3cb37e25f638" target="_blank" rel="noopener"> scaled to 40,000 users without a single server<\/a>.\r\n<h3>3. Disruptively Low Cost<\/h3>\r\nGoing serverless can save you a ton of money. Because you're only paying for the time your code is executed and there's no need for always-on servers, operational costs plummet.\r\n\r\nThere are no costs resulting from idle capacity. With AWS Lambda, for example, you are charged for every 100ms your code executes and the number of times your code is triggered. You don't pay anything when your code isn't running.\r\n\r\nThe days of spending tens of thousands of dollars\u2014or more\u2014for servers are gone.\r\n\r\nMany developers have shared their cost savings since switching to serverless.\r\n\r\nWhen developer Ayner Sorek moved his side project\u200a\u2014an Express.JS application with 50\u2014\u200a150 daily visits\u200a\u2014\u200afrom AWS Elastic Beanstalk to Lambda+APIG, it resulted in a<a href="https:\/\/medium.freecodecamp.org\/how-i-cut-my-aws-bill-by-90-35c937596f0c" target="_blank" rel="noopener"> ~90% reduction of costs<\/a>.\r\n\r\nIn another example,<a href="https:\/\/read.acloud.guru\/how-going-serverless-helped-us-reduce-costs-by-70-255adb87b093" target="_blank" rel="noopener"> Mohsiur Rahman from Heavywater writes<\/a> that his company's previous infrastructure kept getting more and more expensive over time:\r\n\r\n<em>"Even with most of our EC2 instances sized as t2.micro, our AWS bills kept increasing. In the span of just 4 months, our monthly bill increased from $10K to $30K with over 1,000 EC2 instances running."<\/em>\r\n\r\nJust by going serverless, their infrastructure costs decreased from $30,000 to $4,000 in just three months.\r\n\r\nLikewise, serverless architecture has been a game changer for A Cloud Guru.<a href="https:\/\/read.acloud.guru\/why-serverless-with-aws-is-a-game-changer-3cb37e25f638" target="_blank" rel="noopener"> Co-founder Sam Kroonenburg writes<\/a> that serverless has allowed his team to have an extremely low operating cost base:\r\n\r\n<em>"We don't run servers or infrastructure, which means we don't have to employ people to maintain and monitor them. There are no servers to be patched, no auto-scaling groups to manage, no compute performance metrics to worry about."<\/em>\r\n\r\nHe says the team uses a mix of different cloud services, such as AWS, Auth0, and Intercom, and pays monthly fees. This model has enabled A Cloud Guru to deliver training with a disruptively low-cost pricing model and attract a large user base quickly, helping to fuel the platform\u2019s fast growth.\r\n<h3>4. Faster Time to Market<\/h3>\r\nGot a great idea for your app? Serverless can help you ship it faster.\r\n\r\nBecause there\u2019s less to provision up front and less to manage after deployment, small teams can conceive and build features quickly.\r\n\r\n<a href="https:\/\/read.acloud.guru\/why-serverless-with-aws-is-a-game-changer-3cb37e25f638" target="_blank" rel="noopener">Kroonenburg says<\/a> this "insane speed to market" has helped fuel his company's growth.\r\n\r\n<em>"Without having to build a backend, we got to market quickly. Within 4 weeks of starting the build, in fact. This enabled us to get users on the platform early and get their feedback often. It leads us to build a better product... a product that our users could give input to and help to craft."<\/em>\r\n<h3>5. Less Wasted Time and Effort<\/h3>\r\nWhen you're developing a bunch of products, certain features are developed repeatedly. For example, user authentication and payment processing.\r\n\r\nServerless, with its use of individual functions, allows teams to develop product services as independent components. These components can then be reused across different projects so developers don't have to reinvent the wheel, saving time and effort.\r\n<h2>The Drawbacks of Going Serverless<\/h2>\r\nServerless does bring many benefits to the table. Nonetheless, no single approach or technology is the be all and end all\u2014it all depends on the context of what you are developing.\r\n\r\nThere are some potential drawbacks that might make serverless unsuitable for your business or project.\r\n<h3>1. Vendor Lock-In<\/h3>\r\nA drawback people often point to when talking about serverless technology is vendor lock-in.\r\n\r\nProviders all have different required formats and deployments methods. Additionally, everything is controlled by the provider, so you don't have complete control over the usage and management of resources.\r\n\r\n<a href="https:\/\/hackernoon.com\/7-ways-your-business-will-benefit-through-serverless-522b3f628a33" target="_blank" rel="noopener">As Aleksandar Simovic, author of <em>Serverless Applications with Node.js<\/em>, points out:<\/a>\r\n\r\n<em>\u201cRunning your applications in a serverless environment can tightly couple your applications and services with your platform provider. Even though your business logic isn't reliant on the service itself, it still needs a direct connection to the platform provider services. With interface and protocol differences between serverless platform providers \u2018in the mix,' any potential move of your applications to other serverless platforms will be a painful rewrite.\u201d<\/em>\r\n\r\nBut<a href="https:\/\/techbeacon.com\/serverless-vendor-lock-should-you-be-worried" target="_blank" rel="noopener"> as Jaikumar Vijayan writes<\/a>, there\u2019s always a degree of lock-in with any technology choice, and serverless is no different. He suggests businesses should focus on finding and committing to a platform that offers them the most benefits and integrations across provider services.\r\n<h3>2. Learning Curve<\/h3>\r\nDespite the comprehensive documentation and community resources available for getting up to speed on serverless, it's still in its infancy as a technology and developers might encounter a steep learning curve.\r\n\r\nIt's a relatively new architecture that does require a mindset shift. And<a href="https:\/\/medium.freecodecamp.org\/serverless-is-cheaper-not-simpler-a10c4fc30e49" target="_blank" rel="noopener"> as Dmitri Zimine writes<\/a>, this means developers reap the cost benefits in return for complexity.\r\n\r\n<em>\u201cMuch of this extra complexity is \u2018wiring\u2019: configurations, deployment scripts, DevOps tooling artifacts\u200a\u2014templates, recipes, playbooks, Docker files\u2026 All the stuff used to forklift the solution up to the cloud, and keep it there.\u201d<\/em>\r\n\r\nBut as Zimine goes on to write:\r\n\r\n<em>\u201cThe cost-saving benefits of serverless are so clear and so substantial, and the push from all major cloud vendors towards serverless is so strong, that it won't be long before the complexity is tamed and serverless becomes mainstream in all the areas where it applies.\u201d<\/em>\r\n<h3>3. Unsuitable for Long-Term Tasks<\/h3>\r\nServerless is great for short real-time or near-real-time processes, like sending out emails, resizing images, and transaction order processing.\r\n\r\nBut for long duration operations, such as uploading video files, which can't be split into multiple compute cycles, you're better off with \u201cserver-full\u201d architecture.\r\n\r\nAWS Lambda, for example, gives you 5 minutes maximum to execute a task and if it takes longer, you need to call another function.\r\n\r\nThis means that for large-scale data tasks or long-running processing tasks, you might want to consider another architecture or, at least, develop in such a way as to be appropriate, which is possible and can be done.\r\n<h2>Conclusion<\/h2>\r\nServerless technology is really breaking ground in its path to disrupt server infrastructure. Industry-wide adoption is on the rise, driven largely by its low cost and scalability, helping both big brands and startups push applications to market faster while delivering greater value to users.\r\n\r\nIt's still a relatively young technology\u2014<a href="https:\/\/martinfowler.com\/articles\/serverless.html" target="_blank" rel="noopener">some say it\u2019s in the slightly awkward teenage years<\/a>\u2014so our understanding of serverless and how to use it is still evolving. No doubt there will be many advances in this technology in the years to come, and it will be fascinating to see how developers adopt and run with it to build better applications for users.