Migrating legacy apps to serverless platforms doesn’t have to be painful
Modernizing existing applications for use with serverless frameworks like AWS Lambda becomes easier when you take it one step at a time.
Cloud computing’s original conceit is the ability to scale computing power to match the needs of your organization. By using cloud-powered virtual machines, the expensive and time-consuming CapEx process can be sidestepped, with new systems brought online in seconds. Serverless computing frameworks, such as AWS Lambda, elevate that abstraction to a higher level—the server is temporal, an instance lasts only as long as needed to perform a given task.
SEE: Special report: Prepare for serverless computing (free PDF) (TechRepublic)
This can provide significant savings for organizations—operating a VM for a process that idles throughout most of the day can be wasteful. Despite the potential benefits, software developers often recoil at the prospect of integrating serverless functions into a legacy application. Brett Berliner, principal software engineer at Insight, spoke about how to approach this integration in August at Code PaLOUsa in Louisville, KY.
Understanding what legacy code you have
Though the two disciplines are largely dissimilar, a concept in urban development is readily applicable in software development—the difference between greenfield vs. brownfield projects. Greenfield applications are often quite exciting for developers, as it provides the opportunity to build something from the ground up. Brownfield projects, for contrast, are preexisting. “It kind of has a negative connotation,” Berliner said. “They’re just existing applications, it doesn’t mean they are bad, or that they are poorly designed.”
“Perspectives and focus change all the time,” Berliner said. “As companies mature, performance and reliability start to trump innovation and creativity.”
Applications that are simply too large—either too spread out, or too centralized—are “automatically a good candidate for serverless,” according to Berliner, adding “If your servers are outdated or underpowered… it really prevents growth and scaling of your website if you have old, on-premises servers. If we’re moving these servers either to the cloud or a stronger server, we’re going to have to re-test all the integration points anyway, so why not introduce new technology?”
Likewise, applications originally developed outside of a DevOps workflow, applications with high incidence of exceptions “that can bubble up and tank the entire app,” and applications with limited business knowledge—situations where principal development was performed decades ago, in which the original programmers have since retired—are good candidates, according to Berliner.
When is serverless is not the answer?
Some applications are poor fits for serverless applications. Sharing information across functions requires solutions like Redis or memcached, as there is no shared cache in Lambda. Likewise, loading information from databases, running authentication, etc., can create programs for serverless migration.
High numbers of concurrent executions can also be difficult, according to Berliner, as Lambda limits users to 1,000 concurrent executions by default.
Replacing components individually is the easiest migration path
Replacing components individually is the safest option for transitioning legacy applications to serverless. “Clients can’t wait for the entire ecosystem to be completed, and it can be really risky to launch a site that large anyway,” Berliner said, adding that this process also permits the introduction of development practices like DevOps, and that the small victories of migrating individual components provides quick feedback, and limited interruption to business processes.
Integrating serverless in an application is a useful step toward modernization. “I truly believe that every modern web application is better off by integrating serverless technology, even if not using it exclusively,” Berliner said. “Even if you’re just thinking about how you can move things to serverless, you’re going to get that immediate benefit.”
For more on serverless computing, check out “Why serverless has so quickly become mission critical for mainstream enterprises,” “How Puresec aims to safeguard serverless applications from cyberattacks,” and “AWS vs Microsoft Azure: Understanding the serverless application trend” on TechRepublic.