Questions tagged [flink-statefun]

Stateful Functions is an API that simplifies building distributed stateful applications. It’s based on functions with persistent state that can interact dynamically with strong consistency guarantees. The runtime is built on Apache Flink®.

Stateful Functions Applications

A stateful function is a small piece of logic/code existing in multiple instances that represent entities — similar to actors. Functions are invoked through messages and are:

  • Stateful: Functions have embedded, fault-tolerant state, accessed locally like a variable.
  • Virtual: Much like FaaS, functions don't reserve resources — inactive functions don't consume CPU/Memory.

Applications are composed of modules of multiple functions that can interact arbitrarily with:

  • Exactly-once Semantics: State and messaging go hand-in-hand, providing exactly-once message/state semantics.
  • Logical Addressing: Functions message each other by logical addresses. No service discovery needed.
  • Dynamic and Cyclic Messaging: Messaging patterns don't need to be pre-defined as dataflows (dynamic) and are also not restricted to DAGs (cyclic).

A Runtime built for Serverless Architectures

The Stateful Functions runtime is designed to provide a set of properties similar to what characterizes serverless functions, but applied to stateful problems.

The runtime is built on Apache Flink, with the following design principles:

  • Logical Compute/State Co-location: Messaging, state access/updates and function invocations are managed tightly together. This ensures a high-level of consistency out-of-the-box.
  • Physical Compute/State Separation: Functions can be executed remotely, with message and state access provided as part of the invocation request. This way, functions can be managed like stateless processes and support rapid scaling, rolling upgrades and other common operational patterns.
  • Language Independence: Function invocations use a simple HTTP/gRPC-based protocol so that Functions can be easily implemented in various languages.

References

89 questions
1
vote
0 answers

Flink Statefun netty DisconnectedException

I am trying to run a flink statefun (version 3.2.0) application on my local machine using docker, with a single task manager and a single job manager. The application is a pipeline of multiple services that communicate to each other via sending…
justaq
  • 11
  • 1
1
vote
0 answers

Flink MapState with remote functions

So, I'm trying to implement flink's mapState using remote functions. In the mapState I'll be storing around 1000 values mapped with one key. Can someone point me in direction to implement it for remote function. I've found the article with embedded…
Singh3y
  • 336
  • 1
  • 7
1
vote
1 answer

How to access Flink statefun function

flink playground gives a demo as below: public final class GreeterAppServer { public static void main(String[] args) { final StatefulFunctions functions = new StatefulFunctions(); functions.withStatefulFunction(UserFn.SPEC); …
宋之一
  • 11
  • 2
1
vote
1 answer

How should I set up the message payload when calling a remote Python function from an embedded Java function

I'm using Flink StateFun 3.1.0, and want to call a remote Python function from an embedded Java function. In StateFun 2.2, I could create a ProtoBuf Any from an instance of my (generated via Protobuf) Java class via Any.pack(msg), and that worked.…
kkrugler
  • 8,145
  • 6
  • 24
  • 18
1
vote
1 answer

How do Flink Stateful Functions on AWS handle backpressure / 429 throttling from Lambda?

Flink Stateful Functions using remote functions involve a Flink StateFun cluster handing off execution of compute tasks to remote workers deployed through some FaaS mechanism, for instance AWS Lambda. AWS lambdas are subject to scaling limitations…
1
vote
0 answers

Can Flink statefun application run on a Flink session cluster?

Can I run a Flink statefun application on an existing Flink session cluster? The docs in older statefun versions (2.2) said it was possible, but that part has been removed from docs in newer versions, so wondered if it is still possible.
1
vote
2 answers

High Flink network buffer usage, which causes Kafka lagging

Our Flink Jobs contains a filter, key by session id and then session window with 30mins gap. The session window will need to accumulate all the event for the session, and process them using ProcessWindowFunction. We are using Flink 1.9, 128…
lucky_start_izumi
  • 2,511
  • 13
  • 41
  • 61
1
vote
1 answer

Flink Failure Recovery: What if a stateless operator failed

We know, Flink creates checkpoints for every stateful operator periodically, and when crashes happen, it can use the checkpoints to recovery the system. But I can't find any paper or document about the stateless operator in these processes --"the…
IMC666
  • 23
  • 3
1
vote
1 answer

Flink optimal configuration for minimum Latency

For a Flink streaming / Flink stateful function, it is known that the setBufferTimeout to small value (e.g., 5ms) would give 'best' latency experience. What are the other recommended configuration values one must take care (set, reset, modify..)…
Mazen Ezzeddine
  • 662
  • 1
  • 8
  • 28
1
vote
3 answers

hashCode() and equals() method for custom classes in flink

my doubt is about if custom classes in Flink with Java needs to override or not hashCode() and equals() methods because I have read in this page that hashCode() MUST never be implemented in distributed systems and Apache Flink is one of…
Alter
  • 903
  • 1
  • 11
  • 27
1
vote
1 answer

How to make an automatic savepoint in Flink Stateful Functions application?

I am trying to dive into the new Stateful Functions approach and I already tried to create a savepoint manually…
eksd
  • 63
  • 5
1
vote
1 answer

Flink Statefun concurrent state update

I'm trying to implement messaging scenario using apache flink stateful functions. One of my state is able to updated by two different functions which is provided to MatchBinder. These two functions basically checks the current state and updates the…
1
vote
1 answer

Apache Flink in Kubernetes

Could anyone please let me know how I can setup Flink in my Serverless platform (FaaS) to perform event driven operations? I looked at Flink functions and it seems to be promising. Could anyone clarify on the below? What I need to install in my…
1
vote
1 answer

Flink Statefun HA kubernetes cluster

I'm trying to deploy high available flink cluster on kubernetes. In the below examples worker nodes are replicated but we have only one master pod. https://github.com/apache/flink-statefun As far as I understand there are 2 approaches to make job…
1
vote
0 answers

Apache Flink Stateful Functions Remote Functions Kubernetes Deployment

I installed Flink Statefun Kubernetes Cluster(3 node) in HA(Zookeeper) mode. This cluster includes statefun 2.0.0 image and embedded jar,module yaml file. Also I installed another Kubernetes cluster for remote function. Offical Example shows in same…
Anıl Sevici
  • 214
  • 2
  • 12