Stateless Services — and Performance
So, you’ve drunk the ServerLess Kool-Aid — Lambda / Azure Functions / GCF / whatever — and are frenetically converting all your micro-services to StateLessMicroServices™, right? And everything is just going to be peachy-keen, right?
Well, maybe. As you go down the path, one of the things you might find is that you now have different performance issues that you need to pay attention to. (•)
In particular
In particular
- • Resources : Yeah, you’re going to have to open/clean-up those db connections, file handles and network connections each time.
- • State : is now going to be in your data-store. And oh, you do have a data-store right? Which you are dealing with per -1- above, right? Which means you’re going to have to retrieve/store it each time you run your function…
- • Concurrency : Yup, welcome to the world of concurrency. You’re going to have to deal with your serializability, linearizability, consistency, and that entire ball-of-wax, each of which comes with its own performance issues.
- • Authentication/Authorization : You do need to do these right? And that’ll happen either with a db-hit, or with a decryption hit (well, the auth/auth info is either in a db, or in a cookie/token. Pick one), as well as a maintenance hit — after all, you need to keep the auth/auth data up-to-date, right?
The bottom line here is that you need to be thinking of the above now. For simple stuff, this isn’t going to be much of an issue, but as you scale, and/or get more complicated, each of the above comes with its own little world of hurt — something that you’ll discover soon enough!
(•) For more on this, go take a look at Kasey Speakman’s post
Comments