<?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[TechMintMedia - Medium]]></title>
        <description><![CDATA[AI and Human based Tech Paper crafted for you. If you are an Engineer, CTO, Entrepreneur, then this Paper is just for you. Explore AI, Machine Learning, Kubernetes, Cloud and BigData. - Medium]]></description>
        <link>https://medium.com/techmintmedia?source=rss----c7a24aca648a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>TechMintMedia - Medium</title>
            <link>https://medium.com/techmintmedia?source=rss----c7a24aca648a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 08:09:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/techmintmedia" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Observability is must]]></title>
            <link>https://medium.com/techmintmedia/observability-is-must-89e4cfaf3df?source=rss----c7a24aca648a---4</link>
            <guid isPermaLink="false">https://medium.com/p/89e4cfaf3df</guid>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Mon, 15 Aug 2022 19:59:33 GMT</pubDate>
            <atom:updated>2022-08-20T09:16:02.453Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microservice Observability is must</h3><h4>Microservice and Distributed Apps — Observability</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJHbcqYSzbtOrXX59ok7og.png" /></figure><p>Today we are going to talk about modern microservice and distributed application monitoring and debugging. What are the standard practices to be followed which are accepted globally. Open Source tools and technology which is adopted by many companies across the globe. We will talk about multiple programming languages, frameworks, frontend and backend technology which need monitoring and debugging. We will talk about Observability which can be applicable to distributed system like Microservice Application backend, BigData and machine learning.</p><p>Also we will try to understand in simpler terms.</p><h3>Let’s understand Metrics and Trace</h3><p>Metrics, we specifically mean the class of information that allows you to talk about the performance of a system, it could be different components of a single app or a cluster.</p><p>Metrics are always counters in the form of numeric. So when we say metrics, that means it’s already aggregated. We have only abstract information. For example metrics is like website response time is “100 ms”. Other examples like last 5 minutes system has 10k new traffic. These numeric data about your application and system are Metrics.</p><p>Where as Tracing contains information ( not counters or figures), for example inside trace data we will find TraceId, client IP address, service name, datetime, payload size etc. If we will talk about distributed tracing, it will give you full information about a request. It may or may not contains all the micro-service details that request went through to serve the final response.</p><p>In Modern Application and system we need metrics as well as distributed tracing (Aka Trace). Metrics give us current performance indicator of our application where as distributed tracing helps of analyzing problem if performance goes down or debugging something on live system. Both can be Realtime data or near Realtime data depends on what you have implemented.</p><h3>Tracing, Metrics and Monitoring</h3><p>Let me tell you, neither tracing nor metrics are new. Metrics and Tracing are used in microservices but way before that tracing and metrics was there and was getting used by larger applications ( single service or monolith application or system monitoring ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*8ZonkDeY4_i8gVH2FQP3nQ.png" /></figure><p>Monitoring is used to monitor your systems performance and discover the particular areas that having some issue or need your attention. It’s basically reactive mode. You monitor your system and application so that you can take action when something goes wrong.</p><p>Observability giving you the insight to see how each piece of your system fits together (micro-services) so you can determine what to look at when it matters most. Let’s say you want to see which component/microservice which are making site slow. Mostly observability gives your answer to your question, where as monitoring has got only abstract information. It’s more to proactive mode.</p><p>In the Observability space, 4 cloud native standard has been involved in the recent year</p><ol><li>OpenTracing</li><li>OpenCensus</li><li>OpenMetrics</li><li>OpenTelemetry</li></ol><p>OpenTelemetry is trying to solve bigger problem, OpenTelemetry combines OpenTracing, OpenCensus and OpenMetrics and making as single industry cloud native data format standard for Observability area.</p><p>Already OpenTracing is implemented in OpenTelemetry and currently at stable state. OpenCensus is all-most at the edge of stable condition of implementation. Implementing OpenMetrics just began. Out if 3 OpenMetrics is bit different, as OpenMetrics is trying to enforce Prometheus standard at the facto standard for Metrics data format.</p><p>Let’s now consider Observability</p><h3>Observability</h3><p>3 pillars of Observability are Logs, Metrics and Trace. You can call a system is implemented with Observability, that means you are already using techniques, tools and technology to generate logs, metrics and Traces. It could be 1 platform that you are using or you are using multiple tools and technology to generate all 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*msl8JvGz9hWhA8l4B7VWEA.jpeg" /></figure><p><strong>Observability </strong>is the ability to measure the internal states of a system by examining its outputs. A system is considered “observable” if the current state can be estimated by only using information from outputs — That means there should be way to analyze system that it is working as expected or not from a indicator or metrics or something similar.</p><blockquote><em>Don’t confuse your-self with Observability and Monitoring Observability is a property of that system, like functionality or testability where as Monitoring is an action you perform to increase the observability of your system.</em></blockquote><p>I know, my last highlighted paragraph has confused you a bit. So let’s simplify. There should be way in your system where I can look at metrics at any given point of time ( like dashboard ), from there I suspect if anything going wrong (low speed or drop traffic or higher error rate, slow response time), from there I can pick one instance and search for different traces ( like list of request), then by clicking that I can see details logs ( Exact log of that request). This is basically part of observability. Monitoring in the other hand, you are trying to monitor your system for performance, downtime, service-restart etc and gets alerts if that happens.</p><p>Observability combines trace, metrics and logs for microservice to microservice communication, DB communication, Message-Queue communication etc. So anything happening inside the system, so you should have clear metrics, trace and logs for it. That fulfills Observability.</p><h3>Is there any Open Source tool which I can use to create Observability ?</h3><p>Among the best Opensource Observability back-end are Jaeger, Zipkin and Prometheus. Jaeger and Zipkin will be used for OpenTracing, Prometheus is for Metrics and you can use ELK stack for logging. There is new comer to the list is under Apache called “ Apache Skywalking “. I personally like the tool but not tested yet. Apache Skywalking gives you single platform for metrics, trace and logging. If you don’t want to use Apache Skywalkinh then you have to use 3~4 tools to implement observability in your platform.</p><p><strong>What is Open Telemetry and how it related to Observability ?</strong></p><p>Recently (in 2021) Observability data format got standardized and the given name was “OpenTelemetry”, which means there is a specific project and maintainer who maintains standard required for Observability and they are called OpenTelemetry data format and standard. OpenTelemetry combines <a href="https://opentracing.io/">OpenTracing</a> and <a href="https://opencensus.io/">Opencensus</a> project and comes to an conclusion of single data telemetry format to generate Metrics, Trace, Logs and Events. Before OpenTelemetry, every tools coming for Observability was trying to enforce different format as per their need, which was promoting vendor lock. That means if you are X tool, then you have to use X tool forever until you are reimplementing newer Y tools format in your code.</p><p>If you are using OpenTelemetry format, that means your application and system is generating OpenTelemetry data format which can ingested to any backend system for further analysis. OpenTelemetry generate a data format called OTLP but it can generate a vendor specific data format. So OpenTelemetry allows you switch to any Observability platform or backend without code changes, so technically there is no vendor lock-in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*w67GlJzvtbYLW_rjEEi5kQ.png" /></figure><p><strong>Note </strong>— Even-if I am saying its standardized, its not IEEE standard, rather CNCF supported project. That’s how Cloud Native ecosystem works.</p><blockquote><em>So if you are planning to start Observability for your system, please use OpenTelemetry at your client side and choose any platform or backend to store data.</em></blockquote><p>Till 2022, you will find tons of application are using OpenTracing as tool for Observability. But now OpenTracing it-self is asking to use Observability. List of vendor supporting OpenTelemetry are here <a href="https://opentelemetry.io/vendors">natively supported by a number of vendors</a>.</p><p>Trace and Metrics are stable in OpenTelemetry current implementation. But logs are not part of current SDK. To implement OpenTelemetry OTLP format logs, you need to relay on Some logging tools/library which are using OTLP logging format as a collector. For example LOG4J. OpenMetrics is still not standardized and under active development in OpenTelemetry.</p><h3>How i can start Observability ?</h3><p>To start using OpenTelemetry, there are 2 types of implementing OpenTelemetry</p><ol><li>Manual Instrumentation ( You have to use OpenTelemetry package inside your code to generate Metrics, Trace and Logs, you have to write code specifically related to OpenTelemetry data generation)</li><li>Auto Instrumentation ( OpenTelemetry will auto generate Metrics, Trace and Logs for you)</li></ol><p>You can check your framework documentation, how it allowing you to use OpenTelemetry.</p><p>List of reference for Java and python based application.</p><ul><li><a href="https://spring.io/projects/spring-cloud-sleuth">https://spring.io/projects/spring-cloud-sleuth</a></li><li><a href="https://github.com/spring-projects-experimental/spring-cloud-sleuth-otel">https://github.com/spring-projects-experimental/spring-cloud-sleuth-otel</a></li><li><a href="https://quarkus.io/guides/opentelemetry">https://quarkus.io/guides/opentelemetry</a></li><li><a href="https://github.com/quarkusio/quarkus-quickstarts/tree/main/opentelemetry-quickstart">https://github.com/quarkusio/quarkus-quickstarts/tree/main/opentelemetry-quickstart</a></li><li><a href="https://opentelemetry-python.readthedocs.io/en/latest/">https://opentelemetry-python.readthedocs.io/en/latest/</a></li><li><a href="https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/flask/flask.html">Python Flask</a></li></ul><p>For more information, you can check following supported programming languages, which has Auto instrumentation support.</p><p><a href="https://opentelemetry.io/docs/instrumentation/">Instrumentation</a></p><h3>More information about Jaeger, Zipkin and Prometheus</h3><p><strong>#1 Where they store their data — Storage solution</strong></p><ul><li>Jaeger stores in Cassandra 3.4+ and Elasticsearch 5.x/6.x/7.x</li><li>Jaeger current experiments with other databases, such as ScyllaDB, InfluxDB, Amazon DynamoDB, Logz.io</li><li>Cassandra and Elasticsearch are the primarily supported storage backends by Jaeger.</li><li>Zipkin was originally built to store data in Cassandra, but it later started supporting Elasticsearch and MySQL too</li><li>Prometheus has its own timeseries database inbuilt. It stores data persistent to disk.</li></ul><p><strong>#2 Data Format supported by each tool</strong></p><ul><li>Zipkin format supports Thrift, JSON v1/v2 and Protobuffer</li><li>Zipkin API <a href="https://zipkin.io/zipkin-api/#/default/post_spans">https://zipkin.io/zipkin-api/#/default/post_spans</a></li><li>Common ways to send data to Zipkin is via http or Kafka</li><li>Jaeger supports Protobuf for gRPC</li><li>Jaeger also support thrift/JSON format over Http</li><li>Zipkin format is also supported by Jaeger. That means if you are using Zipkin and wants to migrate to Jaeger then its easy.</li></ul><p><strong>#3 Companies behind each tool</strong></p><p>Jaeger is based on Go Lang (was originally built by teams at Uber) — for per service tracking called spans</p><p>Zipkin is based on java (Zipkin was originally inspired by Google’s Dapper and was developed by Twitter). Zipkin is a much older project than Jaeger</p><p>Prometheus is developed by SoundCloud</p><p><strong>#4 What else beyond Zipkin, Jaeger and Prometheus.</strong></p><p>Well there are lot of SaaS platform, which make our life easy for observability. But it’s all paid service, you have to pay for it to store and analyze your data. Also data will not be stored in house or your cloud cluster, rather it will be stored in their system.</p><p>Following are few best SaaS platform for Observability. They all started supporting OpenTelemetry OTLP format. Also they have their own system of data collection i.e. platform specific instrumentation. I personally used Splunk and Datadog.</p><ul><li>Splunk</li><li>Dynatrace</li><li>Datadog</li><li>New Relic</li><li>Sentry</li><li>Logz.io</li></ul><p>Following diagram shows, how Datadog platform can use OpenTelemetry instrumentation or datadog own instrumentation agent. It depends how you use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Oetp6TZl1Fhm4WTTpnrtA.jpeg" /></figure><h3>Challenges and Solution</h3><p>How current system is using Complex Setup for Observability</p><p>Challenges</p><ul><li>There is no way to link co-relation between multiple observability system like Jaeger and Prometheus and Elastic Search.</li><li>Still its multiple tools are used to complete the observability setup. There are platforms which combines all 3 but they are paid like <a href="http://datadoghq.com/">DataDog</a> and <a href="http://splunk/">Splunk</a>. Of course we have Apache Skywalking which is OpenSource and gives same kind of capability for Observability.</li></ul><p>Following diagram illustrates, current challenges and how big product has done their setup for Observability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/822/1*QGawhroWFc7bsXQ6Hiy6ww.jpeg" /></figure><p>This is how application these days are implemented Logging, Tracing and Metrics collection. So for logging we are using different agent, for tracing we are using different agent and for metrics we are using different agents. As an Example you can say logstash is using as log collector and stored on Elastic Search. jaeger agents are used to collect distributed traces. Prometheus agents are used to collect metrics and store on Prometheus or influxDB.</p><h3>What is the way forward solution to above problem</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P3SvFTkXBMFtSWJFk2iQog.jpeg" /></figure><blockquote><em>The conclusion is, OpenTelemetry solved the problem of Tracing and Metrics, to enforce standard. But Logs part still under development and it will be fixed soon.</em></blockquote><h3>Tool that we discussed, here are the links and quick code snippet</h3><h3>Jaeger</h3><p>Jaeger started supporting OpenTelemetry starting version <a href="https://github.com/jaegertracing/jaeger/releases/tag/v1.35.0">Jaeger v1.35 release</a>. In this version Jaeger introduced the ability to receive OpenTelemetry trace data via the <a href="https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md">OpenTelemetry Protocol (OTLP)</a>. Also along with that Jaeger announced its client SDK retirement as OpenTelemetry client will replace it.</p><p><a href="https://www.jaegertracing.io/">Jaeger: open source, distributed tracing platform</a></p><p>Quickest way to start Jaeger in your system</p><pre>docker run -e JAEGER_DISABLED=true -e COLLECTOR_OTLP_ENABLED=true -p 16686:16686 -p 4317:4317 -p 4318:4318 jaegertracing/all-in-one:1.37</pre><p>Now send some OTLP data to Jaeger backend and keep exploring Observability.</p><h3>Apache SkyWalking</h3><p>Apache SkyWalking is a Modern OpenTelemetry backend which can store metrics, trace send my openTelemetry collector and exporter.</p><p><a href="https://skywalking.apache.org/">Apache SkyWalking</a></p><p>Apache SkyWalking accepts both trace and metrics data.</p><h3>Zipkin</h3><p>Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in service architectures. Features include both the collection and lookup of this data.</p><p><a href="https://zipkin.io/">OpenZipkin · A distributed tracing system</a></p><pre>docker run -d -p 9411:9411 openzipkin/zipkin</pre><h3>Prometheus</h3><p>Prometheus deals with metrics where as Zipkin and Jaeger deals with Distributed tracing. So you can use Jaeger for distributed tracing but as there is no support for metrics data on those tools, you have to choose tools which can handle metrics, for that we have prometheus. prometheus it-self is a timeseries database plus software ware which can handle metrics data and same can be integrated with Visualization tool like Grafana to data visualization.</p><pre>docker run <br>    -p 9090:9090 \<br>    -v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml \<br>    prom/prometheus\</pre><p>you also need to setup Grafana and Alert manager with Prometheus.</p><p>I have not gone very detailed about any language specific implementation. But I can write that in another article. So far Observability from OpenTelemetry prospective should be very clear.</p><p>Thanks for Reading. Don’t forget to share it if you find it informative.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89e4cfaf3df" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/observability-is-must-89e4cfaf3df">Observability is must</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning in Browser using JavaScript]]></title>
            <link>https://medium.com/techmintmedia/machine-learning-in-browser-using-javascript-8e252a21db62?source=rss----c7a24aca648a---4</link>
            <guid isPermaLink="false">https://medium.com/p/8e252a21db62</guid>
            <category><![CDATA[games]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sun, 03 Jul 2022 15:00:35 GMT</pubDate>
            <atom:updated>2018-05-15T16:29:44.156Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>First Thing First:</strong> Google has released a new JavaScript Eco-System “TensorFlowJS” (combined list of the JavaScript library) which allows developers to use Machine Learning directly in Browser without any code written in the backend. This has support for all major browser. You can use this tool to use Machine Learning on WebSites/Web Apps and NodeJS. Machine learning in Browser is not something new, but recently DeepLearningJS has been renamed to TensorFlowJS. Now Google is doing further development on TensorFlowJS to support more features in near future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*cSZisHLnLP4GbchU8tHetQ.gif" /></figure><p><strong>Quick Intro:</strong> TensorFlow Library is very famous for Machine Learning implementation and holding complete Eco-System to train/test model at higher scale up to Production. we can use Python, Java, C and Go Programming to use TensorFlow in our project. Now Google has released TensorFlowJS as JavaScript Implementation of Tensor Flow to solve a large scale problem in Web Browser and JavaScript.</p><ul><li>Machine Learning in Browser is something new and it can solve many problems</li><li>Running machine learning in the browser in easy and low cost</li><li>Help Teachers to teach Machine Learning to Kids in the more simpler way</li><li>Machine Learning directly on the browser in Real-time using Android/iOS Sensors, GPS, Audio, Video, and Camera — Just using Browsers.</li><li>Easy to maintain and new Era in JavaScript</li></ul><h3>Introduction to TensorFlowJS</h3><p>Whatever browser you are using, it is running on top of an Engine like WebKit, Chakra, GecKo. Each engine in the different browser runs with the supported library, we have a pre-built 3D library already integrated into browsers so that modern browser can take a power of the web and up-to-day standards. WebGL is library already installed/integrated into all modern browser. To test whether your browser in WebGL enabled or not, go to this link, if you see a spinning Cube then Congrats your browser is a modern browser which has support for WebGL. Click this link to test whether your browser is supported WebGL or not.</p><p><a href="https://get.webgl.org/">https://get.webgl.org/</a></p><p><strong>WebGL Definition (Wiki):</strong> WebGL is integrated completely into all the web standards of the browser, allowing GPU-accelerated usage of physics and image processing and effects as part of the web page canvas. <strong>WebGL</strong> (<strong>Web Graphics Library</strong>) is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible Browsers. Technically It is OpenGL ES implementation in Browser. Just to give you a higher picture, there is a list of the browser which has support WebGL and We can use TensorFlowJS in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*bGNsVb5fO1MFY3JNwnHXwA.png" /></figure><p><strong>What we can do with TensorFlowJS:</strong></p><p>Let’s think about some real-world example of TensorFlowJS on Browser which can open a whole new world for developers and Companies to use AI in the browser without any coding in the backend.</p><ul><li>Build AI Games in Browser like using Your Camera</li><li>Build Face Detection Web Apps without any Machine Learning Code in Backend</li><li>Get InSights from the browser, like what your customers are doing in the browser.</li><li>Improve advertisement for the targeted customer in NEAR REAL TIME. Which was not possible before.</li></ul><p>Let’s discuss some technical details about TensorFlowJS:</p><ul><li>You can use your Existing Python/Java/Go Model Directly in browser (There is some official tool which will convert those existing Model to TensorFlowJS compatible Model — so that it will work on Browser.)</li><li>You can use Camera and Audio to train your TensorFlowJS Model and use it in Real-time. This can be done both in Web and Mobile Browser. For example, you can use your Camera in Browser to detect Objects around you.</li><li>You have Deep Learning Algorithm already available to work on Browser. Which solves the complex problem of AI.</li></ul><p>Let’s take an example PAC-MAN game in the browser. First, I trained machine learning with the different position of my face. So that I can control the Pac-man movement in 4 different directions. For example, if I move my face to left then Pac-man will move in the left direction, if I will move my face towards the right, then Pac-man will move in right. To do that first I will tell my machine learning about my different position of left, right, bottom and top. Then will play the game using Browser with Webcam enabled.</p><p><strong>Pro Tips: </strong>TensorFlow is a big eco-System, very time consuming to learn. Don’t dive directly into TensorFlow otherwise, you will be lost in the middle.</p><p>Wait for some time, so that TensorFlowJS will be matured and can be usable on Production Apps</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e252a21db62" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/machine-learning-in-browser-using-javascript-8e252a21db62">Machine Learning in Browser using JavaScript</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook free on Cloud for your data science job]]></title>
            <link>https://medium.com/techmintmedia/run-machine-learning-code-on-azure-cloud-for-free-34b32e99764c?source=rss----c7a24aca648a---4</link>
            <guid isPermaLink="false">https://medium.com/p/34b32e99764c</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sun, 03 Jul 2022 14:59:49 GMT</pubDate>
            <atom:updated>2018-06-08T15:06:46.661Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bizeI-s23pME9Xx708nDNQ.png" /></figure><p><strong>First-Thing-First:</strong> Do you have one or more <strong>Python </strong>or <strong>R Code</strong> for your Data Science work. Do You have huge dataset and don’t have enough space in your Laptop and workstation. You want to run your Data science Experiments in cloud for free. You want some powerful Cloud instances dedicated for your code execution for free. Microsoft has something for you called “<strong>Azure Notebook</strong>”. Sing-up with your Microsoft/outlook/hotmail id and start hosting your data, script, notebook and run everything for free.</p><p><strong>Why and Who needs Microsoft Azure Notebook Cloud solution</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*ElGT_g-ReBNjXSUE94PEEw.jpeg" /></figure><ol><li>Do you use Jupyter notebook for your Python or R Coding. It’s getting hard for your to maintain in local drive.</li><li>Are you storing all your Jupyter notebook in local hard drive</li><li>Are you storing all your jupyter notebook in Github</li><li>Do you want to play with other developer’s Notebook Code without installing or downloading in your laptop</li><li>Do you want to access your same code in your Personal Laptop, office Laptop or Workstation in a easy way.</li><li>Do you want to use powerful cloud computing for your data science job without paying anything from your credit card</li><li>Do you want to test Github code directly in browser without cloning/ installing in your Laptop</li><li>You have huge data set and don’t have any place to store. Might be in CSV or text or Blob or Image Format</li><li>Do you want to pull all publicly available data source and store some where in cloud.</li><li>Do you want to copy all Kaggle dataset and store in your cloud.</li></ol><p>If you are coming under any 1 out these 10 mention points. Then Azure Notebook is for you. Please continue reading and Do clap for me. It Inspires me to write more for you. You can click on Clap icon — bottom of this page.</p><h4>Getting Started with Microsoft Azure Notebook in Cloud</h4><p><strong>Step -1 (Open one Account): </strong><a href="https://notebooks.azure.com/">https://notebooks.azure.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ura2Uik5Y6tpY9WRab-CnQ.gif" /></figure><ol><li>Goto <a href="https://notebooks.azure.com/">https://notebooks.azure.com/</a></li></ol><p>2. Sign-in With your Outlook or hotmail id (eg. something@outlook.com )</p><p>3. In the popup box choose a friendly username for your account</p><p>4. Click on Library</p><p><strong>Step -2 (Create a new Notebook in Azure Notebook )</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhQXOfY6DB8SaCKvAiF4IA.gif" /></figure><ol><li>Go to Library</li><li>Click on New Library</li><li>Give a Name and Id</li><li>Click on New and give a name for ipynb file and select Python 3 and Create</li><li>Within few Seconds notebook will open for you</li></ol><p><strong>Step -3 (Import Packages or Install New Python packages)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wLGZ8mtkDe9YsdiQi3o3A.gif" /></figure><ol><li>Most of the Data Science packages are already pre-installed</li><li>Just import any package and start writing your code</li><li>In-case any required package is missing, you can install it using following syntax. Ohhh my god. “<em>YES you can install any python package</em>”.</li></ol><blockquote><em>!pip install package-name</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*adJfIy0Hrw5U-SGA" /><figcaption>“Man in a Patagonia hat and tattoos sitting by rows of flower bushes” by <a href="https://unsplash.com/@sethdoylee?utm_source=medium&amp;utm_medium=referral">Seth Doyle</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Step -4 (Import/Upload Dataset)</strong></p><p>You can download CSV data set directly to Library or Upload those from your computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ycfLirSX5fso3LmAGMM9KQ.gif" /></figure><p>Follow this easy step to upload dataset (any format) to your library</p><p>Directly access those dataset from your notebook. As easy as you can refresh your browser :)</p><p><strong>Step -5 (Pull any iPython Notebook from github and run it on Azure)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IUfpJhX42US-9FGjsBZx5Q.gif" /></figure><p>Goto Github and search for python source code repo which has ipynb format. Just copy that URL and paste in New windows on Azure cloud. Notebook will be copied to your Azure Library. Directly run it on Azure cloud in fraction of seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rS8lyVrwYEX7EsTJ" /><figcaption>Photo by <a href="https://unsplash.com/@acharki95?utm_source=medium&amp;utm_medium=referral">Aziz Acharki</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>That Magic !!!</p><p>What’s in future:</p><p>Might be it will be paid in future. As a developer continue using it. We love Free and open Source.</p><p>We have another very good tool called Google Colab, but i don’t see this many feature there. Although in Google Colab you can install any packages and save your code to your Google Drive.</p><p>Happy R&amp;D Flocks</p><blockquote><strong>Follow me on Twitter</strong></blockquote><p><a href="https://twitter.com/bikashkumars">https://twitter.com/bikashkumars</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34b32e99764c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/run-machine-learning-code-on-azure-cloud-for-free-34b32e99764c">Jupyter Notebook free on Cloud for your data science job</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes — Things you should know]]></title>
            <link>https://medium.com/techmintmedia/kubernetes-things-you-should-know-1d0ba25d5f74?source=rss----c7a24aca648a---4</link>
            <guid isPermaLink="false">https://medium.com/p/1d0ba25d5f74</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[cloud-native]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sun, 19 Jun 2022 07:17:08 GMT</pubDate>
            <atom:updated>2022-04-02T19:05:14.255Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes — Things you should know</h3><h4>Internal working mechanism of Kubernetes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*B05pbIVNN9K-OzVIjyFr-Q.png" /></figure><p>I have been working on Kubernetes and deploying cloud-native apps for over 6 years now. Being at both ends of Cloud-Native Apps where I design/develop and deploy. Seen the transition from the most difficult way of on-prem K8s deployment to managed services like EKS and AKS. Here I am sharing my experience and things you should know about Kubernetes.</p><p>This is the Part-1 of this series. I will be releasing around 4 more articles on this topic.</p><blockquote><em>This content targets both cloud and on-prem Kubernetes deployment. Some content may not required for services like AKS, EKS, as internal things are managed by AWS and Azure.</em></blockquote><p>Fact: Kubernetes is also referred to as K8s, not k8s :) — this was just a fun fact.</p><p>What we are going to cover in this article</p><ul><li>Fun with K8s</li><li>Any K8s playground which I can use to play with K8s</li><li>Vendors who can help to kick-start Kubernetes for your new Product/application</li><li>etcd database of K8s and how it’s effective</li><li>Kubernetes API life cycle</li><li>CRI and K8s is dropping docker-engine support</li><li>Node affinity and anti-affinity</li><li>Forum</li></ul><h3>#1 Fun with K8s</h3><p>Can I visualize my K8s cluster in 3D :) Yes you can, watch out the demo here (Please don’t use it for production)</p><p><a href="https://afritzler.github.io/kube-universe/web/demo/">https://afritzler.github.io/kube-universe/web/demo/</a></p><h3>#2 From where I can play with Kubernetes</h3><p>Online playground</p><ol><li><a href="https://labs.play-with-k8s.com/">https://labs.play-with-k8s.com/</a></li><li><a href="https://www.katacoda.com/">https://www.katacoda.com</a>/</li></ol><p>Offline single node K8s ( you need to install)</p><ol><li><a href="https://kind.sigs.k8s.io/">https://kind.sigs.k8s.io/</a></li><li><a href="https://www.docker.com/products/docker-desktop">https://www.docker.com/products/docker-desktop</a></li><li><a href="https://minikube.sigs.k8s.io/docs/start/">https://minikube.sigs.k8s.io/docs/start/</a></li></ol><h3>#3 Can I use Kubernetes for my Apps deployment without knowing it</h3><p>There are platforms like OpenShift and cloud foundry which are built on top of Kubernetes. This platform gives you an abstraction layer for engineers to focus on engineering problems and App deployment rather than focusing on and knowing what is Kubernetes and how to configure it. But these platforms are built heavily on K8s.</p><p>If you don’t have Kubernetes engineers in your team, you can take help from the following list of companies listed on CNCF. Who can help you doing K8s setup ( of course they will charge you for their service) <a href="https://www.cncf.io/certification/kcsp/">https://www.cncf.io/certification/kcsp/</a></p><h3>#4 Kubernetes Database</h3><p>Yes, Kubernetes as an orchestration tool internally used a Database to store information. When you create an Object like Deployment, Pod, Service, Secrets — all such information are stored in etcd database. When you execute kubectl command, kubectl command talks to KubeAPI and KubeAPI request to binary ( internal K8s software ), then those binary extract information from etcd.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*uHGKJnowcV3X55EQ7wacyw.png" /></figure><blockquote><em>etcd is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines. It gracefully handles leader elections during network partitions and can tolerate machine failure, even in the leader node</em></blockquote><p>etcd Benchmarked at 1000s of writes/s per instance</p><p>Do you want to understand how practically etcd works ? let’s use this website playground to do some write, Read and Delete operation <a href="http://play.etcd.io/play">http://play.etcd.io/play</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f8hP8OHtJsSoATBdJiwXMg.png" /></figure><h3>#5 Kubernetes API life cycle</h3><p>The core of Kubernetes’ control plane is the API server. The API server exposes an HTTP API that lets end users, different parts of your cluster, and external components communicate with one another.</p><p>The Kubernetes API lets you query and manipulate the state of API objects in Kubernetes (for example: Pods, Namespaces, ConfigMaps, and Events).</p><p>Have you seen this ? for few objects you write alpha1 and for few write v1 and for others you write beta1</p><pre>apiVersion: kubelet.config.k8s.io/v1alpha1<br><br>apiVersion: v1</pre><p>When Kubernetes add new features, mostly it never release it as GA (General available), rather it goes through API life-cycle called alpha, beta, betav1, betav2 and GA (v1, v2 etc).</p><p>Each time you are upgrading kubernetes, you need to look at your YAML files, in-case any alpha API promoted to beta. Or any beta api promoted to GA. Based on that you need to make changes to your YAML files ( RAW K8s Object YAML files or Helm Chart ) to point to correct API version. As there might be cases that, K8s might deprecate the API it-self.</p><h3>#6 CRI: Container Runtime Interface</h3><p>Container is not all about Docker. There are a lot of container solution available, which can be used as Container engine/runtime for Kubernetes.</p><p>Out-of-box kubernetes is having a API layer called CRI, which promotes any container engine/runtime which can talk to K8s via CRI ( by means protobuf and grpc ) — kubernetes is going to support it. Kubelet communicates with the container runtime (or a CRI shim for the runtime) over Unix sockets using the gRPC framework, where kubelet acts as a client and the CRI shim as the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*qyCffDLOsX7UPc9rZgVs6g.png" /></figure><p>There are container runtime/engines like Docker, <a href="https://github.com/rkt/rkt">RKT</a> , <a href="https://cri-o.io/">CRI-O</a>, <a href="https://containerd.io/">containerd</a>. But still Docker is the default runtime for K8s till v1.23 and CRI is still under Alpha.</p><p>Starting from K8s 1.24, docker-shim is deprecated, means you can’t use Docker engine starting from v1.24 of K8s. So what’s next ?</p><p>For your local docker build and docker run you can use Docker engine. Also in your DevOps pipeline you can use Docker engine. But in actual kubernetes cluster, you can’t use Docker are runtime starting K8s v1.24.</p><p>There is a company called mirantis, who said it will maintain dockershim for kubernetes along with support from Docker. This OpenSource project will keep dockershim alive. <a href="https://github.com/Mirantis/cri-dockerd">https://github.com/Mirantis/cri-dockerd</a></p><p>If you are confused with, what is docker-shim, then docker-shim is a module in kubernetes which allows kubernetes to support docker runtime as container engine. But now kubernetes is removing that module from v1.24. So you need to either install cri-dockerd by your-self or use other engine like RKT or CRI-O.</p><h3>#7 Node affinity and anti-affinity</h3><p>Remember, life is easy until we have just 2~3 worker nodes. Once we will scale to 10 or 20 worker nodes and you are dealing with distributed app deployment then node affinity is very vital.</p><p>Do we really need to control pod schedule to particular nodes? well, the answer is YES.</p><ul><li>The special type of hardware requirement for specific pods. Imagine a situation where we have a powerful computing worker node with GPU and SSD. You want your Machine learning intensive pods to be scheduled on those high-power nodes. Or a pod responsible for high CPU/GPU computation like game engine. Also non ML pods not be scheduled to those Nodes. In that case you need Node affinity and anti affinity.</li><li>You want to deploy your kafka brokers in all available Availability zones on AWS for HA and fault-tolerant. Imagine a situation, where you are running 5 nodes on AWS AZ-1 and 5 nodes on AZ-2, you want 5 replication factors of your Kafka broker pods. There might be a case that, all those 5 pods will be scheduled on AZ-1 5 nodes and nothing will be scheduled on AZ-2. So even if you have an Availability zone setup, but due to the wrong strategy, your HA will fail in case of AZ-1 failure from the AWS side.</li></ul><p>How many ways we can do this</p><ol><li>Node selector ( easy but old way, define a key-value on node and pods should have that key-value in pod spec )</li><li>node affinity and pod affinity (This is the ability of pod to choose)</li><li>Taints and Toleration (This is the ability of nodes to reject pods )</li></ol><p>Node Selector way:</p><pre>kubectl label nodes node-abcd-name workerType=ssdgpu<br><br>apiVersion: v1<br>kind: Pod<br>metadata:<br>  name: nginx<br>  labels:<br>    env: test<br>spec:<br>  containers:<br>  - name: nginx<br>    image: nginx<br>    imagePullPolicy: IfNotPresent<br>  nodeSelector:<br>    workerType: ssdgpu</pre><p>So first we assign a custom key/value pair to worker node. Here we assigned as workerType as ssdgpu. Then in our Pod definition, we said, it should select worker having label as workerType = ssdgpu.</p><p>Node affinity (new way)</p><p>While defining pod Spec in YAML, you need to include nodeAffinity and shortly there are 2 types of affinity rule, 1st one is hard, if that doesn’t match then pod will not be scheduled to any worker nodes. soft affinity is like, this can be ignored by K8s scheduler if it doesn’t matches.</p><ol><li>requiredDuringSchedulingIgnoredDuringExecution (hard rule)</li><li>preferredDuringSchedulingIgnoredDuringExecution. (soft rule)</li><li>requiredDuringSchedulingRequiredDuringExecution (hard rule)</li></ol><pre>spec<br>  affinity:<br>    nodeAffinity:<br>      requiredDuringSchedulingIgnoredDuringExecution:<br>        nodeSelectorTerms:<br>        - matchExpressions:<br>          - key: az-name<br>            operator: In<br>            values:<br>            - az1<br>            - az2<br>      preferredDuringSchedulingIgnoredDuringExecution:<br>      - weight: 1<br>        preference:<br>          matchExpressions:<br>          - key: worker-hardware-type<br>            operator: In<br>            values:<br>            - ssd-gpu</pre><p>In the above example you can see, i am asking pod to be scheduled in availability az1 or az-2. It should be not scheduled to any other availability zone like az3 or az4. This was hard rule.</p><p>In the soft part i am asking to prefer worknode of type ssd-gpu with hard rule as either az1/az2.</p><p>Taints and Toleration:</p><p>This is bit advanced way of node selection, usually this is not widely followed.</p><pre>$ kubectl taint nodes node1 key1=value1:NoSchedule</pre><pre>tolerations<br>- key: &quot;key1&quot;<br>  operator: &quot;Equal&quot;<br>  value: &quot;value1&quot;<br>  effect: &quot;NoSchedule&quot;:</pre><p>First you need to configure worker node with the taint with key-value pair. This can simply done using kubectl command. Then in the pod spec you have to define the toleration. Any pod matching toleration of the node’s taint, then pod will be scheduled. One worker node can have multiple taints and any pod wants to be scheduled in that worker node, they have to match all the taints as part of tolerations spec.</p><p>Where to ask K8s questions:</p><p><a href="https://discuss.kubernetes.io/">https://discuss.kubernetes.io/</a> and of-course stack overflow.</p><p>Thanks for reading :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d0ba25d5f74" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/kubernetes-things-you-should-know-1d0ba25d5f74">Kubernetes — Things you should know</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka Internal Working Mechanism]]></title>
            <link>https://medium.com/techmintmedia/kafka-internal-working-mechanism-335d47bc471a?source=rss----c7a24aca648a---4</link>
            <guid isPermaLink="false">https://medium.com/p/335d47bc471a</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kafka-streams]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Bikash Sundaray]]></dc:creator>
            <pubDate>Sun, 19 Jun 2022 07:13:03 GMT</pubDate>
            <atom:updated>2022-06-19T07:13:03.616Z</atom:updated>
            <content:encoded><![CDATA[<h4>Some less explored area of Kafka</h4><p><strong>Kafka</strong>: Apache Kafka is an open-source distributed event streaming platform used for high-performance data pipelines, streaming analytics, data integration and message queue system. It’s open source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKTKq2z6NC058p3hjIBGBA.png" /></figure><p>Let’s explore the unknown and in-depth facts about Kafka.</p><h3>Even-if Kafka stores data on Disk how come it is fast and provides high throughput</h3><p>Kafka relies heavily on the filesystem for storing and caching messages. There is a general perception that “disks are slow” which makes people skeptical that a persistent structure can offer competitive performance. In fact disks are both much slower and much faster than people expect depending on how they are used; and a properly designed disk structure can often be as fast as the network.</p><p>Kafka depends on Operating system Page Cache. Page cache is like files/data written to Disk, its index/meta cached on Ram by Operating system. Kafka takes the advantage of this. Kafka internal code gets the message from producer, then it writes to memory (page cache) and then it writes to disk. This is archived by Sequential I/O which is provided by all modern OS. You can read more about Sequential I/O on internet.</p><p>As Kafka is build on Java, you can read more about Oracle Java Documentation about Zero Copy Concept from Java side. Read about “transferTo()” method. <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html">https://docs.oracle.com/javase/7/docs/api/java/nio/channels/FileChannel.html</a></p><p>When SSL is enabled, zero copy optimization is lost, since the Broker needs to decrypt and encrypt the data. So use SSL for Kafka wisely. But Kafka didn’t mention this straight in their documentation.</p><h3>Do I need high Memory compute instance or Higher CPU cores instances for Kafka broker.</h3><p>You should choose a modern processor with multiple cores. Common clusters utilize 24 core machines. In-case you are planning to use encryption in transit within your broker and application, then definitely you need to add more cores comparing to your calculated number of cores. If you need to choose between faster CPUs and More cores, choose more cores. The extra concurrency that multiple cores offers will far outweigh a slightly faster clock speed. Also avoid Network storage disk rather go with actuary attached disk like AWS EBS or something similar like attaching hard-disk to Rack where you have kept your physical server.</p><p>On consumer side, also remember if your single consumer (Pod, container, Application) is required to handle data from multiple partition, then don’t forget to give more CPUs for better read performance.</p><p>Avoid the large machines because they often lead to imbalanced resource usage. For example, all the memory is being used, but none of the CPU. Also don’t go with small machines which push you to maintain more nodes (kafka broker) in your cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Yh3GK76TClGbkkNFDQETeg.png" /></figure><h3>Why Kafka leaving Zookeeper from 4.x ?</h3><p>Historically, Apache ZooKeeper was a critical part of how this distributed code worked. ZooKeeper provided the authoritative store of metadata holding the system’s most important facts: where partitions live, which replica is the leader, and so forth. The use of ZooKeeper made sense early on — it is a powerful and proven tool. For the first time, you can run Kafka without ZooKeeper starting from kafka v2.8 as preview mode. Where zookeeper will be replaced with a module called Kafka Quorum Controller based RAFT which will store all Metadata.</p><p>As part of new architecture Kafka will use new quorum controller, all metadata responsibilities previously undertaken by the Kafka controller and ZooKeeper are merged into this one new service called Quorum Controller. It is part of kafka it-self. The quorum controller can also run on dedicated VM if you have a use case that demands it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5OOhZPDr6HoI7WdukIvFQg.png" /></figure><p>The quorum controllers use the new KRaft protocol to ensure that metadata is accurately replicated across the quorum. This protocol is similar in many ways to ZooKeeper’s ZAB protocol. The new quorum controller is designed to handle a much larger number of partitions per cluster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7z9fh1C2ZiT64y5Ka8nI1Q.png" /></figure><p>Performance statistics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RI6b-QA6VsTajrqIDJeiw.jpeg" /></figure><p>Roadmap</p><ol><li>Kafka can run on preview mode (experimental/non-production) without zookeeper starting version 2.8</li><li>From Kafka 3.x you can run kafka without zookeeper or with zookeeper (option is there)</li><li>From Kafka 4.x, entire zookeeper support will be deprecated ( expected as of now )</li></ol><h3>Kafka Redistribution</h3><p>Even if Kafka is Opensource and Apache licensed, but there are several companies who offers Kafka on Cloud or improved/extended version of Kafka which comes with price and premium support. They maintain the original features of Kafka along with provides extended feature.</p><ul><li>Confluent: <a href="http://cnfl.io/ccloud">Confluent Cloud</a> (SaaS, fully managed) and <a href="http://cnfl.io/cplatform">Confluent Platform</a> (software download for self-managed/on-premise)</li><li>Cloudera distribution — <a href="https://www.cloudera.com/products/open-source/apache-hadoop/apache-kafka.html">https://www.cloudera.com/products/open-source/apache-hadoop/apache-kafka.html</a></li><li>EmblocSoft distribution and CPFA training — <a href="https://www.emblocsoft.com/pages/en/solutions/kafka/support/">https://www.emblocsoft.com/pages/en/solutions/kafka/support/</a></li><li>IBM Event Streams — <a href="https://www.ibm.com/cloud/event-streams">https://www.ibm.com/cloud/event-streams</a> — Apache Kafka on premise and the public cloud</li><li>Strimzi — <a href="http://strimzi.io/">http://strimzi.io/</a> — Apache Kafka Operator for Kubernetes and Openshift. Downloads and Helm Chart — <a href="https://github.com/strimzi/strimzi-kafka-operator/releases/latest">https://github.com/strimzi/strimzi-kafka-operator/releases/latest</a></li><li>TIBCO Messaging — Apache Kafka Distribution — <a href="https://www.tibco.com/products/apache-kafka">https://www.tibco.com/products/apache-kafka</a> Downloads — <a href="https://www.tibco.com/products/tibco-messaging/downloads">https://www.tibco.com/products/tibco-messaging/downloads</a></li></ul><h3>Kafka Eco-System</h3><p>Its not just installing Kafka with Zookeeper and start publishing and subscribing messages or stream data to Kafka. There is a big ecosystem which makes Kafka as on of the best message queue and streaming platform in modern Tech stack. Let’s explore the Kafka Ecosystem. Kafka provides following ecosystem.</p><ul><li>Kafka connect</li><li>Kafka Stream processing</li><li>Kafka Hadoop integration</li><li>Kafka integration with Oracle DB</li><li>Kafka on AWS</li><li>Kafka on Azure</li><li>Kafka on GCP</li><li>Kafka logging</li><li>GUI tools for Kafka</li><li>Metrics for Kafka</li></ul><h3>Does Kafka repeats same message which is already delivered to same consumer ?</h3><p>Well YES. was it shocking for you ?</p><p>Till kafka 2.x as zookeeper is the dependent service ( coordinator), so the Kafka works is like kafka stores metadata information in zookeeper for example each topic wise partition list and which consumer group has read up-to which offset. Also zookeeper maintainer the current leader of a partition.</p><p>But here is the catch ( Kafka does this as part of performance improvement )</p><blockquote><em>Kafka does not update Zookeeper with the message offset last read after every read, instead it waits a short period of time. Due to this delay it is possible that your logic has consumed a message and that fact hasn’t been synced to zookeeper. So if your client exits/crashes you may find messages being replayed next time to start.</em></blockquote><p>Also note that sometimes the loss of a Broker or other event that causes the Leader for a Partition to change can also cause duplicate messages to be replayed. So you should design your data critical application carefully.</p><p>Is there any solution to this problem ? Yes kafka do provides 2 types of consumer</p><ol><li>High level consumer — This is most widely used consumer style for kafka cluster. For these style of Kafka consumers, Kafka provides techniques like Consumer group, automatic offset commit, manual offset commit, not to worry about Kafka broker (auto broker discovery), not to worry about where is the partition is (broker name), not to worry about who is the current leader of the partition. Most generic subscriber/consumer group follow this consumer style like SpringBoot, Spring, Quarkus and other programming language kafka clients.</li><li>Low Level consumer — This is I would say less explored and uncommon area of Kafka consumer. This don’t provides consumer group that means you as consumer in your database need to maintain last read offset, so each time your consumer is going to ask messages from kafka, consumer should provide the offset. As a consumer you decide from which partition you need to read message. As a consumer you need to findout who is the current leader of the partition (Kafka broker), if that broker goes down, you need to findout who is the new broker. So it’s kind of very heavy self managed client/consumer to deal with Kafka data subscriber part. usually extreme mission critical application need to follow this way.</li></ol><h3>Kafka Compact Topic</h3><p>Can Kafka keep message forever ? The answer is Yes, Kafka can store message forever. Kafka provides topic wise configuration called “Compact topic” that means data retention of that topic will be “-1” means infinite.</p><p>As per Kafka definition: Log compaction ensures that Kafka will always retain at least the last known value for each message key within the log of data for a single topic partition. It addresses use cases and scenarios such as restoring state after application crashes or system failure, or reloading caches after application restarts during operational maintenance. For each unique message key it will retain only the last published message, other old message belongs to that key will deleted automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*kCzkvrvT-A6xEgpf65RKzQ.png" /></figure><p>But now the question is, evenif I am using compact type Kafka topic, lets say I want to delete a message from compact topic, is it still possible ? Answer is Yes</p><p>It’s possible to remove a message from a Kafka topic by publishing a new message with the key of the message we want to delete as null. The general tendency of kafka is that, if it finds any key with value as null, then it automatically it deletes that message. So in this way you can reduce the message size of compact topic. For this deletion kafka provides configuration as “delete.retention.ms”</p><h3>Kafka Mirror Maker ( Geo replication )</h3><p>Suppose you want to replicate your Kafka cluster data to another Kafka cluster then you need something called MirrorMaker. Usually for Disaster recovery this tool has been used.</p><p>Kafka’s mirroring feature makes it possible to maintain a replica of an existing Kafka cluster. MirrorMaker tool to mirror a source Kafka cluster into a target (mirror) Kafka cluster. The tool uses a Kafka consumer to consume messages from the source cluster, and re-publishes those messages to the local (target) cluster using an embedded Kafka producer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*vocQpMjZPDjNvjwlJQhsGw.jpeg" /></figure><p>Kafka administrators can define data flows that cross the boundaries of individual Kafka clusters, data centers, or geo-regions. With MirrorMaker you can monitor the status of Sync based on single topic or all topic just to monitor how replication is working.</p><p>When you should starting thinking about MirrorMake. Following are the high level use cases and need.</p><ul><li>Geo-replication</li><li>Disaster recovery</li><li>Feeding edge clusters into a central, aggregate cluster</li><li>Physical isolation of clusters (such as production vs. testing)</li><li>Cloud migration or hybrid cloud deployments</li></ul><p>MirrorMaker has way more configuration than you expect ( if you are new) . Let’s consider A being Kafka cluster-1 and B the 2nd Kafka cluster (same for C, D and K cluster). Following sync configuration is possible between multiple Kafka clusters.</p><ul><li>2 way sync between cluster ( Active-Active setup) : A-&gt;B, B-&gt;A</li><li>1 Way Sync ( Active-Passive setup) : A-&gt;B</li><li>Aggregation (from many clusters to one): A-&gt;K, B-&gt;K, C-&gt;K</li><li>Fan-out (from one to many clusters): K-&gt;A, K-&gt;B, K-&gt;C</li><li>Chaining or Forwarding: A-&gt;B, B-&gt;C, C-&gt;D</li></ul><p>MirrorMaker shell script “connect-mirror-maker.sh”, you can find inside “bin” folder of latest Kafka distribution.</p><p>Thanks for reading. Don’t forget to like this and share.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=335d47bc471a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techmintmedia/kafka-internal-working-mechanism-335d47bc471a">Kafka Internal Working Mechanism</a> was originally published in <a href="https://medium.com/techmintmedia">TechMintMedia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>