by Rapzid · 9y ago · 0 comments
I agree with the sentiment of the article, if not the specifics of every point. Definitely feel some pain in areas. Sometimes I feel we are doing architectural contortions. Pain points include:
* SQS is not an event source :(
* Cold starts can be very problematic for latency sensitive scenarios when using languages/frameworks that startup slow. It's pre-fork without the fork :(
* No concurrency in event handling exacerbating some of the above
* Artifact size limits can often be rough
* Bizarre artifact storage limits and little help in the way of cleaning them up
* CloudFormation limits and bugs
* The service is rather opaque
* Onboarding; good luck :)
Learned the hard way:
* Created too many individual project repos and serverless services. Classic monolith vs services pains but more to do with too-small service boundaries
* Interface to serverless projects too fine grained(too many lambda functions per service)
* Didn't start using step functions earlier to bridge the gap between stateful processes and stateless processors
* Used SQS as database(long story)
* Ran a flask API as a lambda. Works, but there is just no way we would use this if it weren't internal due to cold start/scale latencies with bursty traffic.
I really don't understand why this is the case. Every time we need a queue for something we end up having to explain this again to whoever our newest developers are, which seems to me like a sign of how unintuitive it is.
I have yet to encounter a use case where we didn't want to grab items out of the queue relatively frequently or even as they were added, so why force us to mess with scheduled events and long polling to do so?
In particular: "you get 5 reads". Number of consumers impacts latency, and not ms of latency, but s of latency.
This stuff is not obvious until you really try and use it.
New programming test idea for hopeful candidates; create a Kinesis client that reliably publishes batches of messages and doesn't starve other producers.
If SQS were event based, you could potentially try to process a message as soon as it was received and then have a batch job to reprocess any messages that have been left in the queue however often you like. The closest to this we got was by using SNS and feeding it into SQS, or even a table somewhere, but that gets sort of messy pretty quickly and didn't seem worth the extra infrastructure.
Edit: I didn't really respond to the suggestion of Kinesis here. I haven't done much with Kinesis, but I get the sense it's overkill for the use cases I'm thinking about. I don't plan to have a large amount of producers and don't expect them to have a consistent or large stream of data. If I'm wrong in that being the main use case for Kinesis please correct me.
You can attempt to keep between 1 and X instances of a lambda function running, however the underlying provisioning system is mostly a black box without published details and supposedly not entirely deterministic. Keeping a single instance of the function running isn't going to give great control over the tail on latencies. This is particularly true when faced with bursty, inconsistent traffic patterns.
We've come full circle, no?
I would love to hear it. I have mistakenly used SQS for medium-term storage of state, which is what I am assuming your issue was.