.. title:: Kafka Streams API for Confluent Platform .. meta:: :description: Learn about the Kafka Streams API for building highly scalable, elastic, fault-tolerant, distributed applications, and microservices. .. _streams_intro: |kstreams| API for |cp| ======================= This section provides a quick introduction to the Streams API of |ak-tm|. The |kstreams| API in a Nutshell ----------------------------------- The Streams API of |ak|, available through a Java library, can be used to **build highly scalable, elastic,** **fault-tolerant, distributed applications, and microservices**. First and foremost, the |kstreams| API allows you **to create real-time applications that power your core business**. It is the easiest yet the most powerful technology to process data stored in |ak|. It builds upon important :ref:`concepts ` for :term:`stream processing` such as efficient management of application state, fast and efficient aggregations and joins, properly distinguishing between event-time and processing-time, and seamless handling of :ref:`out-of-order data `. A unique feature of the |kstreams| API is that the applications you build with it are **normal Java applications**. These applications can be packaged, deployed, and monitored like any other Java application -- there is **no need to install separate processing clusters or similar special-purpose and expensive infrastructure**! .. figure:: images/streams-introduction-your-app.png :width: 500pt :height: 326pt :align: center An application that uses the |kstreams| API is a normal Java application. Package, deploy, and monitor it like you would do for any other Java application. Even so, your application will be highly scalable, elastic, and fault-tolerant. Use Case Examples ----------------- The |kstreams| API is applicable to a wide range of use cases and industries. * Travel companies can build applications with the |kstreams| API to make real-time decisions to find best suitable pricing for individual customers, to cross-sell additional services, and to process bookings and reservations. * The finance industry can build applications to aggregate data sources for real-time views of potential exposures and for detecting and minimizing fraudulent transactions. * Logistics companies can build applications to track their shipments fast, reliably, and in real-time. * Retailers can build applications to decide in real-time on next best offers, personalized promotions, pricing, and inventory management. * Automotive and manufacturing companies can build applications to ensure their production lines perform optimally, to gain real-time insights into their supply chains, and to monitor telemetry data from connected cars to decide if an inspection is needed. * And many more. A Closer Look ------------- Before you dive into the :ref:`Concepts ` and :ref:`Architecture `, get your feet wet by walking through `your first Kafka Streams application `__, let's take a closer look. A key motivation of the |kstreams| API is to bring stream processing out of the Big Data niche into the world of mainstream application development, and to radically improve the developer and operations experience by `making stream processing simple and easy `__. Using the |kstreams| API you can implement standard Java applications to solve your stream processing needs -- whether at small or at large scale -- and then run these applications on client machines at the perimeter of your |ak| cluster. Your applications are fully elastic: you can run one or more instances of your application, and they will automatically discover each other and collaboratively process the data. Your applications are also fault-tolerant: if one of the instances dies, then the remaining instances will automatically take over its work -- without any data loss! Deployment-wise, you are free to choose from any technology that can deploy Java applications, including but not limited to Puppet, Chef, Ansible, Docker, Mesos, YARN, Kubernetes, and so on. This lightweight and integrative approach of the |kstreams| API -- "Build applications, not infrastructure!" -- is in stark contrast to other stream processing tools that require you to install and operate separate processing clusters and similar heavy-weight infrastructure that come with their own special set of rules on how to use and interact with them. The following list highlights :ref:`several key capabilities and aspects ` of the |kstreams| API that make it a compelling choice for use cases such as microservices, event-driven systems, reactive applications, and continuous queries and transformations. **Powerful** * Makes your applications highly scalable, elastic, distributed, fault-tolerant * Supports exactly-once processing semantics * Stateful and stateless processing * Event-time processing with windowing, joins, aggregations * Supports :ref:`streams_developer-guide_interactive-queries` to unify the worlds of streams and databases * Choose between a :ref:`declarative, functional API ` and a lower-level :ref:`imperative API ` for maximum control and flexibility **Lightweight** * Low barrier to entry * Equally viable for small, medium, large, and very large use cases * Smooth path from local development to large-scale production * No processing cluster required * No external dependencies other than |ak| **Fully integrated** * 100% compatible with |ak| 0.11.0 and 1.0.0 * Easy to integrate into existing applications and microservices * No artificial rules for packaging, deploying, and monitoring your applications * Runs everywhere: on-premises, public clouds, private clouds, containers, etc. * Integrates with databases through continuous change data capture (CDC) performed by :ref:`Kafka Connect ` **Real-time** * Millisecond processing latency * Record-at-a-time processing (no micro-batching) * Seamlessly handles out-of-order data * High throughput **Secure** * Supports :ref:`encryption of data-in-transit ` * Supports :ref:`authentication and authorization ` In summary, the |kstreams| API is a compelling choice for building mission-critical stream processing applications and microservices. Give it a try with this step-by-step tutorial to build your first `Kafka Streams application `__! The next sections, :ref:`Concepts `, :ref:`Architecture `, and the :ref:`Developer Guide ` will help to get you started. .. tip:: **Reading tip:** If you are interested in learning about our original motivation to create the |kstreams| API, you may want to read the Confluent blog post `Introducing Kafka Streams: Stream Processing Made Simple `__. .. _streams_requirements: Requirements ------------ ------------ |ak| ------------ The following versions are supported: .. include:: includes/compatibilityMatrix.rst --------- Confluent --------- - When you need Avro schema support: :ref:`Confluent Schema Registry ` .. include:: ../.hidden/docs-common/home/includes/ak-share.rst