Re: Statefun 2.0 questions

Posted by Igal Shilman on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Statefun-2-0-questions-tp34969p34980.html

Hi Wouter!

Glad to read that you are using Flink for quite some time, and also exploring with StateFun!

1) yes it is correct and you can follow the Dockerhub contribution PR at [1]

2) I’m not sure I understand what do you mean by trigger from the browser.
If you mean, for testing / illustration purposes triggering the function independently of StateFun, you would need to write some JavaScript and preform the POST (assuming CORS are enabled)
Let me know if you’d like getting further information of how to do it.
Broadly speaking, GET is traditionally used to get data from a resource and POST to send data (the data is the invocation batch in our case).

One easier walk around for you would be to expose another endpoint in your Flask application, and call your stateful function directly from there (possibly populating the function argument with values taken from the query params)

3) I would expect a performance loss when going from the embedded SDK to the remote one, simply because the remote function is at a different process, and a round trip is required. There are different ways of deployment even for remote functions.
For example they can be co-located with the Task managers and communicate via the loop back device /Unix domain socket, or they can be deployed behind a load balancer with an auto-scaler, and thus reacting to higher request rate/latency increases by spinning new instances (something that is not yet supported with the embedded API)

Good luck,
Igal.





[1] https://github.com/docker-library/official-images/pull/7749


On Wednesday, May 6, 2020, Wouter Zorgdrager <[hidden email]> wrote:
Hi all,

I've been using Flink for quite some time now and for a university project I'm planning to experiment with statefun. During the walkthrough I've run into some issues, I hope you can help me with.

1) Is it correct that the Docker image of statefun is not yet published? I couldn't find it anywhere, but was able to run it by building the image myself.
2) In the example project using the Python SDK, it uses Flask to expose a function using POST. Is there also a way to serve GET request so that you can trigger a stateful function by for instance using your browser? 
3) Do you expect a lot of performance loss when using the Python SDK over Java?

Thanks in advance!

Regards,
Wouter