3 simple tips for successful serverless apps.

ANTHONY
ANTHONY
Sep 7, 2018 · 2 min read

Serverless is a very hot topic today. Here are some tips when building serverless applications.

🤲 Divide and conquer

Make sure your functions are small.

Yes, S M AL L.

Your serverless functions should only do one small thing and fast.

Dependencies? Forget about them, keep your code as lean as possible.

Why? The heavier your function (more dependencies), the longer the latency will be when warming up your function after invocation from a cold start.

Why a cold starts? (Well…The running environment that runs your function oftentimes goes to bed until your beautiful function is invoked again. This saves money to the Serverless provider. Don’t tell anybody).

📞 Calling other functions

Please, don’t!

Don’t chain function calls. {{{DO NOT}}}

Instead, use well-known patterns for distributed systems.

Propagate messages to other functions.

Use queue systems or simple notification services.

Detach your tasks from the main thread (your function).

🏃‍Long-running processes

I hope you don’t do this either 🤦‍

Serverless functions are meant for executing fast and non-blocking operations. Yes, <<<NON | BLOCKING>>>.

Forget about establishing long-running connections (Yeah, no RDBMS connections) or having long-running processes.

Your functions should delegate long-running processes to workers ready to receive and compute anything really heavy.

A queue system and workers system together can help you with keeping your Serverless functions ready to accept incoming connections and save you resources.

👨‍💻Takeaway

It’s clear that the future is less code and more code sharing and features. However, while we get there, it’s important to understand the gist of new emerging technologies like the Serverless architecture.

I hope You have enjoyed this post!

Help me get to others by CLAPPING! 👏

👉 Follow me on Twitter: https://twitter.com/anthonyrod4

😊 You might also like:

If you want to discuss more on this topic, make a correction or just say “hi 🙌”, just leave us a comment, please.

THANKS👋

ANTHONY

Written by

ANTHONY

Software Architecture enthusiast | New York City

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade