Yan Cui Profile picture
I help you master AWS and serverless | AWS Serverless Hero Newsletter ๐Ÿ‘‰ https://t.co/eZRWhA8Zch YouTube โ–ถ๏ธ https://t.co/lgCxyf2r47
Paweล‚ is building CloudPouch.dev Profile picture 2 subscribed
Oct 17, 2023 โ€ข 16 tweets โ€ข 4 min read
I have written over 800 technical articles in the last 14 years and they have been read 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 The Wolf of Wall Street where Di Caprio asked Jon Bernthal to sell him a pen.

First, create the demand, then supply the solution. Image
Nov 22, 2022 โ€ข 6 tweets โ€ข 1 min read
This is big!

Payload-based filtering was one of the key reasons to choose EventBridge over SNS. This makes SNS a much more viable option in Event-Driven Architecture.

aws.amazon.com/blogs/compute/โ€ฆ Off the top of my head, this would:

1. Allow you to use one SNS topic for many types of messages, previously one tends to have many SNS topics, one for each type of message.
Oct 24, 2022 โ€ข 15 tweets โ€ข 3 min read
This is a very interesting thread and the surrounding discussions. I've had similar discussions in the past, but I don't want to make too many assumptions here because I wasn't part of the conversation with the client.

But here are my thoughts.

First of all, serverless has been successfully adopted at a much bigger scale in other companies. LEGO for example have 26 squads working mostly with serverless, and PostNL has been all in on serverless since 2018.

So technology is probably not the problem.
Aug 11, 2022 โ€ข 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โ€ฆ
Aug 8, 2022 โ€ข 11 tweets โ€ข 5 min read
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.
Aug 4, 2022 โ€ข 15 tweets โ€ข 4 min read
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.
Aug 1, 2022 โ€ข 17 tweets โ€ข 15 min read
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="... />
Jul 31, 2022 โ€ข 5 tweets โ€ข 2 min read
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.
Jul 18, 2022 โ€ข 17 tweets โ€ข 9 min read
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.
Jun 17, 2022 โ€ข 13 tweets โ€ข 4 min read
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โ€ฆ
May 5, 2022 โ€ข 8 tweets โ€ข 3 min read
As the Lambda service becomes more mature and fully featured, there's also more confusion around when to use these new features. Function URL came up in a conversation today, so let's talk about that!

๐Ÿงต Let me start by saying that I'm quite excited by its release and I think it's great that it's now an option.

But I also think it shouldn't be the default for most of the people who are using Lambda today.

lumigo.io/blog/aws-lambdโ€ฆ
May 3, 2022 โ€ข 19 tweets โ€ข 9 min read
The no. 1 question I get about #serverless is around testing - how should I test these cloud-hosted functions? Should I use local simulators? How do I run these in my CI/CD pipeline?

Here are my thoughts on this ๐Ÿงต There's value in testing YOUR code locally, but don't bother with simulating AWS locally, too much effort to set up and too brittle to maintain. Seen many teams spend weeks trying to get localstack running and then waste even more time whenever it breaks in mysterious ways ๐Ÿ˜ 
Dec 17, 2020 โ€ข 17 tweets โ€ข 7 min read
If you want to learn about the internal details of Lambda, then check out @MarcJBrooker's session "Deep dive into AWS Lambda security: Function isolation"

virtual.awsevents.com/media/1_gu6tp8โ€ฆ

Here's my play-by-play

๐Ÿงต haha, a typical EC2 bare metal instance can run A LOT of Lambda workers! Which means AWS needs to figure out how to do it securely and performantly.
Dec 6, 2020 โ€ข 8 tweets โ€ข 5 min read
Stitching together my previous tweets on @dyanacek's session (BLD205) on "Monitoring production services at Amazon" so it's easier to share

#aws #reinvent2020

virtual.awsevents.com/media/1_4nwtxcโ€ฆ "For amazon.com we found the "above the fold" latency is what customers are the most sensitive to"
Dec 5, 2020 โ€ข 30 tweets โ€ข 12 min read
If you missed @clare_liguori's Continuous Delivery session this week (like I did) then good news, it's available on-demand now ๐ŸŽŠ

