Apache Flink Statefun - Remote Deployment - State propagation

151 views Asked by At

I have a few question about the remote deployment of functions as shown the diagram:

If have remote statefun functions (multiple instance with the Undertow as shown in the examples fronted by api gateway):

  1. Do we need to configure the api gateway to send calls with same url to the same backend hosting the function or does the frame work take care of it ?
  2. From my understanding each function is keeping local state. If one instance is relocated, or we scale the functions, how does the local state get redistributed ?

If there is any documentation, on this, please let me know.

Thanks.

1

There are 1 answers

2
David Anderson On

The functions are stateless. All of the state they need in order to respond to an invocation is included in the message, and the response will include any updates to the state that are needed. Because they are stateless there's no need to worry about sessions or instance affinity or rescaling for remote functions.

The developers have given talks that get into some of these details. I'll suggest a talk by Tzu-Li (Gordon) Tai, Stateful Functions: Polyglot Event-Driven Functions for Stateful Distributed Applications.