<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nishant Sinha on Medium]]></title>
        <description><![CDATA[Stories by Nishant Sinha on Medium]]></description>
        <link>https://medium.com/@nishant_sinha?source=rss-89041acd82b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NOhLJvir4JfGxi4ZPCj8YA.jpeg</url>
            <title>Stories by Nishant Sinha on Medium</title>
            <link>https://medium.com/@nishant_sinha?source=rss-89041acd82b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 04:42:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nishant_sinha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrate distributed event stream with IBM Watsonx.data]]></title>
            <link>https://medium.com/@nishant_sinha/integrate-distributed-event-stream-with-ibm-watsonx-data-e6f676178f24?source=rss-89041acd82b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6f676178f24</guid>
            <dc:creator><![CDATA[Nishant Sinha]]></dc:creator>
            <pubDate>Wed, 13 Mar 2024 17:38:27 GMT</pubDate>
            <atom:updated>2024-03-13T17:38:27.171Z</atom:updated>
            <content:encoded><![CDATA[<h3>Integrate a distributed event stream with IBM Watsonx.data</h3><p>This blog is co-authored by <a href="https://medium.com/u/5d05734d9b58">Sachinkumar Jain</a>. In this article we are talking about integrating distributed event streaming platform — Apache Kafka with IBM Watsonx.data lakehouse.</p><p><strong>Apache Kafka</strong> is a distributed event streaming platform, where data is captured in real time, from various event sources like, mobile devices, IoT sensors, microservices, databases etc. A few key terms that one should be aware of are,</p><ul><li><strong>Events</strong>: messages or records that are worth capturing for subsequent processing.</li><li><strong>Topics</strong>: Events are organized in topics. It is similar to a folder, on a filesystem, with multiple files within it.</li><li><strong>Partitions</strong>: Topics are partitioned across multiple systems (brokers) across the cluster. This is to make Kafka scalable.</li><li><strong>Producers and Consumers</strong>: As the name suggests, producers are entities or applications that publish events to topics within Kafka, whereas consumers are the entities that subscribe to and read events from topics within Kafka.</li></ul><p><strong>IBM Watsonx.data:</strong> Although lakehouses have been in existence for a few years now, it is worth a small introduction. Data lakehouse is a data management architecture which brings together the best of two proven architectures — data lake and data warehouse. Think of it as efficiency, reliability and capabilities of a data warehouse with structured, semi structured and unstructured data on a commodity hardware. IBM watsonx.data is a data management solution for collecting, storing, querying, and analyzing all your enterprise data, stored on disparate data sources, with a single unified data platform. It provides a flexible and reliable platform that is optimized to work on open data formats. IBM watsonx.data has multiple layers, viz. storage, catalog and compute, and at each of these layers, it allows co-existence of various open source technologies and products.</p><p>We present this integration, with the help of an <strong>Identity Management Use case. </strong>Lets consider a scenario, where a customer has a mission critical application with highly sensitive information, and only a few stake holders around the world are allowed to login into the application. Every login detail such as userid, source IP, location, ISP, Source System and many other details are captured into the Kafka stream (although for the sake of simplicity, we are just recording “<em>login failed / success</em>” in the Kafka stream). This Kafka stream is a managed service on IBM cloud. Now, such applications with sensitive information are always under constant cyber attacks like brute force password attacks, DOS attack, and it is important to detect abnormal or unsuccessful login sooner. Hence, towards the end of the day, the security administrator of the organization works in tandem with the data engineers to get the streaming data for all the successful and unsuccessful logins for that day using watsonx.data. Additionally, they might also want to integrate a few analytics tool with watsonx.data to drill down further.</p><p><strong>Implementation</strong>: For ease of understanding, we have divided this blog into 4 sections:</p><ul><li>Configuring Kafka on IBM cloud.</li><li>Deploying IBM wastonx.data as an instance on Cloud Pak for Data platform, on Red Hat openshit platform.</li><li>Integrating and configuring Kafka as a data source within watsonx.data.</li><li>Querying and Analysis.</li></ul><h4><strong>Section 1: Setting up Kafka in IBM cloud:</strong></h4><p>· Login into <em>cloud.ibm.com</em>, and search for the “<strong>Event Stream</strong>” in the catalog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*MiIcXrMFzvL_H3_GjAtVmA.png" /></figure><ul><li>Create a new <em>Event stream</em> resource, and select a lite plan, in case you are just trying out this integration. It is available for free.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*4criDrXm-V7h7AlJzJRmcQ.png" /></figure><ul><li>Once the resource is created, it is added to the <strong><em>Integration</em></strong> section of the resource list.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*RrV4jupfIPc6jdhejPwVDQ.png" /></figure><ul><li>Open the resource</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*7zaELAexGYQt2-Nh0X23AQ.png" /></figure><ul><li>Create a topic, which can be used to store events. In a lite version, you will be allowed to create just one topic per instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*qOjrj9k5bAGHNo_JPm9TVA.png" /></figure><ul><li>Create partitions within topic (we can leave it as 1 for our test purposes)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*UWq6MVmwgn_3Vf8R6EYiCg.png" /></figure><ul><li>Choose a message retention duration. Since we are testing the integration, we might just retain the messages for a day.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*EkZ7Fqt9PYkB30lAlld-tw.png" /></figure><ul><li>Create a service credential. This would allow us to subscribe to this data source and access the contents externally. It also lists all the brokers which can used to subscribe to this topic.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RCt4VMCAMolLTOZgib2tnw.png" /></figure><ul><li>Alternatively<strong><em>“connect to service” </em></strong>button would list the brokers that can be used to connect to the service.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*HItBrqcRoWexI3IdrEmaIw.png" /></figure><ul><li>On the home page of the <em>event stream</em>, there is a tile which lets you create and execute a sample application,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*6Jc-H3tB1BmLGNTg2d3uTQ.png" /></figure><ul><li>Click on the tile, and it lists a set of instructions to setup and execute the sample application, which creates a producer and a consumer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*81_EXTyBwWaQq7NoThVQ8A.png" /></figure><ul><li>Once the sample application is running, it shows up a screen as follows. One can produce and consume messages here. Please note, once it starts producing the message, until the stop button is clicked, it shall continue to push messages into the stream. To simulate the login scenario described in the introduction above, a few “login successful” and “login failed” messages were published into the Kafka stream.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5N3AgYQTB0GDFme_NmZklg.png" /></figure><h4><strong>Section 2: Setting up watsonx.data on CP4D on an RHOCP cluster:</strong></h4><p>If you already have CPD environment, deploying IBM Watsonx.data is very easy and can be installed unsing cpd-cli.</p><pre>cpd-cli manage login-to-ocp \<br><br>--username=${OCP_USERNAME} \<br><br>--password=${OCP_PASSWORD} \<br><br>--server=${OCP_URL}<br><br><br><br>cpd-cli manage apply-olm \<br><br>--release=${VERSION} \<br><br>--cpd_operator_ns=${PROJECT_CPD_INST_OPERATORS} \<br><br>--components=watsonx_data<br><br><br><br>cpd-cli manage apply-cr \<br><br>--components=watsonx_data \<br><br>--release=${VERSION} \<br><br>--cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \<br><br>--block_storage_class=${STG_CLASS_BLOCK} \<br><br>--file_storage_class=${STG_CLASS_FILE} \<br><br>--license_acceptance=true</pre><p>For more information, please refer to the following link:<br><a href="https://www.ibm.com/docs/en/watsonxdata/1.1.x?topic=openshift-installing">https://www.ibm.com/docs/en/watsonxdata/1.1.x?topic=openshift-installing</a></p><h4><strong>Section 3: Onboard Kafka as a datasource within watsonx.data and query using Presto engine</strong></h4><p>Once we are done with the installation and creation of a Lakehouse instance (watsonx.data) in Cloud Pak for Data (CP4D) platform, we can continue to configure access to the distributed event stream. Login into the CP4D platform as the administrator.</p><ul><li>Open lakehouse instance. It will open watsonx.data UI Console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9lA04p0QoIkc00J976PTg.png" /></figure><ul><li>Go to Infrastructure manager</li><li>Add a new database connection of the type — <strong>Apache Kafka.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ZjUfkQWar4t8VxEUEEGPw.png" /></figure><p>In the configuration dialog box, provide the following details,</p><ul><li><em>Hostname</em><strong>: </strong>provide hostnames of all the brokers. Please see the ‘+’ sign above the ‘Port’. Since a topic might be partitioned across multiple brokers, it is important to add all the brokers.</li><li>Enable <em>SASL</em> connection</li><li><em>Username and password</em> can be obtained from the service credentials created earlier during Kafka configuration</li><li>Specify the <em>catalog name</em> as per your choice</li><li>Register the catalog by clicking ‘<em>Register</em>’ button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*p5Dn6_PlmpPWnntyg86AjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*NkYioSrVp5j9uHbaSRWLnw.png" /></figure><ul><li>Once the catalog is added, associate it with the Presto engine. After the engine restarts, go to the “<strong>data manager”</strong> page and you would find the Kafka catalog is added with ‘default’ as the schema name, and the topic name as the table name,</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E0vWYyrIXm774bpJSXodKg.png" /></figure><ul><li>The “<em>data sample</em><strong>” </strong>would show the sample data inserted via the sample java code earlier.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NDdUJhwiW8hqgGbKa2eN9Q.png" /></figure><p>Unless the data retention period is set to “forever”, the data in the Kafka stream would be removed after the retention period is over. We might want to create an iceberg table to persist the data in our data buckets. Well in this case, I use my Minio iceberg catalog to create a new table and offload data from Kafka stream into the iceberg table, based on timestamps. This can be done at regular intervals before the retention period gets over, in my case, at the end of each day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTd1H5lejBFVU-mxqYf-Mg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2YqaSyDn8-V38gFeme0wA.png" /></figure><h4><strong>Section 4:</strong> <strong>Querying and Analysis</strong></h4><p>Use the “Query Workspace” to execute an SQL query on the data stored within the Kafka as if it were a regular database table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MvAiQRnfIyPXyVa9ad9ZXg.png" /></figure><p>The same query can now be used on the iceberg table that we created above, to fetch the data that is no longer available in Kafka post the retention period is over.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WRe42RHUVd24BDkxpREjAw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6f676178f24" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>