virtual.awsevents.com/media/1_ua3d99โ€ฆ

And here's my play-by-play for the session

๐Ÿงต... This is a typical CD pipeline in AWS.

This is far more complex than the most complex CD pipeline I have ever had! Just cos it's complex, doesn't mean it's over-engineered though. Given the blast radius, I'm glad they do releases carefully and safely.
Dec 5, 2020 โ€ข 11 tweets โ€ข 3 min read
I've gotten a few questions about Aurora Serverless v2 preview, so here's what I've learnt so far. Please feel free to chime in if I've missed anything important or got any of the facts wrong.

Alright, here goes the ๐Ÿงต... Q: does it replace the existing Aurora Serverless offering?
A: no, it lives side-by-side with the existing Aurora Serverless, which will still be available to you as "v1".
Dec 3, 2020 โ€ข 13 tweets โ€ข 6 min read
Great overview of permission management in AWS by @bjohnso5y (SEC308)

Lots of tools to secure your AWS environment (maybe that's why it's so hard to get right, lots of things to consider) but I love how it starts with "separate workloads using multiple accounts" Image SCP for org-wide restrictions (e.g. Deny ec2:* ๐Ÿ˜‰).

IAM perm boundary to stop ppl from creating permissions that exceed their own.

block S3 public access

These are the things that deny access to things (hence guardrails)

Use IAM principal and resource policies to grant perms ImageImage
Dec 3, 2020 โ€ข 20 tweets โ€ข 8 min read
Great session by @MarcJBrooker earlier on building technology standards at Amazon scale, and some interesting tidbits about the secret sauce behind Lambda and how they make technology choices - e.g. in whether to use Rust for the stateful load balancer v2 for Lambda.

๐Ÿงต Nice shout out to some of the benefits of Rust - no GC (good for p99+ percentile latency), memory safety with its ownership system theburningmonk.com/2015/05/rust-mโ€ฆ great support for multi-threading (which still works with the ownership system)
Dec 2, 2020 โ€ข 44 tweets โ€ข 14 min read
This is part 2 of my #aws #reinvent hot takes on the big #serverless related announcements.

Part 1 is here for anyone who missed it:

Same deal as before, if this gets 168 retweets then I'll do another batch ๐Ÿ‘

Alright, here comes the mega ๐Ÿงต... 1. Lambda now bills you by the ms as opposed to 100 ms. So if your function runs for 42ms you will be billed for 42ms, not 100ms.

This instantly makes everyone's lambda bills cheaper without having to lift a finger. It's the best kind of optimization ๐Ÿ˜Ž

aws.amazon.com/about-aws/whatโ€ฆ
Dec 1, 2020 โ€ข 4 tweets โ€ข 2 min read
Given all the excitement over Lambda's per-ms billing change today, some of you might be thinking how much money you can save by shaving 10ms off your function.

Fight that temptation ๐Ÿง˜โ€โ™‚๏ธuntil you can prove the ROI on doing the optimization.

#serverless #aws #awslambda The moral of this tweet is as relevant now as ever:

Assuming $50 (which is VERY conservative) per dev per hour, it would have taken them 40 months to break even on just having the meeting, before writing a single line of code!
Nov 30, 2020 โ€ข 45 tweets โ€ข 12 min read
re:Invent starts tomorrow, so let me round up the biggest #serverless related announcements from the last 2 weeks (I know, crazy!) and share a few thoughts on what they mean for you.

Mega ๐ŸงตIf this gets 168 retweets then I'll add another batch!

#serverless #aws #reinvent 1. Lambda released Logs API which works with the Lambda Extensions mechanism that was released in Oct. This lets you subscribe to Lambda logs in a Lambda extension and ship them elsewhere WITHOUT going through CloudWatch Logs

aws.amazon.com/about-aws/whatโ€ฆ