Building Enterprise AI Agents with Flink SQL: Connecting LLMs to Internal Data

2025-06-18

This article explores building enterprise AI agents using Flink SQL, connecting Large Language Models (LLMs) with internal data and resources. For structured data, Flink SQL's SQL join semantics easily integrate external database data with LLM input. For unstructured data, the article proposes Retrieval-Augmented Generation (RAG), encoding data into vectors stored in a vector database, then querying and integrating via Flink SQL's vector type support. Using the example of summarizing research papers and incorporating internal research, the article demonstrates building an AI agent system with two Flink SQL jobs: one updates the vector store, the other queries and invokes the LLM. Finally, it mentions using Process Table Functions (PTFs) to integrate Anthropic's MCP standard for more flexible AI agent construction.

Read more
Development

Stream vs. Batch: It's Actually About Push vs. Pull

2025-05-18

The common "Stream vs. Batch" debate is misleading. Many streaming systems internally use batching for performance, but the real distinction lies in data processing semantics: 'push' systems deliver data in real-time, providing a complete, up-to-the-second view; 'pull' systems periodically query data, potentially missing updates and deletes. While 'push' is more complex, its real-time advantage is compelling. Once you experience the magic of second-level data freshness, you won't want to go back. In practice, both approaches complement each other, with batch processing often used for backfilling in otherwise streaming systems.

Read more
Development batch processing

The Future of Kafka: Beyond Partitions, Towards a More Powerful Message Queue

2025-04-25

This article explores future improvements to Kafka, centered around moving beyond partition-based access to a key-centric approach. This would enable more efficient data access and replay, dynamic consumer scaling, and resolve head-of-line blocking issues. Additionally, it proposes features such as topic hierarchies, concurrency control, broker-side schema support, extensibility, synchronous commit callbacks, snapshotting, and multi-tenancy to enhance Kafka's performance, reliability, and ease of use, making it better suited for modern data applications.

Read more
Development Message Queue

Kafka 4.0 AOT Cache Boosts Startup Time by 59%

2025-03-28

This article demonstrates how to leverage Java's Ahead-of-Time (AOT) compilation to significantly improve the startup time of Apache Kafka 4.0. By creating an AOT cache file, the author successfully reduced Kafka's startup time from 690 milliseconds to 285 milliseconds, a remarkable 59% improvement. The process involved overcoming a JMX conflict, ultimately leading to the successful creation and application of the AOT cache, resulting in substantial performance gains.

Read more
Development AOT Compilation

The Synchrony Budget: Minimizing Synchronous Calls in Distributed Systems

2025-03-27

This article explores the importance of managing synchronous calls when building distributed service systems. The author introduces the concept of a "synchrony budget," advocating for minimizing synchronous requests between services to improve performance and availability. Synchronous calls are costly, impacting response times and system stability. Using an e-commerce order processing example, the article demonstrates how to handle interactions with inventory and shipping services asynchronously (e.g., using Kafka), reserving synchronous calls for situations where they're essential (like payment services). The author also covers the Outbox pattern and CDC technology for handling message buffering and data synchronization in asynchronous communication, ultimately achieving a high-performance and highly available distributed system.

Read more