Yan Cui Profile picture
Aug 11 12 tweets 13 min read
Serverless is great, but it's not a free lunch.

The "serviceful" mindset means you'll need to learn and use many services in your architecture. Having the right tool to help you along can make a world of difference. And here are 7 of my favourites.
Serverless IDE is a VSCode extension that will save you countless hours when you work with CloudFormation, AWS SAM or the Serverless Framework.

Auto-completion, schema validation, CF docs on hover, and many more.

marketplace.visualstudio.com/items?itemName…
IAM Legend by @TastefulElk is another great VS Code extension and takes the chore out of writing IAM statements.

Follow security best practices and do IAM role per function? This will save you hours of looking up IAM docs.

marketplace.visualstudio.com/items?itemName…
@TastefulElk You probably heard about Dynobase already, by @rafalwilinski.

It's by far the best client for DynamoDB, and makes it easy to manage tables across accounts & regions, plus tools for data modelling and importing/exporting data too.

dynobase.dev
@TastefulElk @rafalwilinski Love EventBridge? Then check out @lajacobsson's evb-cli.

I love the guided workflows for creating event patterns and input transformers, and it has a unique ability to replay archived events in ORDER (btw, #awswishlist for this to be part of the service)

github.com/mhlabs/evb-cli
@TastefulElk @rafalwilinski @lajacobsson Love AppSync or API Gateway but hate VTL? You're not the only one!

Check out the Mapping Tool by @zaccharles and finally cure those VTL blues ;-)

mappingtool.dev
@TastefulElk @rafalwilinski @lajacobsson @zaccharles Everyone should be using AWS Organizations nowadays, just a shame it's all clickops and no IaC, right?

That's why you need to check out org-formation by @OConijn. It's been my secret weapon and lets me manage an entire AWS org (incl. AWS SSO) using IaC.

github.com/org-formation/…
@TastefulElk @rafalwilinski @lajacobsson @zaccharles @OConijn And finally, @lumigo is perhaps the most important tool at my disposal and has helped me troubleshoot countless issues quickly.

It gives me complete visibility into what's going on in my application.

And, no manual instrumentation is required!

lumigo.io
@TastefulElk @rafalwilinski @lajacobsson @zaccharles @OConijn @Lumigo I've written these up as a long-form blog post, with more details about each tool, so you can bookmark and share with your friends/colleagues.

lumigo.io/blog/seven-too…
@TastefulElk @rafalwilinski @lajacobsson @zaccharles @OConijn @Lumigo Oh, and we're giving away a free ticket to the GOTO Event-Driven Architecture conference in London next month!

Anyone who likes or retweets any of the tweets in this thread gets a chance to win. I'll announce the winner at 3pm CET tomorrow.

gotoldn.com
@TastefulElk @rafalwilinski @lajacobsson @zaccharles @OConijn @Lumigo That's a wrap!

If you enjoyed this thread:

1. Follow me @theburningmonk for more of these
2. RT the tweet below to share this thread with your audience
hey @lorcanoflynn my algorithm has picked you out as the winner of the raffle, can you DM me so we can send the ticket for the GOTO EDA event to you?

• • •

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

Keep Current with Yan Cui

Yan Cui 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 @theburningmonk

Aug 8
Don't wait for users to complain to find out there's a problem.

Here are the alerts you should have around your #serverless application.

It's not an exhaustive list, but a good starting point that's broadly applicable to everyone.
Most of the regional metrics for Lambda aren't useful for alerting you of an emerging issue, EXCEPT the regional concurrent execution count.

Set an alert threshold to ~70% of your current regional limit so you know to ask for a limit raise before it's too late.
For individual functions, you should have an alert on the error rate (not count), which can be computed by Errors by Invocations.

Implication: don't use errors for control flow!

Also implication for AppSync: you need to handle user errors gracefully:
theburningmonk.com/2021/06/how-to…
Read 11 tweets
Aug 4
I have written ~800 technical articles/whitepapers in the last 10 years and they have been viewed millions of times.

