--- title: Sam Newman - Confusion In The Land Of The Serverless disqus: pierodibello --- ###### tags: `serverless` # Sam Newman - Confusion In The Land Of The Serverless There are many takes from Sam Newman about this talk. A couple are the following: * https://www.infoq.com/presentations/serverless-issues/ (one of the first take, took at CraftConf) * https://www.youtube.com/watch?v=aZlrv-0PE_c (one of the most recent takes) ## A definition of Serverless Serverless - five things a platform need to have to be serverless (see https://blog.symphonia.io/defining-serverless-part-1-704d72bc8a32) 1. [Requires no management of Server hosts or Server processes ](https://blog.symphonia.io/defining-serverless-part-1-704d72bc8a32) 2. [Self auto-scale and auto-provision, based on load](https://blog.symphonia.io/defining-serverless-part-2-8cc67bc0bdd8) 3. [The costs are based on precise usage](https://blog.symphonia.io/defining-serverless-part-3-f65856be4ade) 4. [Performance capabilities defined in terms other than host size / count](https://blog.symphonia.io/defining-serverless-part-4-587be1e64294) 5. [Implicit High Availability](https://blog.symphonia.io/defining-serverless-part-5-5452308de55c) Be warned on "high-availability" though: high availability of what? You don't have high-availability of all your solution/platform just because you use some components that provide high-availability out-of-the-box. Serverless is a form of PAAS, a most prescriptive abstraction of a PAAS ### Resiliency When one component is massively scalable and the other is not, you have a potential issue: **cascading failures** Typically, you would use protection patterns like **connection pools** or **circuit breakers**. **Connection pools**: throttles the number of clients going to talk to the db => load shedding How could I throttle functions? you can't, or better, you've to use api gateway How would you mix a sql db (e.g. mysql) into a serverless architecture? If you want all the solution to be highly scalable, you should use a BAAS (e.g. dynamodb, google big data), but mysql and dynamo are not semantic equivalent! So, what about **hybrid apps**? Can I build a highly resilient serverless app with an hybrid approach? probably not. **Circuit breaker** To integrate FAAS components with other non-serverless components you have to provide some sort of middleware to load-shedding the components that cannot transparently scale ``` lambda => circuit breaker: can I call downstream component? circuit breaker => lambda: ok, go lambda => calls the component ``` #### Mixing vendors? Is mixing vendors a good strategy to "spreading your eggs" => not so much => you got latency (es. BAAS google, frontend in lambda) #### Closing Serverless definition... Ignore the specific definition: the goal of a platform is making easy for you to focus on the job you're doing Serverless is a much better developer-friendly abstraction that allow to focus on the problems at hand