{"id":3675,"date":"2018-11-05T13:14:37","date_gmt":"2018-11-05T19:14:37","guid":{"rendered":"http:\/\/benincosa.com\/?p=3675"},"modified":"2018-11-05T13:14:37","modified_gmt":"2018-11-05T19:14:37","slug":"a-brief-history-of-on-prem-serverless-development","status":"publish","type":"post","link":"https:\/\/benincosa.com\/?p=3675","title":{"rendered":"A brief history of on-prem serverless development"},"content":{"rendered":"<p>My colleague <a href=\"https:\/\/twitter.com\/nerdguru\">Pete Johnson<\/a>, at Cisco has released <a href=\"https:\/\/blogs.cisco.com\/cloud\/examining-the-faas-on-k8s-market\">a blog <\/a>about a project called <a href=\"http:\/\/fonk-apps.io\/\">FONK<\/a>.\u00a0 I wanted to talk a little bit about why its important.<\/p>\n<h2>iOS Developers<\/h2>\n<p>Let&#8217;s first start back with the dawn of mobile application development.\u00a0 Pretend you are an iPhone developer back in 2008.\u00a0 You know Objective-C and you know how to make killer user interfaces and you make a fun game about dwarfs hunting butterflies. You release the game, the app is good, and you are happy.<\/p>\n<p>As the game gets bigger you realize you&#8217;d like to add features to make it so certain parts of the game are stored in the cloud.\u00a0 For example, you want to keep the all time highest score for all players who have ever played the game with their avatar name.\u00a0 Bragging rights are cool, and you want your game to be cool.<\/p>\n<p>The problem is, you don&#8217;t have any expertise in this.\u00a0 You know how to write Objective-C but you don&#8217;t know how to manage servers.\u00a0 In fact, you have probably never even installed an operating system in your life.\u00a0 So even though someone may be really good at spinning up VMs and putting NGINX on it and running some back end ruby on rails code, that is more hassle than you want.\u00a0 All you want is a backend that you don&#8217;t have to manage where the game can upload and retrieve all time highest player scores and display it.<\/p>\n<p>To do this, you know you want a place in the cloud that accepts a JSON POST request to send the highest score and you want to be able to put a GET request to get the highest scores.\u00a0 If you don&#8217;t know what POST or GET are, they are basic HTTP request methods.\u00a0 <a href=\"https:\/\/www.w3schools.com\/tags\/ref_httpmethods.asp\">Read more here<\/a>.\u00a0 You don&#8217;t want to manage servers, virtual machines, or even containers.\u00a0 (Also, containers don&#8217;t really get popular until 2014 so we are still 6 years away from that).<\/p>\n<h2>Backend-as-a-Service<\/h2>\n<p>What you want is a service.\u00a0 And in 2008 if we wait a little bit until 2011 then we start to see two cool solutions emerge for us:\u00a0 Firebase and Parse.\u00a0 Firebase was bought by Google and still lives on but Parse was bought by Facebook and closed down.\u00a0 Both of these two companies offered a Backend-As-A-Service for your applications.\u00a0 Really cool.\u00a0 Now you could just use their GUI and put in database calls and then call it with your mobile app.\u00a0 You didn&#8217;t have to learn about managing VMs and all that.\u00a0 It was great!<\/p>\n<p>The other thing that people start to realize is that it is good to accompany a mobile app with a web page.\u00a0 To make it consistent, it would be great if the webpage would call the same APIs as the mobile app.\u00a0 That way you only need to maintain one backend that both the web and mobile app can call.\u00a0 Great!\u00a0 How to do that?\u00a0 Remember we still don&#8217;t want to manage VMs, OSes, or even the stacks that run that.\u00a0 Well it turns out that AWS has offered us static web page hosting on S3.<\/p>\n<p>Static web page hosting on S3 doesn&#8217;t sound like something that would call APIs.\u00a0 But let&#8217;s understand what it is.\u00a0 Our dwarf game is now hiring a web developer who knows Javascript.\u00a0 When you visit a website that has javascript, the javascript doesn&#8217;t run on that site.\u00a0 Javascript runs on your browser.\u00a0 What happens is your browser goes to the URL and the URL gives you static HTML files.\u00a0 Some of those files are javascript, css, and html that execute on your browser.\u00a0 So we can actually host this in a public S3 bucket, point people to go there and they download the code.\u00a0 You get replication, durability, high availability and uptime for free!\u00a0 Still no VMs, no containers, no operating systems.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-3676\" src=\"http:\/\/benincosa.com\/wp-content\/uploads\/2018\/11\/backend-as-service-300x177.png\" alt=\"\" width=\"300\" height=\"177\" srcset=\"https:\/\/benincosa.com\/wp-content\/uploads\/2018\/11\/backend-as-service-300x177.png 300w, https:\/\/benincosa.com\/wp-content\/uploads\/2018\/11\/backend-as-service-768x452.png 768w, https:\/\/benincosa.com\/wp-content\/uploads\/2018\/11\/backend-as-service-1024x603.png 1024w, https:\/\/benincosa.com\/wp-content\/uploads\/2018\/11\/backend-as-service.png 1429w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<h2>Enter AWS<\/h2>\n<p>It is now 2014 and you are a smart person at AWS.\u00a0 You see this Backend as a service trend start to come and realize you could make some more money.\u00a0 You also notice that some of these backend as a service companies also call your own products like your databases.\u00a0 You&#8217;re also worried about the threat of Google and Facebook entering the market and taking more of your customers.\u00a0 What do you do?\u00a0 You build a backend as a service by stitching together your own services.\u00a0 The advantage you have at AWS:\u00a0 You already have some well known database services: RDS, DynamoDB, etc.\u00a0 You also own S3 and your customers are already using it for static pages.\u00a0 You also own API Gateway which allows you to call S3 services on the backend but it needs something a little more powerful.\u00a0 So how can you complete the picture?\u00a0 You introduce AWS Lambda.<\/p>\n<p>In December 2014 AWS introduced AWS Lambda and many people were puzzled by the idea of function as a service.\u00a0 What good was it for?\u00a0 Why would you want to call a function based on an event? If you keep in mind the entire architecture then you realize that AWS Lambda just completes the picture.\u00a0 No VMs, no containers, no operating systems.\u00a0 No expertise needed in running this.\u00a0 Just put code in their GUI and off you go.\u00a0 Since you already use S3 you can easily put your functions in AWS and you are golden.<\/p>\n<p>Let&#8217;s realize that this way of running applications is not the right way for every application.\u00a0 Remember our dwarf game is pretty simple.\u00a0 We just want to store the high score and get and receive it.\u00a0 We may chose to add user identities and logins later as well, and our app can handle that.\u00a0 But at some point if the complexity gets too much on the back end we&#8217;ll have to hire a backend engineer.\u00a0 But for now we can still run it all with javascript and put our backend on AWS lambda, API Gateway, and DynamoDB.<\/p>\n<h2>Kubernetes<\/h2>\n<p>In 2014 something happened that probably wasn&#8217;t meant to.\u00a0 <a href=\"https:\/\/kubernetes.io\/blog\/2018\/07\/20\/the-history-of-kubernetes--the-community-behind-it\/\">Google introduced Kubernetes<\/a> to the world and that was intentional.\u00a0 After all, nobody was using their cloud and they wanted to make people realize that they could use containers on their cloud better than anyone else.\u00a0 By open sourcing Kubernetes Google could make a splash and assert some dominance.\u00a0 That was intentional.\u00a0 But what wasn&#8217;t intentional was that when 2015 hit and Kubernetes 1.0 was released it actually started adding some parity between public clouds and private clouds.<\/p>\n<p>Let me explain.\u00a0 To have an AWS experience on Prem the best thing you could do was OpenStack or some other do it yourself project.\u00a0 OpenStack was pretty complicated, to put it nicely.\u00a0 There were very few orgs that successfully implemented OpenStack on prem and so many people kept migrating to the public cloud.\u00a0 Kubernetes has been so impactful that companies that have tried to resist or compete against it have thrown in the towel and embraced it.\u00a0 Check out the list:<\/p>\n<ul>\n<li>Google: Offered GKE, the initial cloud based kubernetes platform<\/li>\n<li>RedHat (now IBM): Completely threw away OpenShift PaaS code and built entirely on Kubernetes<\/li>\n<li>Pivotal: Had their own solution but now pushes PKS<\/li>\n<li>Azure: AKS Kubernetes offering<\/li>\n<li>Amazon: AWS who resisted and offered several different ways to manage containers (ECS, faregate, etc) finally offered native Kubernetes with EKS.<\/li>\n<\/ul>\n<p>Many of these organizations probably would have rather liked to own the solution but everyone is now a Kubernetes provider!\u00a0 The way of the PaaS is dying.\u00a0 They are morphing into opinionated Kubernetes services.<\/p>\n<p>But the biggest impact of all, to me, was that it started giving parity between public clouds and private clouds.\u00a0 The same Kubernetes platform that runs on AWS, GCP, Azure, PKS, could be run on your own data center on\u00a0 your own bare metal servers.\u00a0 You just leveled the playing field and made it easier for me to bring my apps back on prem.\u00a0 (If I wanted to, but of course why would I?)\u00a0 Well for the dwarf game developer, I have no need to go back on prem.\u00a0 But if I&#8217;m a big enterprise with lots of space in my datacenter, this might look interesting.<\/p>\n<p>Kubernetes is simple to install, and much easier to manage than OpenStack, but still has its challenges.\u00a0 However, as enterprises mature, perhaps it won&#8217;t be so bad?\u00a0 After all there are solutions now from vendors including Cisco that offer Kubernetes with enterprise support.<\/p>\n<h2>FaaS, Object Storage, NoSQL, Kubernetes<\/h2>\n<p>Back to the mobile app world.\u00a0 When AWS lambda came out some people made a framework called serverless (check out serverless.com).\u00a0 People thought this whole function as a service thing was pretty rad.\u00a0 But now what makes it radder is we have\u00a0 a solution to run it on our own data centers using just Kubernetes.<\/p>\n<p>I worked with Pete a little on his FONK project by submitting some code samples for the Guestbook app running on Kubeless.\u00a0 For a developer to not have to worry about creating Dockerfiles, Kubernetes YAML files, and being able to just write code and get it working it is very appealing.\u00a0 This serverless business is still pretty cutting edge and even though we are 3 years from when AWS came out with Lambda, there is still a lot of buzz about it and people jumping into the space.\u00a0 What I like about FONK is that it levels the playing field between what I can get on public clouds and private clouds.\u00a0 Certainly many people would argue that using a private cloud is the only way to go, but I see great dangers in this.<\/p>\n<ol>\n<li>\u00a0I am not comfortable with a company as big as Amazon making even more money off of me and holding me hostage.\u00a0 I know they are good. I&#8217;ve used their stuff. I just don&#8217;t<\/li>\n<li>At a certain scale it is more cost effective to run kubernetes on prem than running in any public cloud. Granted you must have the expertise<\/li>\n<li>I can get better performance on my own datacenter.\u00a0 Sure if I have to burst, public cloud is great.\u00a0 But for chugging apps, I like my on prem stuff.<\/li>\n<\/ol>\n<p>You can entirely disagree with me and you could be right.\u00a0 But just remember, in engineering it is always about tradeoffs.\u00a0 It&#8217;s not wrong or right.\u00a0 It&#8217;s what tradeoffs do you want.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My colleague Pete Johnson, at Cisco has released a blog about a project called FONK.\u00a0 I wanted to talk a little bit about why its important. iOS Developers Let&#8217;s first start back with the dawn of mobile application development.\u00a0 Pretend you are an iPhone developer back in 2008.\u00a0 You know Objective-C and you know how&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/3675"}],"collection":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3675"}],"version-history":[{"count":1,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/3675\/revisions"}],"predecessor-version":[{"id":3677,"href":"https:\/\/benincosa.com\/index.php?rest_route=\/wp\/v2\/posts\/3675\/revisions\/3677"}],"wp:attachment":[{"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benincosa.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}