It's easy to be befuddled about "serverless" or "function as a service" architectures. For one, "serverless" is a bit of a misnomer -- thereare servers, but you don't have to maintain them. All you do is upload a snippet of code and let the hosting service handle the rest.
Butwhat sorts of applications are suited to this kind of deployment? The answers tend to be the same whether you're dealing withAWS Lambda or Azure Functions; the designs of those systems all depend on blocks of code triggered by specific actions. Here are five common kinds of apps built out of such pieces.
This is one of the simplest and most direct applications for a serverless architecture: creating REST APIs that return data to be consumed by either another service or by a single-page application.
REST APIs in general are not hard to build. Most of the time, all you need is a basic web framework, a library for rendering data in the format you're returning (typically JSON), and whatever glue code is needed to talk to the back end from which you're pulling data.With a serverless architecture, the developer can focus exclusively on writing and deploying the code needed to serve the API, and not be distracted by much else.
Many common functions that need hand-tuning in a REST API, like autoscaling to meet demand, are addressed automatically by serverless frameworks. Plus, the pay-what-you-use model that's become the staple of cloud pricing means a lightweight, minimally accessed API costs next to nothing to deploy.
This widely adopted mechanism of callbacks over HTTP is a common strategy to implement push, pipes, and plugins -- all of which increase the utility of web applications. Serverless frameworks are particularly well suited for webhooks for the same reason they're useful for creating APIs generally: low overhead, minimal maintenance, automatic scaling. For example, a webhook can be implemented on Azure Functions with Node.js to process SMS messages or phone calls through the Twilio service.
What's more, most webhook-type actions don't need a lot of code to get to work. Thus, they're ideal for thefunction-oriented approach provided by a lambda-style serverless setup and less likely to outgrow such a delivery mechanism.
Serverless architectures also provide a straightforward method to serve up static content: images, audio, or HTML pages that aren't modified by an application.Static assets can be stored on a number of back ends, including an Amazon S3 bucket, and be accelerated through a geolocated cache, such as Cloudflare. (If you're using S3, it's possible to choose Amazon Route 53 to map URLs to specific resources; AWS Lambda itself isn't even needed for these rudimentary cases.)
Again, the big advantage is that each piece of the puzzle automatically scales to fit demand.It's also relatively easy to add dynamic functionality over time if needed. However, with this approach, spin-up time for the function might impact performance, so geocaching becomes more useful.
Think of this as a combination of the above approaches. The basic assets for a page can be served as static content; to render data on the front end,the necessary API calls can be implemented as serverless functions. Rendering of data happens on the front end via a JavaScript framework.
Upside: Each separately served element of the application can scale independently. Downside: The app has to be implemented as a collection of disparate functions rather than a single unified project, though this shouldn't be much of a hurdle for anyone using modern source control and project management techniques. Also, you'll need to implement a front-end framework like React, Angular, or Vue.js -- but again, any self-respecting web developer should already have at least one of them.
Serverless apps run in response to events, but nothing says an event has to be a HTTP request. It could be an event or a message piped in from a cloud service or triggered to run on a schedule -- a convenient method to perform passive or low-priority functions. For example, an image uploaded to an S3 bucket could trigger a function that causes the image to be labeled with appropriate metadata, resized, and cropped based on feedback from an image recognition or analysis API.
The most consistent detail about working with serverless frameworks right now is that they involve creating loosely coupled components -- microservices, for lack of a better word.If the app you have in mind doesn't lend itself to being composed in this manner or if you're trying to port a monolithic app that will be difficult to pull apart and rework, don't shoehorn a serverless setup into that role. Build new, little elements, and grow them from there.
View post:
Build 'em now! 5 uses for serverless frameworks - InfoWorld
- Mind uploading - 01 - November 8th, 2009 [November 8th, 2009]
- Mind uploading - 02 - November 8th, 2009 [November 8th, 2009]
- A new way to battle Mexican drug cartels - KLTV - March 8th, 2010 [March 8th, 2010]
- Mobile Health Screening Units Visit Lowe's Workers - International Supermarket News - March 8th, 2010 [March 8th, 2010]
- The quintessential sewing machine - Business Mirror - March 8th, 2010 [March 8th, 2010]
- The Future of Windows - Technologizer (blog) - March 8th, 2010 [March 8th, 2010]
- SEO Press Release Distribution Site Online PR News Celebrates 10000 Active Users - Online PR News (press release) - March 8th, 2010 [March 8th, 2010]
- Utilizing Online Mailing Services – Make the Most of Direct Marketing - RisMedia.com (press release) - March 8th, 2010 [March 8th, 2010]
- Carr's first look at 'Extreme' home - KLTV - March 8th, 2010 [March 8th, 2010]
- Should you advertise on iPhones? - Smart Company (blog) - March 8th, 2010 [March 8th, 2010]
- Review: Mega Man 10 - Destructoid - March 8th, 2010 [March 8th, 2010]
- Had I World Enough, and Time - Institute for Ethics and Emerging Technologies - March 8th, 2010 [March 8th, 2010]
- Unicast Continues Innovative Technology Enhancements With Latest Release of ... - CNNMoney.com (press release) - March 16th, 2010 [March 16th, 2010]
- Facebook scouts for 'passionate' India head - Economic Times - March 16th, 2010 [March 16th, 2010]
- SXSW: YouTube Launches Partner Program for Indie Bands - Wired News - March 17th, 2010 [March 17th, 2010]
- Wider Still and Wider! - Bangkok Post - March 17th, 2010 [March 17th, 2010]
- P2P Versus The World - Rampage - March 17th, 2010 [March 17th, 2010]
- Yakuza 3 - The MMOMFG Review - MMOMFG (blog) - March 17th, 2010 [March 17th, 2010]
- Behind the musings: The annotated high schools column - Chicago Tribune (blog) - March 17th, 2010 [March 17th, 2010]
- Jihad Jane, YouTube, and Me - David Horowitz's NewsReal Blog (blog) - March 17th, 2010 [March 17th, 2010]
- Justin Bieber Releases 'U Smile,' Announces Summer Tour Dates - MTV.com - March 17th, 2010 [March 17th, 2010]
- FCC announces National Broadband Plan - VentureBeat - March 17th, 2010 [March 17th, 2010]
- Image hosting on the cheap: a look at three free services - Ars Technica - March 17th, 2010 [March 17th, 2010]
- Content Management: Secrets of the Trade - Formtek Blog (blog) - March 17th, 2010 [March 17th, 2010]
- FCC's National Broadband Plan: There is a dark side - ZDNet - March 17th, 2010 [March 17th, 2010]
- 5 Reasons Old Media Should Buy Facebook - AllFacebook (blog) - March 17th, 2010 [March 17th, 2010]
- "Steal It" and Other Internal YouTube Emails from Viacom's Copyright Suit - Fast Company - March 19th, 2010 [March 19th, 2010]
- Now cafes in monument premises for tourists during CWG - Sify - March 19th, 2010 [March 19th, 2010]
- Google-Viacom court papers leave a lot to the imagination - FierceOnlineVideo - March 19th, 2010 [March 19th, 2010]
- FCC's broadband plan: A possible dream - Washington Post (blog) - March 19th, 2010 [March 19th, 2010]
- The Importance of Using Social Networking for Business; Part I – Facebook - IPWatchdog.com - March 19th, 2010 [March 19th, 2010]
- Recording YouTube Videos - Acoustic Guitar - March 19th, 2010 [March 19th, 2010]
- Who's using location-based social networking? - KC Free Press - March 20th, 2010 [March 20th, 2010]
- iPhone will continue to beckon BlackBerry owners - CNET - March 20th, 2010 [March 20th, 2010]
- Rain leaves its mark on Azalea Trail events - KLTV - March 21st, 2010 [March 21st, 2010]
- Viacom v. YouTube/Google: A Piracy Case in Their Own Words - DailyFinance - March 21st, 2010 [March 21st, 2010]
- Getting a look at next high-tech | Philadelphia Inquirer | 03/22/2010 - Philadelphia Inquirer - March 22nd, 2010 [March 22nd, 2010]
- Sprint chews on Apple while lauding 4G Overdrive hotspot - The Tech Herald - March 22nd, 2010 [March 22nd, 2010]
- 'Repo Men' contest -- the nationwide chase is almost over - Los Angeles Times (blog) - March 22nd, 2010 [March 22nd, 2010]
- Viacom vs. YouTube/Google: A Piracy Case in Their Own Words - DailyFinance - March 22nd, 2010 [March 22nd, 2010]
- These iPhone apps will help make March Madness a little more sane - Appolicious - March 22nd, 2010 [March 22nd, 2010]
- Eye-Fi Pro X2 cards have arrived, and you probably want one - tuaw.com (blog) - March 23rd, 2010 [March 23rd, 2010]
- Pharmacist shows who wins, loses with health care bill - KLTV - March 23rd, 2010 [March 23rd, 2010]
- High-Tech Texts! - The Campus Slate - March 24th, 2010 [March 24th, 2010]
- CTIA WIRELESS 2010: Samsung's New Galaxy Brings 4" AMOLED Screen, Social Hub ... - Marketnews.ca - March 24th, 2010 [March 24th, 2010]
- Google must follow Chinese rules or leave - China Daily - March 24th, 2010 [March 24th, 2010]
- Jay-Z Short Documentary 'NY-Z' Premieres Online - MTV.com - March 24th, 2010 [March 24th, 2010]
- DAs clash over Mineola sex ring appeal - KLTV - March 25th, 2010 [March 25th, 2010]
- iSilo for iPhone - BusinessWeek - March 26th, 2010 [March 26th, 2010]
- Questions Abound as "New START" Agreement is Completed - Global Security Newswire - March 26th, 2010 [March 26th, 2010]
- What will Apple do next in mobile services? - Mobile Entertainment - March 26th, 2010 [March 26th, 2010]
- How much is too much to pay for health care? - Anchorage Daily News - March 27th, 2010 [March 27th, 2010]
- The Future of Smartphones: 4G and Beyond - Entrepreneur - March 27th, 2010 [March 27th, 2010]
- Uploading and uplifting: sharing big data files - Earthtimes (press release) - March 28th, 2010 [March 28th, 2010]
- Verizon Blasts 'Outdated' FCC Broadband Plan - NewsFactor Network - March 28th, 2010 [March 28th, 2010]
- Web Host Layered Tech Offers Mezeo-Powered Cloud Storage - Web Host Industry Review - March 29th, 2010 [March 29th, 2010]
- Dropbox: Now one more reason to want a Nexus One - ZDNet (blog) - March 30th, 2010 [March 30th, 2010]
- Exaflood: Politicians Prop Up Dinosaurs, Ignore Cutting Edge Technology - NewsBlaze (press release) - March 30th, 2010 [March 30th, 2010]
- Instructions - Washington Post - March 30th, 2010 [March 30th, 2010]
- Uploading for Life Extension Will Be Valid - Institute for Ethics and Emerging Technologies - March 31st, 2010 [March 31st, 2010]
- 'Glee's' MySpace Auditions: What Not To Sing - Wall Street Journal (blog) - March 31st, 2010 [March 31st, 2010]
- Memeo iPad Reader: Like the GDrive on your iPad (only different) - ZDNet (blog) - April 1st, 2010 [April 1st, 2010]
- Why are pipe bomb 'how to' videos legal? Answer is alarming - KLTV - April 1st, 2010 [April 1st, 2010]
- Trip to Haiti inspiration for East Texas teen - KLTV - April 1st, 2010 [April 1st, 2010]
- Jason Kilar Leads Hulu To Profitability, But Will He Stay On At Hulu? - TVbytheNumbers - April 2nd, 2010 [April 2nd, 2010]
- Layers for IPad Adds Online Gallery, Pro Options - PC World - April 2nd, 2010 [April 2nd, 2010]
- Shane Dawson, YouTube's Comic for the Under-30 Set - New York Times - April 2nd, 2010 [April 2nd, 2010]
- Hands-On With the Apple iPad — and Your Questions - Wired News - April 4th, 2010 [April 4th, 2010]
- FedEx Simplifies International Shipping with FedEx Electronic Trade Documents - MarketWatch (press release) - April 6th, 2010 [April 6th, 2010]
- Cacoo Lets Multiple Users Create Designs Collaboratively And In Real-time - TechCrunch (blog) - April 7th, 2010 [April 7th, 2010]
- Comcast: Your New Overlord - ITworld.com - April 7th, 2010 [April 7th, 2010]
- Bloggers Photograph Food, We Get Hungry - Switched (blog) - April 7th, 2010 [April 7th, 2010]
- Apple suggests only the iPhone can fingerprint songs - Geek.com - April 7th, 2010 [April 7th, 2010]
- Senior with mental challenges killed along highway - KLTV - April 7th, 2010 [April 7th, 2010]
- Book a Cruise and "Flip" Over a Free Camcorder - CruiseCritic.co.uk - April 8th, 2010 [April 8th, 2010]
- Creation Myths: what the argument that the iPad's not for creating content ... - Huffington Post (blog) - April 8th, 2010 [April 8th, 2010]
- Want market share? Make a brain claim - Marketing Web - April 8th, 2010 [April 8th, 2010]
- 10 Ways World of Warcraft - OUPblog (blog) - April 8th, 2010 [April 8th, 2010]
- Check-in to Foursquare: Latest social media service lands in SW Florida - Naples Daily News - April 8th, 2010 [April 8th, 2010]
- Apple iPhone OS 4 Announcement Makes Users Feel "Finally!" - HULIQ - April 8th, 2010 [April 8th, 2010]