I see a lot of folks making the same mistakes I did early on in my journey.

So here are some principles to help you get better at writing.

🧵
1. 𝗦𝗲𝗹𝗹 𝘁𝗵𝗲 𝗽𝗿𝗼𝗯𝗹𝗲𝗺, 𝗻𝗼𝘁 𝘁𝗵𝗲 𝘀𝗼𝗹𝘂𝘁𝗶𝗼𝗻

Like that scene in wolf of wall street where Di Caprio asked Jon Bernthal to sell him a pen.

Create the demand, then supply the solution.
Sell the problem to the reader. Help them understand why it’s a problem worth solving.

If the readers are not interested in the problem you're solving, they won't care about whatever solution you propose, no matter how good the solution is.
Read 15 tweets
Aug 1
Here are 10 performance optimization tips I learned after rebuilding two of my landing pages from scratch.

If you're a backend-focused dev like me, these might be new to you too.

They gave my sites a great perf improvement, especially on mobile.

🧵
1. If you have a logo image above the fold, then tell the browser to prioritize downloading it by adding it as a preload in the <head> section of the index.html

<link rel="preload" as="image" href="... />
2. Use @cloudinary for all your images.

You can dynamically resize and optimize (compress into webp format) by adding a few flags to the URL, like this:

res.cloudinary.com/.../upload/𝗳_𝗮𝘂𝘁𝗼,𝗰_𝘀𝗰𝗮𝗹𝗲,𝘄_180/.../mugshot.png

The resized images are also cached.
Read 17 tweets
Jul 31
I love step functions, but the 𝗦𝘁𝗮𝗻𝗱𝗮𝗿𝗱 workflow's pricing model (based on no. of state transitions) can get hairy at high throughput and/or for large state machines with lots of states.

𝗘𝘅𝗽𝗿𝗲𝘀𝘀 workflows solve the cost issue but you lose a lot in the process.
U can't visualize executions, no exactly-once execution, and limited to 5 mins.

A nice pattern is to combine 𝗦𝘁𝗮𝗻𝗱𝗮𝗿𝗱 and 𝗘𝘅𝗽𝗿𝗲𝘀𝘀 workflows and get the best from both by nesting 𝗘𝘅𝗽𝗿𝗲𝘀𝘀 workflow inside a 𝗦𝘁𝗮𝗻𝗱𝗮𝗿𝗱 workflow.
If you wrap the parts of a workflow that can rack up a high no. of transitions (e.g. a polling loop) in an 𝗘𝘅𝗽𝗿𝗲𝘀𝘀 workflow, then you can keep the cost in check, while the parent 𝗦𝘁𝗮𝗻𝗱𝗮𝗿𝗱 workflow gives you exactly-once exec and long execution time (1 year).
Read 5 tweets
Jul 18
Are you spending too much on Lambda?

Here are some ways to save money on your Lambda bill.

🧵

#serverless #awslambda
Lambda is usually very cost-effective, you only pay when they run (with ms billing) and they scale to zero.

But a combination of misconfiguration and a high throughput use case can give you a nasty surprise when you get your AWS bill, esp if you don't have billing alerts set up.
A few of my clients have experienced this type of problem before. For example, when a function that is invoked millions of times a day is allocated with way too much memory. Or when provisioned concurrency is enabled on a function with a lot of memory.
Read 17 tweets
Jun 17
Great question from my current cohort of students, paraphrased:

"Should you always use Step Functions to chain together a few Lambda functions? Are there patterns to simplify this? How about using SQS between the functions?"

Here are my thoughts 🧵
Firstly, on the broader topic of orchestration vs choreography, I've written my thoughts before. TL;DR is that I prefer orchestration for intra-service workflows, and use events for inter-service communication.

theburningmonk.com/2020/08/choreo…
If you have a dead-simple workflow then Step Functions can be overkill, especially if you're new to it.

Simplest approach:
1. implement workflow inside a single function
2. use Lambda destinations to chain several functions together

Some considerations to think about...
Read 13 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!

:(