To Serverless or Not To Serverless

No managing servers manually

Forces your code to be stateless

Easy to scale up and down

Steady state scaling

Peak scaling

  1. You simply have enough servers to handle peak load. This is the naive solution, where you simply overprovision servers to such a degree that you’re able to handle these spikes in traffic. This works brilliantly, but depending on your volume and how large your spikes are, is potentially very expensive
  2. You provision extra servers when you know you’re going to have spikes. This is possible, if you know that e.g. you’re going to have a fire sale, or you’ve sent out a newsletter. It requires a lot of manual work though and is error prone. What if someone forgets to provision more servers, right before a big sale and everything goes down?
  3. Other auto-scaling solutions, like Kubernetes Horizontal Pod autoscaling, or Azure Autoscale where you specify some metrics, like response time or CPU usage, and you then scale on those. This is usually a fine solution, but it requires you’re on a technology stack where you have access to some of those capabilities.

Lots of bindings

[FunctionName("EventHub2EventHub")]
public static async Task Run(
[EventHubTrigger("source", Connection = "EventHubConnectionAppSetting")] EventData[] events,
[EventHub("dest", Connection = "EventHubConnectionAppSetting")]IAsyncCollector<string> outputEvents,
ILogger log)
{
foreach (EventData eventData in events)
{
// do some processing:
var myProcessedEvent = DoSomething(eventData);

// then send the message
await outputEvents.AddAsync(JsonConvert.SerializeObject(myProcessedEvent));
}
}

Cost model is different

High availability

Testing

  1. Extract the logic into its own module or function
  2. Make the actual function code a very thin wrapper around the function
  3. Test only the function

Vendor lock-in

Monitoring is harder

Maturity

Loss of control

It’s a different skill set

Caching is harder

--

--

--

Software Developer at SCADA Minds

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Why is project`s technical specification so important?

CS371p Spring 2020: Varshika Pichela

Anycast Stateless Services with NSX-T, Implementation

What is the best programming language to learn?

Practical SOLID in Golang: Open/Closed Principle

12 Time-Saving Python Tricks Every Developer Must Know

Photo by John Schnobrich on Unsplash

A Discussion on Data Structures — Queues

Compare Two Unlike Record Collections in Flow

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gustav Wengel

Gustav Wengel

Software Developer at SCADA Minds

More from Medium

10 Mistakes I’ve Made in My Software Designs (Part 2 Of 2)

Software Documentation is Software

How to make software architecture trade-off decisions

A Technical Approach Document teardown