|A Q & A with Peter Sbarski
Learn more about serverless architectures in this interview with Peter Sbarski, author of Serverless Architectures on AWS, Second Edition.
Peter Sbarski is a Computer Science PhD and the Lead Architect at Kiandra IT, a Melbourne-based, 80-developer consulting group. He is VP Engineering at A Cloud Guru, a successful startup. He’s had an extensive career working with prominent Australian IT companies, and has lead teams across large enterprise solutions with a focus on web and AWS cloud technologies. Peter’s specialties include backend architecture, microservices, and orchestration of systems.
Jump into any page of the book from the table of contents on liveBook!
Lynn: You developed acloud.guru using AWS Lambda and a serverless approach. Why did you decide to do it that way?
Peter: A Cloud Guru was started by Ryan and Sam Kroonenburg, and Anthony Stanley as a platform for IT engineers to prepare for AWS associate and professional certification exams. It has since grown in to a vibrant community of like-minded peers with over 40,000 students taking courses on a variety of subjects focused around cloud and AWS.
One of the initial drivers behind the platform was the need to launch it as quickly as possible while still being able to scale and support tens of thousands of users. The team wanted to have a low cost base and leverage much of the existing cloud infrastructure to deliver an exceptional, near real-time, experience to their users.
A serverless approach was chosen because it addressed the team’s requirements better than other technologies. The first version of the platform was launched within a month and it has since grown to accommodate many thousands of users streaming videos lectures, participating in the forums, and learning about cloud. We have been able to innovate and add additional features very quickly. Our platform scales exceptionally well and the overall hosting bill is less than $USD200 per month.
Lynn: Tell us two stories: How would the project have gone (time, cost, staff), if you did it the “traditional” way? And how did it actually go?
Peter: The team that works on A Cloud Guru has many years of experience building web and mobile applications. We have always built applications in a traditional way using servers that would run our server-side software, process requests, talk to other services, and interact with the database. Server management, patching, maintenance, upgrades, configuration have always been a necessary part of the work we have had to do. The emergence of Platform-as-a-Service and containerization made things easier but even then we found that too much time was spent on things that didn’t deliver a direct business benefit.
Traditional design often leads you to certain architectural choices that can make things slower. A lot of web and mobile applications are written as monolithic systems that make changes to the system (and deployment) very hard to do. The emergence of microservices architecture has alleviated that pain to some extent. However, it has also introduced other complexities. In a lot of cases there are now more servers to manage and more things to think about. Serverless architecture takes away the need to think about infrastructure completely. Your code executes in an elastic compute service that is managed by someone else, leaving you to focus on solving your core business problem. Furthermore, we found that we needed to write a lot less code to do what we needed. Less code meant we could move quicker and have a much more robust system.
Another aspect of serverless design is its implicit push to do less. If there is a service that already does something well then adopt it rather than implement the functionality yourself. We’ve developed extensive pipelines that perform operations such as push-based video transcoding, searching and indexing, data processing, and analytics. These use a mix of available services, APIs, and custom Lambda functions to orchestrate events that would have taken weeks to develop using a more traditional approach.
Lynn: Tell us about the book you’re writing for Manning.
Peter: Modern Serverless Architecture is for architects and developers who want to understand how they can build high-performing, low-cost, scalable, and easy to understand backend systems using a serverless approach.
AWS Lambda and API Gateway have been the defining technologies in making serverless architecture viable for many applications. This book describes how to use Lambda, API Gateway, and other services to build real-world systems. The book itself covers many topics apart from Lambda and the API Gateway including authentication and authorization in a serverless environment, devops, databases and storage, orchestration of events, message pipelines, and much more. The book describes how to build an end-to-end system so that readers can use it as a reference when they build their serverless application or refactor a traditional system to introduce serverless components.
This book leans on our practical experience of building the A Cloud Guru platform and shows the reader how to make the most of serverless, and avoid common pitfalls.
The topic of serverless architecture is going to get a lot of attention in 2016 and beyond so IT professionals need to understand what it is, what the benefits are, and how they could use it to reduce costs and build next-generation applications.
Lynn: What do you need to know to build a serverless application?
Peter: Serverless architecture is exciting as it promises to boost developer effectiveness and reduce costs. However, as with any technology, each architect needs to make a determination if it is suitable for her or him. Compute services such as Lambda run in a public cloud with all the resulting pros and cons of that.
Costs also need to be calculated for each use case. With A Cloud Guru, the costs are minimal, which makes Lambda and other services and APIs cost-effective. In a different application, however, the cost equation may be different. There are also limitations to Lambda and the API Gateway that may affect your application. These may not be show-stopping problems but it is vital to know what these limitations are and to plan ahead. Modern Serverless Architecture deals with all these considerations and helps to understand how and when to leverage serverless architecture.
Having done the necessary background work with regards to pricing and capability, developers and architects should try to actually build something. Hands-on experience is often the best way to learn and understand technology. We find that once developers understand the principles of event-driven architecture and learn more about Lambda – they become serverless advocates themselves.
Finally, before serious work can start, any team adopting serverless must consider how they would do testing, continuous integration and deployment. Having a DevOps pipeline is a must-have for any non-trivial system. Managing multiple functions, credentials and secrets, APIs, and environments by hand is an overwhelming task. Therefore, a good DevOps system must be put in place before development starts.
Lynn: This is an emerging market, and therefore it’s probably changing fast. What things—technologies, trends, people, sites, frameworks, etc.—should developers be watching to keep on top of it?
Peter: Serverless is an emerging market that’s moving very fast. There are modules, libraries, and frameworks being developed right now. Perhaps the leading framework at the moment is, somewhat confusingly, called serverless (formerly known as JAWS). This framework aims to help organize, deploy, and test Lambda functions and the API Gateway. The other framework worth having a good look at is Apex.
As a team we’ve created npm modules to help with serverless development and we aim to do a lot more in the open source space. Manning also has a book in MEAP that covers AWS Lambda, AWS Lambda in Action, and we often blog about our serverless adventures at https://read.acloud.guru.
Lynn: What are the top reasons I should care about serverless?
Peter: Here are some reasons:
- Serverless architecture allows developers to focus on code and their business problem rather than spending time looking after backend infrastructure.
- Serverless architecture can help developers build scalable, high-performing, and cost-effective applications quickly. Want to write autonomous microservices? Serverless is perfect for that.
- Serverless applications can grow, scale, and evolve naturally. Developers do not have to worry about low-level detail, ever.
- Traditional architecture requires servers that do not necessarily run at full capacity all of the time. Serverless can be much more granular. With Lambda you only pay for what you use.
- Serverless architecture allows for reduction in the amount of layers and code that one finds in a monolithic application. How does it work? Modern Serverless Architecture has the answers.
Peter Sbarski is VP of Engineering at A Cloud Guru. He’s had an extensive career working with prominent Australian IT companies, and has lead teams across large enterprise solutions with a focus on web and AWS cloud technologies. Peter’s specialties include backend architecture, microservices, and orchestration of systems.
Peter has a keen interest in and passion for cloud technologies and the emerging subject of serverless architectures. He holds a Bachelor of Computer Science with First Class Honours and a PhD in Computer Science from Monash University, Australia.