DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Build a Twitter Leaderboard App With Redis and AWS Lambda (Part 2)
  • Use Lambda Function URL To Write a Serverless App Backed by DynamoDB
  • Visually Designing Views for Java Web Apps
  • Setting up Kubernetes Master and Worker Node on Amazon Web Service (AWS)

Trending

  • How to Perform Custom Error Handling With ANTLR
  • How to Use AWS Aurora Database for a Retail Point of Sale (POS) Transaction System
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • How to Introduce a New API Quickly Using Micronaut
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Serverless Web Apps With Knative Compared to AWS Lambda

Serverless Web Apps With Knative Compared to AWS Lambda

Want to know the different between Knative and AWS Lambda?

By 
Michael Neale user avatar
Michael Neale
·
Apr. 26, 19 · Opinion
Likes (3)
Comment
Save
Tweet
Share
17.1K Views

Join the DZone community and get the full member experience.

Join For Free

This post originally appeared on LinkedIn and has been updated since.

It’s hard to not be overwhelmed with the hype around serverless; the term seems to be constantly redefined to mean almost anything. I wanted to look at how easy it would be to do a serverless web app (which is to say: an app that responds to HTTP requests and does some work, and when there isn’t work to be done, scales down to zero cost).

I previously wrote about using AWS Lambda (best known for being Function as a Service) after a Friday afternoon exploring it. The experience was a little frustrating at first because of the components needed (I won’t flesh out the details again, but please note the linked blog has a video with some strong, but amusing language). The end result was great, of course, which is what counts.

After Lambda, I wanted to kick the tires with Knative, a project recently launched by Google (and Pivotal I would add, which joined up with them to bring their FaaS work along for the ride).

My goal, similar to my AWS Lambda experiment, was to see how quickly I could get to “Hello World” using the off-the-shelf tools and examples (i.e. nothing exotic). Being a tiny bit familiar with GKE (Google’s Kubernetes engine thing) I thought it made sense.

The steps I took were pretty simple:

  1. Followed the step-by-step guide for setting up Knative and a cluster (I expect one day that will be out of the box)
  2. Made sure the Node.js sample app, worked (I added the IP address to my /etc/hosts so I could use a browser to test out without DNS shenanigans)
  3. Checked to see if the Spring Boot sample worked with heavier things like the JVM
  4. Ensured the pods would scale down to zero by running “kubectl get pods” to check that after a minute or so, there was nothing running. This last step is not really needed, but I wanted to satisfy myself. Running an app (via curl, or visiting in a web browser) would wake it up again, of course!

What this left me with was a couple of trivial web apps that scale to zero pods when not in use and wake-up when needed. This, I guess, is the heart of serverless. Of course, these specific examples assume the developer knows a little about containers, so this isn’t Function as a Service, although that is coming (check out Project Riff). However, to most developers, this would be very, very comfortable and familiar. AWS Lambda recently included support for things like express.js on top of Lambda+API Gateway, which, to me, is a strong signal that there is a demand for building apps with familiar frameworks but deploying them via serverless patterns.

Note I didn’t mention Istio or any of that stuff as part of this; sure, it is in there doing magic, but I don’t really care about that. The service mesh is important, but it isn’t the point of serverless. I think this is the future of how web apps should be deployed, unless they have a good reason to be running all the time due to workload. Knative-serve for Kubernetes should be the way web apps (at least) are run. This is just software now.

I found this was far quicker for me than working out Lambda (in terms of getting to Hello World), and included setting up a cluster from scratch and installing a bunch of stuff (Kubernetes does make it easy to “install” things, it really does feel a bit like an operating system). I would expect in the near future for cloud providers to bake this in, saving even more steps.

The Knative project as launched really has two main components:

  1. Knative-serve: Which as outlined above, I tried.
  2. Knative-build: Its job is to take the source and make containers and Knative deployments out of it. This is also required for the Function as a Service experience to be similar to things like AWS Lambda.

On the Knative-build side, this was largely the source of the Tekton project (now part of the Continuous Delivery Foundation). There is a lot of work happening that is building great stuff on top of Knative-build/Tekton, and this is I think where a lot of future innovation will happen. I would recommend tracking Jenkins X to see what they do with Tekton as I know they are using it.

Knative is certainly a really important project to keep an eye on if you are in the Kubernetes world and curious about serverless ideas. Of course, AWS Lambda (and the AWS suite of serverless.. uh… services) has a huge edge in scale and ability to put functions on all sorts of events that will ensure it has enduring popularity.

There are many examples of Knative Serving sample applications, including a great one showing auto-scaling in action. You could almost think of Knative-serve as auto scale done right, and right out of the box. I also recommend checking out pragmatic walkthroughs of Knative by my buddy Dr. Nic.

Additional Resources

  • Read about Kubernetes and serverless
  • Watch a webinar on serverless Jenkins with Jenkins X
  • Download an eBook on building cloud-native apps
AWS app AWS Lambda Web apps Web Service Kubernetes

Published at DZone with permission of Michael Neale, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Build a Twitter Leaderboard App With Redis and AWS Lambda (Part 2)
  • Use Lambda Function URL To Write a Serverless App Backed by DynamoDB
  • Visually Designing Views for Java Web Apps
  • Setting up Kubernetes Master and Worker Node on Amazon Web Service (AWS)

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!