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
0
votes
1 answer

HTTP ingress type Apache Flink StateFun

I am trying to quickly put together a proof of concept using the Apache Flink statefun Docker image. https://hub.docker.com/r/apache/flink-statefun I don't really want to use Kafka or Kinesis as an ingress, I'd rather just use HTTP so I can quickly…
pocockn
  • 1,965
  • 5
  • 21
  • 36
0
votes
1 answer

Flink Statefun API Kafka trigger

I want to implement a job using the Apache Flink Statefun API and configure Kafka as a trigger. The idea is have events go into a Kafka topic, and have it then trigger a stateful function in Flink like a FaaS. Is this possible? How would it be…
Baiqing
  • 1,223
  • 2
  • 9
  • 21
0
votes
1 answer

Apache Flink Statefun - Remote Deployment - State propagation

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): Do we need to configure the api gateway to…
0
votes
1 answer

Flink Statefun Broadcast state feature

Is there a broadcast state feature available in Flink Statefun, just like Apache Flink (Broadcast State Pattern) ?
0
votes
1 answer

Invoking Flink stateful function using REST API

I'm writing an Apache Flink Statefun application using python. I'm looking for help/pointers to invoke existing stateful function via a REST POST/GET call. I referred to…
Himanshu
  • 3
  • 2
0
votes
1 answer

How to aggregate the elements in the window sessions flink?

I'm using the flink Session windows when it does not receive elements for a certain period of time,i.e; when a gap of inactivity occurred it should emit an event. I configured the gap as 10 seconds in the flink job. And I sent the event1 and sends…
0
votes
0 answers

Ingress configuration as String with Flink statefun

What I am trying to do Once followed the python walkthrough I am trying to modify module.yaml file so ingress and egress is not Protobuf but String. I have not really modify most of the files, only module.yaml trying to configure for string ingress…
aams.eam
  • 1
  • 1
0
votes
1 answer

Time characteristic in Stateful functions

I understand in general that event time uses Watermarks to make progress in time. In the case of Flink Statefun which is more based on iteration it may be a problem. So my question is if I use the delayed message…
0
votes
1 answer

How to auto scale up/down Flink Stateful Functions on K8s

My Current Flink Application based on Flink Stateful Function 3.1.1, it reads message from Kafka, process the message and then sink to Kafka Egress Application has been deployed on K8s following guide and is running well: Stateful Functions…
Yun Xing
  • 43
  • 4
0
votes
1 answer

Flink StateFun high availability exception: "java.lang.IllegalStateException: There is no operator for the state ....."

I have 2 questions related to high availability of a StateFun application running on Kubernetes Here are details about my setup: Using StateFun v3.1.0 Checkpoints are stored on HDFS (state.checkpoint-storage: filesystem) Checkpointing mode is…
keremulutas
  • 534
  • 5
  • 16
0
votes
1 answer

Custom deserialiser using the universal Kafka ingest

Following on from this (apologies, had a different user): Kafka Key access on Ingress of a Python Flink Stateful function Our use case is that we make use of the Kafka headers as a means of tracing and lineage as well as required metadata. Looking…
Richard Noble
  • 213
  • 3
  • 6
0
votes
1 answer

Kafka Key access on Ingress of a Python Flink Stateful function

I've been looking at Flink Stateful Functions. It looks super promising - except for one thing - and I hope I'm just missing it. For the life of me, can't see a way to access the kafka key from a kafka ingress in Python. In Java, I see I could use…
0
votes
1 answer

What templating parameters does Flink Stateful Functions URL Path Template support?

When deploying Flink Stateful Functions, one needs to specify what the endpoints for the functions are, i.e. what URL does Flink need to hit in order to trigger the execution of a remote function. The docs state: The URL template name may contain…
John
  • 10,837
  • 17
  • 78
  • 141
0
votes
0 answers

Negative backlog in Apache Flink Stateful Functions

How can the backlog of a remote function in Flink Statefun be negative? On a pipeline I'm currently working on, I see this behaviour regularly when the cluster is under stress and some functions are under backpressure. Then the metrics for the…
Chr1s
  • 258
  • 3
  • 14
0
votes
1 answer

How to route custom objects in an embedded Flink Statefun module?

I have an embedded module in Apache Flink Statefun 3.0 (customized the Greeter example) that consumes JSON serialized events. When trying to route() messages deserialized from the ingress, I get an exception that my custom type is not convertible to…