THREAD: A good practice is for each AWS Lambda function to do one thing rather than bundle all functionality into one function.

Why?
A quick answer is that the smaller the Lambda function, the faster it will load and the quicker it should run (depending on libraries etc), but that's very simplistic
Let's take a slightly more businesslike view of #serverless
A better answer is that making each Lambda function do only one thing improves both your feature velocity and your ability to apportion development resource
Say you have 10 Lambda functions. One function runs on average for 10 seconds and has 1GB of memory.
Say another of those 10 Lambda functions runs on average for 500ms and has 512MB of memory.
Which do you optimise first? Actually, you don't have enough information to answer that.
Let's say that the 10s/1GB function is equivalent to 1% of the monthly cost of the 500ms/512MB function.
Which do you optimise now?
The 500ms/512MB function of course. The one that looks least optimised *from a code point of view* is actually almost an irrelevance in your business model.
If you bundle all your functionality into one function, you lose the ability to optimise like this as easily because you can't simply equate development effort to business value
I mean, you could split out via metrics, but it wouldn't be anywhere near as clear or straight forward
This is what it means when the #serverless model should impact on your development practices and behaviours
There is almost zero business impact and value in optimising code that is doing it's job and not impacting the bottom line
How often does a developer refactor code? Can you point to whether that refactoring is actually of value to the business or not?
It's perfectly reasonable to have ugly code in a Lambda function, that runs infrequently as part of your stack for a long period of time. If it isn't broken, then don't fix it.
Another aspect to consider is that if your Lambda code is ugly, but is only doing one thing, then it stands to reason that it'll be easier to fix, or rewrite at a later date, even if it's a new developer doing it - it's not impacting elsewhere
Ugly code in a monolithic/larger code base can cause major issues. This is how technical debt can become accumulated over time.
This is why you should separate out your #serverless functionality into multiple functions.
This is why CIOs/CTOs/CFOs should be really excited by #serverless because it can allow you to focus your development effort on areas that can immediately impact a bottom line /THREAD

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Paul Johnston 🌍 need: NED, advisory, consulting

Paul Johnston 🌍 need: NED, advisory, consulting Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @PaulDJohnston

Sep 7, 2018
There's a whole lot of people online saying they still look things up or make stupid mistakes when coding after X years in tech.

I definitely still do. I'm not perfect. Documentation is important. I look up stuff that is easy all the time. I make really dumb mistakes.
But I've also spent over 20 years coding in multiple different languages and doing various different roles.

I haven't always been someone that writes code.

Writing code is not what I do that adds value.
Someone who writes python or go day in and day out should remember a lot of python stuff because it'll become second nature.

But I wouldn't expect them to be able to walk into a board meeting and explain the product roadmap to an investor either.
Read 8 tweets
Aug 18, 2018
Thread: My wife was at the supermarket today picking up some bits and pieces and she got chatting to the young guy at the checkout.

They had a chat...
He had decided after school not to go to University and had been working there for a couple of years but was excited now because he was about to go.
He'd looked at the options after school and seen it as something that wasn't for him. But having worked for two years he decided that the job options weren't that good so decided to look again.
Read 13 tweets
Aug 14, 2018
Gave my Dad an echo dot yesterday. He has macular degeneration and I thought it might help. Installed a big company's skill for him to help with trains (my parents can't drive any more) and watched the interaction.

It was terrible.

Sometimes tech just doesn't get it
I completely understood the interaction and the questions.

A 70+ yr old?

He asked a perfectly reasonable question about when the next train from X to Y was and the response was

"Do you want to plan a journey?"

Which was a bit confusing because he'd just said that
There was no "I didn't quite understand" or anything like that.

Our voice interactions should default to "my fault... Didn't understand... Sorry" and not respond with questions that seem confusing

If the person says "I just said that" then you've got it wrong
Read 4 tweets
Jul 16, 2018
THREAD:

So, let's have a quick chat about CI/CD and #serverless.

This will be more "overview" than in depth (it's twitter after all)
CI and CD* are not the same thing

*and there are 2 types of CD
CI is Continous Integration

When multiple developers are working on one project, at some point they have to come together and combine their efforts...

...therefore Integration

And that happens continuously over a project
Read 21 tweets
Jun 23, 2018
Well, Germany are rubbish this year #WorldCup #GERSWE
Spoke too soon. Sweden are trying very hard to lose #WorldCup #GERSWE
Like REALLY hard #WorldCup #GERSWE
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(