I guess I’m asking more of a general architecture application. I am building a real-time application using api gateway, lambda and cognito.
For my application logic, I could just use lambdas and “child lambdas” and it would get the job done because I do’nt have a lot of complex logic, it’s mostly if then stype stuff. But step functions looks more elegant as an architecture.
Are there any limitations of using step functions for real-time applications using websockets?
There is of course some extra overhead. If you’re using express workflows, you have to ensure you handle duplicates. Apart from that I’d say it’s heavily dependent on your particular workflow, but step functions are great to model business logic with a lot of if/then depending on responses. A best practice to lower latency and cost is to use the native integrations StepFunctions supports - need to write/read from dynamo, do it directly from step functions, don’t add an unnecessary Lambda.
I’ve never used it with websockets, but with other real-time chat solution. The purpose of step function was censoring and rate limiting chat. Not sure if best solution for that purpose, but it worked pretty good
“Real-time” chat application? Probably fine. Real-time heart monitoring of a critical patient? Maybe not the best fit.
Step functions can react and process state changes “really quickly”, but there can be delays between a state changing and the step function itself being updated.
Lambda cold starts are another good example - not strictly real time, but “plenty quick” most of the time.