<?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 Vishwa Kalubowila on Medium]]></title>
        <description><![CDATA[Stories by Vishwa Kalubowila on Medium]]></description>
        <link>https://medium.com/@denuwankalubowila?source=rss-a420ebdc4be------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rfsA9AOEj5-KRQI4Pkj7tQ.jpeg</url>
            <title>Stories by Vishwa Kalubowila on Medium</title>
            <link>https://medium.com/@denuwankalubowila?source=rss-a420ebdc4be------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 06:35:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@denuwankalubowila/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[Demystifying Kubernetes Architecture: A Complete Guide to Control Plane and Worker Nodes]]></title>
            <link>https://medium.com/@denuwankalubowila/demystifying-kubernetes-architecture-a-complete-guide-to-control-plane-and-worker-nodes-b6f1ebfd27d7?source=rss-a420ebdc4be------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6f1ebfd27d7</guid>
            <dc:creator><![CDATA[Vishwa Kalubowila]]></dc:creator>
            <pubDate>Fri, 16 Jan 2026 00:32:48 GMT</pubDate>
            <atom:updated>2026-01-16T00:32:48.561Z</atom:updated>
            <content:encoded><![CDATA[<p>Last weekend, I joined an intensive 6-week Kubernetes workshop conducted by Tharindu Kalhara, a Developer Relations Engineer at certDirectory. The session covered Kubernetes fundamentals, architecture deep-dives, and core objects that power modern container orchestration. This article is the first in a series where I’ll share my learnings and insights from this workshop day 1.<br>Whether you’re a developer looking to containerize your applications or a DevOps engineer planning your infrastructure, understanding Kubernetes architecture is your foundation for success. Let’s dive in.</p><h4><strong>What is Kubernetes?</strong></h4><p>Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. At its core, a Kubernetes cluster consists of machines — either bare-metal servers or virtual machines — that work together to run and manage your containers.<br>Every Kubernetes cluster is divided into two fundamental node types:</p><ul><li><strong>Control Plane Nodes</strong>: The brain of your cluster, responsible for managing containers and maintaining the desired cluster state.</li><li><strong>Worker Nodes</strong>: The muscle of your cluster, responsible for running your actual containerized applications.<br>Let’s explore each component in detail and understand how they work together to create a robust orchestration system.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OZgwOs7t5P0H1o9vqtbkuw.png" /><figcaption>Kubernetes Architecture</figcaption></figure><h3>Control Plane Components: The Command Center</h3><p>The control plane makes critical decisions about your cluster and detects and responds to cluster events. Here are its essential components:</p><h4>1. Kube-API Server: The Heart of Kubernetes</h4><p>The kube-api-server is the central hub of your Kubernetes cluster. Think of it as the front desk of a hotel — every request, every interaction goes through it.</p><p><strong>What makes it special?</strong></p><p><strong>High availability and scalability</strong>: Handles thousands of API requests with remarkable stability<br><strong>Single point of contact</strong>: All cluster communications flow through the API server<br><strong>RESTful interface</strong>: Exposes Kubernetes APIs over HTTPS with TLS encryption</p><p><strong>Who talks to the API server?</strong></p><ul><li>End users via kubectl (the Kubernetes command-line tool)</li><li>Monitoring and observability tools</li><li>CI/CD pipelines</li><li>Internal cluster components</li></ul><p><strong>Key responsibilities:</strong></p><ul><li><strong>API Management</strong>: Exposes cluster endpoints and handles all API requests with support for multiple API versions simultaneously</li><li><strong>Authentication &amp; Authorization:</strong> Validates users through client certificates, bearer tokens, or HTTP-based authentication to prevent unauthorized access</li><li><strong>Request Processing:</strong> Validates API objects like pods, services, and deployments before accepting them</li><li><strong>Coordination:</strong> Acts as the communication bridge between the control plane and worker nodes</li></ul><p><strong>Important security note:</strong> The API server is the only component that directly communicates with etcd. All other components — including the controller manager, scheduler, and kubelets — connect to the API server, creating a secure and controlled data flow.<br><strong>Pro tip:</strong> Master kubectl commands early in your Kubernetes journey. This command-line tool is your primary interface for cluster management and troubleshooting.</p><h4>2. etcd: The Cluster’s Memory</h4><p>Kubernetes is a distributed system, and every distributed system needs a reliable database. That’s where etcd comes in.<br><strong>What is etcd?</strong><br>etcd is a strongly consistent, distributed key-value store that serves as Kubernetes’ single source of truth. Built on top of BoltDB, it’s designed specifically for distributed systems that require high reliability.<br>What does etcd store?</p><ul><li>All cluster configuration data</li><li>State and metadata of Kubernetes objects (pods, secrets, deployments, daemon sets, etc.)</li><li>Current and desired states of all resources</li></ul><p><strong>Key features:</strong></p><ul><li><strong>Strong consistency:</strong> Guarantees that all nodes see the same data at the same time</li><li><strong>Watch API:</strong> Allows components to subscribe to events and react to changes in real-time</li><li><strong>gRPC interface:</strong> Exposes a high-performance key-value API</li></ul><p>Think of etcd as your cluster’s flight recorder — it keeps a detailed record of everything happening in your Kubernetes environment.</p><h4>3. Kube-Scheduler: The Strategic Planner</h4><p>The kube-scheduler is responsible for one of Kubernetes’ most critical decisions: determining which worker node should run each pod.<br>How does pod scheduling work?<br>Let’s walk through the scheduling process:</p><ul><li><strong>Pod creation request:</strong> You submit a pod specification via kubectl create</li><li><strong>API server validation:</strong> The API server validates and stores the pod specification in etcd</li><li><strong>Scheduler notification:</strong> The scheduler detects the new pod awaiting placement</li><li><strong>Node selection:</strong> The scheduler analyzes the pod’s requirements against available nodes</li><li><strong>Binding:</strong> The scheduler assigns the pod to the optimal node and updates etcd</li><li><strong>Pod launch: </strong>The kubelet on the selected worker node receives instructions and starts the container</li></ul><p><strong>What factors influence scheduling decisions?</strong></p><ul><li>Resource requirements (CPU, memory)</li><li>Hardware/software constraints</li><li>Affinity and anti-affinity rules</li><li>Taints and tolerations</li><li>Pod priority and preemption</li><li>Persistent volume requirements</li></ul><p>The scheduler continuously ensures your workloads are placed intelligently across your cluster for optimal performance and resource utilization.</p><h4>4. Kube-Controller-Manager: The Autopilot</h4><p><strong>What is a controller?</strong><br>A controller is a control loop that continuously watches your cluster’s state and makes changes to move the current state toward the desired state.</p><p><strong>A practical example:</strong><br>Imagine you create a deployment requesting two replicas of your application with one volume-mounted ConfigMap defined in your YAML file. The deployment controller ensures that exactly two pods are always running with the correct configuration. If a pod crashes, the controller immediately detects this deviation from the desired state and creates a replacement pod. If you update the deployment to five replicas, the controller recognizes the change and scales up accordingly.</p><p><strong>The kube-controller-manager’s role:</strong><br>This component manages all built-in Kubernetes controllers in a single process. Here are some essential controllers:</p><ul><li><strong>Deployment Controller:</strong> Manages deployments and their updates<br>ReplicaSet Controller: Ensures the correct number of pod replicas are running</li><li><strong>DaemonSet Controller: </strong>Ensures pods run on all (or specific) nodes</li><li><strong>Job Controller:</strong> Manages batch jobs</li><li><strong>CronJob Controller:</strong> Manages scheduled jobs</li><li><strong>Endpoint Controller:</strong> Populates endpoint objects (links services to pods)</li><li><strong>Namespace Controller:</strong> Manages namespace lifecycle</li><li><strong>Service Account Controller:</strong> Creates default service accounts for namespaces</li><li><strong>Node Controller:</strong> Monitors and responds to node status changes</li></ul><p><strong>Why this matters:</strong><br>Controllers are what make Kubernetes self-healing and declarative. You define what you want (desired state) in your manifest YAML files, and controllers work continuously to make it happen. You can even extend Kubernetes by creating custom controllers for your specific needs using Custom Resource Definitions (CRDs).</p><h4>5. Cloud-Controller-Manager: The Cloud Bridge</h4><p>When running Kubernetes on cloud platforms like Azure, AWS, or GCP, the cloud-controller-manager becomes essential. It acts as a bridge between your Kubernetes cluster and the cloud provider’s APIs, enabling cloud-specific features like load balancers, storage volumes, and node management that are native to each platform.</p><h3>Worker Node Components: Where Applications Live</h3><p>Worker nodes are where your applications actually run. Each worker node contains several critical components that make this possible.</p><h4>1. Kubelet: The Node Agent</h4><p>The kubelet is an agent that runs on every worker node — but interestingly, it doesn’t run as a container. Instead, it operates as a system daemon managed by systemd.<br><strong>Core responsibilities:</strong></p><ul><li><strong>Node registration:</strong> Registers the worker node with the API server<br>Pod lifecycle management: Creates, modifies, and deletes containers based on pod specifications (primarily from the API server)</li><li><strong>Health monitoring:</strong> Handles liveness, readiness, and startup probes to ensure application health</li><li><strong>Volume management:</strong> Mounts volumes by reading pod configurations and creating respective directories</li><li><strong>Status reporting: </strong>Collects and reports node and pod status to the API server</li><li><strong>Metrics collection:</strong> Works with cAdvisor and the Container Runtime Interface (CRI) for monitoring</li></ul><p><strong>How it works:</strong><br>The kubelet continuously watches the API server for pod specifications assigned to its node. These specifications (in YAML or JSON format) define which containers should run inside pods, their resource requirements, environment variables, volumes, labels, and other settings. The kubelet then ensures these specifications are met.</p><h4>2. Kube-Proxy: The Network Traffic Controller</h4><p>To understand kube-proxy, you need to know about Kubernetes services and endpoint objects. Services provide stable networking for pods (which can be created and destroyed frequently), while endpoints track the actual IP addresses and ports of the pods behind each service.<br>What kube-proxy does:</p><p>Communicates with the API server to discover service and endpoint details<br>Monitors for changes in services and endpoints<br>Routes network traffic to the appropriate pods behind services</p><p><strong>Routing modes:</strong><br>Kube-proxy can use several modes to route traffic:</p><ul><li><strong>iptables:</strong> The default mode, using Linux iptables rules</li><li><strong>IPVS:</strong> IP Virtual Server mode for better performance at scale</li><li><strong>nftables:</strong> The modern replacement for iptables</li><li><strong>userspace:</strong> Legacy mode (rarely used)</li><li><strong>kernelspace:</strong> For Windows nodes</li></ul><p>Each mode has different performance characteristics and use cases, with iptables being the most common choice for standard deployments.</p><h4>3. Container Runtime: The Engine Room</h4><p>The container runtime is the software responsible for actually running containers on each node. You’ll find container runtimes installed on all nodes in a Kubernetes cluster.<br>Key responsibilities:</p><ol><li>Pulling container images from registries</li><li>Running containers</li><li>Allocating and isolating resources for containers</li><li>Managing the complete container lifecycle on the host</li></ol><p>Understanding the standards:<br>1. <strong>Container Runtime Interface (CRI): </strong>A set of APIs that allows Kubernetes to interact with different container runtimes. This abstraction makes container runtimes interchangeable — you’re not locked into a single technology. The CRI defines APIs for creating, starting, stopping, and deleting containers, as well as managing images and container networks</p><p><strong>2. Open Container Initiative (OCI):</strong> Industry standards for container formats and runtimes, ensuring compatibility across different implementations.<br>Supported container runtimes:<br>Kubernetes supports multiple container runtimes that comply with the Container Runtime Interface:</p><ul><li><strong>containerd</strong>: Lightweight, production-grade runtime (CNCF graduated project)</li><li><strong>CRI-O</strong>: Built specifically for Kubernetes</li><li><strong>Docker Engine</strong>: The original container runtime (via containerd)</li></ul><p>All these runtimes implement the CRI interface and expose gRPC CRI APIs, allowing Kubernetes to communicate with them consistently regardless of which runtime you choose.</p><h4>Putting It All Together</h4><p>Now that we’ve explored each component, let’s visualize how they work together in a typical workflow:</p><ul><li>You submit a deployment using kubectl</li><li>API Server validates your request and stores it in etcd</li><li>Controller Manager detects the new deployment and creates the necessary pods</li><li>Scheduler determines which worker nodes should run these pods based on resource requirements and constraints</li><li>Kubelet on selected worker nodes receives instructions and works with the container runtime to start containers</li><li>Kube-proxy configures networking rules so your pods can communicate with each other and external clients</li><li>Controllers continuously monitor the cluster, ensuring your desired state is maintained</li></ul><p>This orchestration happens automatically, continuously, and at scale — that’s the power of Kubernetes.</p><p><strong>What’s Next?</strong><br>In this article, we’ve covered the foundational architecture of Kubernetes, including the control plane and worker node components. You now understand how each piece fits together to create a robust container orchestration platform.<br>In the next article of this series, we’ll dive into Kubernetes native workload objects, including pods, deployments, StatefulSets, DaemonSets, and jobs. We’ll explore how to define and manage these resources effectively in your clusters.</p><p><strong>Official Kubernetes References</strong><br>For deeper learning and official documentation, I recommend exploring these resource:<br>Kubernetes Official Documentation: <a href="https://kubernetes.io/docs/">https://kubernetes.io/docs/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6f1ebfd27d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking Limits of the Web: Introduction to WebAssembly (Wasm)]]></title>
            <link>https://medium.com/@denuwankalubowila/breaking-limits-of-the-web-introduction-to-webassembly-wasm-736656611068?source=rss-a420ebdc4be------2</link>
            <guid isPermaLink="false">https://medium.com/p/736656611068</guid>
            <category><![CDATA[what-is-webassembly]]></category>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Vishwa Kalubowila]]></dc:creator>
            <pubDate>Wed, 10 Sep 2025 01:52:11 GMT</pubDate>
            <atom:updated>2025-09-10T01:59:44.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MRBao0CSReN1xO7PbOllFA.png" /></figure><blockquote>Are you tired of slow web applications? What if you could build them to run at near-native speeds right in your browser?</blockquote><p>As a web developer, I have worked with different web technologies (both frontend and backend). During my internship, I gained experience with a new web technology called WebAssembly. That inspired me to write this article.</p><p><strong>What is WebAssembly?</strong></p><p><a href="https://webassembly.org/">WebAssembly (WASM)</a> is a binary instruction format that runs with near native performance. It allows languages such as C, <a href="https://en.wikipedia.org/wiki/C%2B%2B">C++</a>, <a href="https://www.rust-lang.org/">Rust</a>, and many others to be compiled into a format that can run on the web.</p><p>WebAssembly applications can also run on different operating systems securely because they execute inside a sandboxed environment. WASM code is designed to be faster to parse and execute than JavaScript. Thanks to WASI (WebAssembly System Interface), WASM can even extend its use beyond browsers and run in server and cloud environments.</p><p><strong>Is It Replacing JavaScript?</strong></p><p>WebAssembly is not a competitor to JavaScript; it’s an improvement and complement. Developers can build performance-critical parts of an application in WASM and then import them into JavaScript as modules.</p><p>For example, imagine building a web-based game that requires parallel processing, 3D rendering, or other complex tasks. JavaScript handles the UI and interactions, while WebAssembly fills the performance gaps. Together, they make a powerful combination.</p><p>So, WebAssembly will not “kill” JavaScript. Instead, it works alongside it to unlock new possibilities for the web.</p><p>C/C++ and Rust are the primary languages adopted for WebAssembly development. On the other hand, languages like Go, Zig, Kotlin, and AssemblyScript (a TypeScript-based language) are also supported.</p><p>If you develop features in C/C++, you can use <a href="https://emscripten.org/">Emscripten</a> to compile your program into WASM. For Rust, the tool is <a href="https://rustwasm.github.io/docs/wasm-pack">wasm-pack</a>.</p><p>Nowadays, Rust is one of the most popular choices for WebAssembly development because it is a memory-safe language that delivers high performance. But don’t worry if you come from a JavaScript or TypeScript background; you can easily get started with <a href="https://www.assemblyscript.org/">AssemblyScript</a>, which feels familiar and accessible.</p><p><strong>Real-World Examples</strong></p><p>Gaming (Unity, Unreal Engine on Web)</p><p>Popular game engines like Unity and Unreal leverage WebAssembly to bring high-performance 3D games directly into the browser, removing the need for heavy installations. This allows developers to deliver console-like experiences on the web.</p><p>Multimedia (Figma, AutoCAD Web, Adobe Photoshop Web)</p><p>Tools like Figma and Photoshop use WASM to handle complex rendering and real-time collaboration. These apps show how design and editing software, once limited to desktops, can now run smoothly in browsers.</p><p>Machine Learning in the Browser (TensorFlow.js + WASM backend)</p><p>TensorFlow.js with a WebAssembly backend enables machine learning models to run efficiently inside browsers. This makes it possible to perform tasks like image recognition or speech analysis without relying on a cloud server.</p><p>Blockchain and Cryptography (Fast Hashing, Verification)</p><p>WebAssembly speeds up cryptographic computations like hashing and digital signature verification. This is crucial for blockchain applications that need secure and fast transaction validation in web-based wallets.</p><p>Server-Side Applications with WASI</p><p>With WASI (WebAssembly System Interface), WASM can run outside browsers, powering server-side and cloud-native applications. This opens the door for highly portable software that runs across platforms with consistent performance.</p><p><strong>Community</strong></p><p>WebAssembly is not driven by a single entity; it’s the result of collaboration between multiple organizations, open-source communities, and individual contributors. Its development is coordinated by groups such as the W3C Working Group, the W3C Community Group, and the Bytecode Alliance.</p><p>In addition, organizations like the Cloud Native Computing Foundation (CNCF), language toolchain communities such as Rust, and countless individual developers contribute to shaping the future of WebAssembly. This broad collaboration ensures WASM continues to evolve as a truly open and innovative standard for the web and beyond.</p><p><strong>Conclusion</strong></p><p>The introduction of WebAssembly marks a new chapter in the history of web development. Just as JavaScript first brought dynamic content to the web, WASM is now unlocking a new level of performance and functionality. It’s not the end of JavaScript but the beginning of a powerful, collaborative ecosystem that will redefine what we can build on the web.</p><p>If you’re new to WASM, the best way to learn is by experimenting with small projects. Start simple: try compiling a small program in C/C++ or Rust and run it in the browser. From there, you’ll quickly discover the potential this technology unlocks.</p><p><strong>What’s Next</strong></p><p>In the next part of this series, we’ll get hands-on: how to set up a development environment for WebAssembly.</p><p>Writing your first simple WebAssembly module (with C as an example).</p><p>Stay tuned and happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=736656611068" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Server Sent Events (SSE) with Go]]></title>
            <link>https://medium.com/@denuwankalubowila/server-sent-events-sse-with-go-516dc8c8bbfd?source=rss-a420ebdc4be------2</link>
            <guid isPermaLink="false">https://medium.com/p/516dc8c8bbfd</guid>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[server-sent-events]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Vishwa Kalubowila]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 07:01:39 GMT</pubDate>
            <atom:updated>2025-09-07T07:01:39.372Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nSZ_lUAwyzEB5vx_RwW0Cw.png" /></figure><p>During my last vacation, I started learning about real-time communication. In my exploration process, I found Server-Sent-Events (SSE). In this article, I’ll explore how to implement SSE in Go, discussing benefits and use cases.</p><p><strong>What is a Server Sent Event?</strong></p><p>SSE is a web technology that allows real-time, unidirectional communication from server to client using a persistent HTTP connection. It means that servers only send updates to clients, and clients don’t have the ability to send updates to servers.</p><h3>WebScockets vs Server-Send-Events</h3><p>Both WebSockets and Server-Sent Events (SSE) are designed to facilitate real-time communication between a server and a client. However, they differ significantly in their approach and functionality. WebSockets establish a full-duplex communication channel over a single, long-lived connection, which means both the client and the server can send messages to each other at any time. This bidirectional capability makes WebSockets particularly suitable for applications that require frequent and dynamic data exchange, such as online gaming, chat applications, or collaborative editing tools.</p><p>On the other hand, SSE is a simpler protocol that creates a unidirectional channel from the server to the client. This means that while the server can continuously push updates to the client, the client cannot send messages back to the server over the same connection. SSE is ideal for applications where the server needs to send continuous updates to the client, like live news feeds, stock price updates, or real-time notifications. SSE uses a persistent HTTP connection, which is inherently more firewall-friendly and easier to implement than WebSockets, especially when dealing with simple one-way data streams.</p><p>The code snippets below show how to implement SSE with Go and how to use that code on the client side using JavaScript.</p><pre>package main<br><br>import (<br>  &quot;fmt&quot;<br>  &quot;net/http&quot;<br>  &quot;time&quot;<br>)<br><br>func main() {<br>  http.HandleFunc(&quot;/events&quot;, func(w http.ResponseWriter, r *http.Request) {<br>    w.Header().Set(&quot;Content-Type&quot;, &quot;text/event-stream&quot;)<br>    w.Header().Set(&quot;Cache-Control&quot;, &quot;no-cache&quot;)<br>    w.Header().Set(&quot;Connection&quot;, &quot;keep-alive&quot;)<br>    w.Header().Set(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)<br><br>    for {<br>      // Simulate sending events every second<br>      fmt.Fprintf(w, &quot;data: %s\n\n&quot;, time.Now().Format(time.Stamp))<br>      w.(http.Flusher).Flush()<br>      time.Sleep(1 * time.Second)<br>    }<br>  })<br><br>  http.ListenAndServe(&quot;:8080&quot;, nil)<br>}</pre><pre>w.Header().Set(&quot;Content-Type&quot;, &quot;text/event-stream&quot;)</pre><p>Set the content type to “text/event-stream,” which informs the client that this is an SSE connection.</p><pre>w.Header().Set(&quot;Cache-Control&quot;, &quot;no-cache&quot;)</pre><p>Preventing the caching of the event stream.</p><pre>w.Header().Set(&quot;Connection&quot;, &quot;keep-alive&quot;)</pre><p>Keep the connection open for continuous streaming.</p><pre>w.Header().Set(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;)</pre><p>Allows CORS requests from any domain.</p><pre>for {<br>      fmt.Fprintf(w, &quot;data: %s\n\n&quot;, time.Now().Format(time.Stamp))<br>      w.(http.Flusher).Flush()<br>      time.Sleep(1 * time.Second)<br>}</pre><p>In this infinite loop, data is generated every second. The Flusher interface immediately sends the generated data to the client using Flush().</p><p>Now let’s see how to use event streaming on the client side.</p><pre>&lt;script&gt;<br>  const eventSource = new EventSource(&#39;http://localhost:8080/events&#39;)<br><br>  eventSource.onmessage = function (event) {<br>    console.log(&#39;Message received: &#39;, event.data)<br>  }<br><br>  eventSource.onerror = function (event) {<br>    console.error(&#39;An error occurred:&#39;, event)<br>  }<br>&lt;/script&gt;</pre><p>The EventSource interface creates a persistent connection to an HTTP server that sends data in the “text/event-stream” format.</p><h3>Use cases:</h3><ul><li><em>Real-time dashboards</em></li><li><em>Live Scoring apps</em></li><li><em>Social media feeds</em></li><li><em>Stock market tickers</em></li><li><em>Progress indicators in long-running tasks</em></li></ul><h3>Advantages</h3><p><strong>Simplicity:</strong> SSE is easy to implement on both the server and client sides and uses an event-based interface.</p><p><strong>Compatibility</strong>: SSE is supported by all modern browsers.</p><p><strong>Efficiency</strong>: Unlike WebSockets, SSE uses a standard HTTP connection, avoiding extra overhead.</p><h3>Disadvantages</h3><p><strong>Unidirectional Communication</strong>: SSE only allows communication in one direction, limiting scenarios that require bidirectional interaction between server and client.</p><p><strong>Error Handling:</strong> Advanced error handling and connection recovery need to be implemented manually.</p><h3>Conclusion:</h3><p>Server Sent Events provide an effective and efficient way to implement real-time data communication on the web. Their simplicity, compatibility, and efficiency make them an excellent choice for many applications. However, their unidirectional nature and error handling challenges may lead you to choose WebSockets or alternatives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=516dc8c8bbfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Start Go lang with “Hello World!”]]></title>
            <link>https://medium.com/@denuwankalubowila/start-go-lang-with-hello-world-49f9fa82b9f1?source=rss-a420ebdc4be------2</link>
            <guid isPermaLink="false">https://medium.com/p/49f9fa82b9f1</guid>
            <dc:creator><![CDATA[Vishwa Kalubowila]]></dc:creator>
            <pubDate>Sat, 04 May 2024 09:40:15 GMT</pubDate>
            <atom:updated>2024-05-04T09:40:15.209Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will explore how to write the first program with Go Lang. You can install Go Lang binary files from the <a href="https://go.dev/"><strong>Go official site</strong></a> and follow the instructions to set up your computer with Golang. Let’s open our code editor and write our first Go program.</p><p>First, we create the entry point of the project. Usually, we use the main.go file to represent the entry point. The below example shows the basic hello world program written in Go. I will explain the code line by line because it will help you understand Go from the basics to more advanced concepts.</p><pre>package main<br><br>import &quot;fmt&quot;<br><br>func main() {<br> fmt.Println(&quot;Hello World!&quot;)<br>}</pre><p>Let’s talk about the main package. A package named main has a special meaning. The name ‘main’ for a package signifies that it contains an entry point for an executable program. After that, the compiler looks for the <strong>main()</strong> function, which is the entry point of the application.</p><pre>package main</pre><p>In line two, the application imports the package named fmt. A package is a collection of source files working together. All source files are in the same directory. “fmt” is a package used for formatting strings, inputs, and outputs. This package commonly uses print and write on the terminal.</p><pre>import &quot;fmt&quot;</pre><p>The next line shows the <strong>main()</strong> function. To create a function, we use the func keyword. We will talk more about Go Lang functions in my next article.</p><pre>func main() {<br> fmt.Println(&quot;Hello World!&quot;)<br>}</pre><p>In the next line inside the main() function, print the “Hello world!”. The compiler uses the fmt package’s Println function. The “ . ” says to look inside the fmt package and use Println . The argument of the Println function is “Hello World!”.</p><pre>fmt.Println(&quot;Hello World!&quot;)</pre><p>When the compiler finishes compiling the program, it shows the “Hello World!” inside the terminal.</p><p>Let’s run our first code written by Go Lang. Use the <strong>go run main.go</strong> command in your terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bgACBMWq8P_9z61egnVUOg.png" /></figure><p>Ready to dive deeper into data storage? In the next article, we’ll explore Go Lang variables and how they unlock the power to manipulate data in your programs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49f9fa82b9f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your gateway to the world of IT]]></title>
            <link>https://medium.com/@denuwankalubowila/your-gateway-to-the-world-of-it-62a3c03c97ed?source=rss-a420ebdc4be------2</link>
            <guid isPermaLink="false">https://medium.com/p/62a3c03c97ed</guid>
            <dc:creator><![CDATA[Vishwa Kalubowila]]></dc:creator>
            <pubDate>Wed, 10 Apr 2024 14:42:50 GMT</pubDate>
            <atom:updated>2024-04-10T14:42:50.468Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_pcuQbCHtTp15RWhObZzLg.jpeg" /><figcaption>Design by: Harshani Yaparathne</figcaption></figure><p>Hey tech enthusiasts! Calling all future coders, data whizzes, and software architects! Are you eager to dive into the ever-evolving world of IT and make your mark? Look no further than <a href="https://www.sab.ac.lk/">Sabaragamuwa University of Sri Lanka</a>’s <a href="https://www.sab.ac.lk/computing/">Faculty of Computing</a>! Nestled amidst the beauty of Belihuloya, Sri Lanka, this faculty is your gateway to an exceptional IT education.</p><p><strong>The </strong><a href="https://www.sab.ac.lk/computing/"><strong>Faculty of Computing </strong></a><strong>boasts three dynamic departments:</strong></p><p><em>Computing and Information Systems:</em> This department equips you with the foundational knowledge and practical skills to navigate the complex world of computing. From understanding core programming languages to designing effective information systems, you’ll gain a holistic understanding of the IT backbone.</p><p><em>Software Engineering:</em><strong> </strong>Software engineering is the art of crafting robust and user-friendly software. This department will transform you into a software maestro, teaching you the intricacies of design, development, and testing. Get ready to build the next generation of groundbreaking applications!</p><p><em>Data Science:</em> Data is the new gold, and data science is the key to unlocking its potential. This department delves into the fascinating world of data analysis, where you’ll learn to extract insights, build predictive models, and transform raw data into actionable knowledge.</p><p><strong>Why </strong><a href="https://www.sab.ac.lk/"><strong>Sabaragamuwa University</strong></a><strong>?</strong></p><p><a href="https://www.sab.ac.lk/">Sabaragamuwa University</a> offers a more than just an education; it’s an experience. Here, you’ll be surrounded by passionate professors, collaborate with brilliant peers, and have access to facilities. The faculty fosters a dynamic learning environment that encourages innovation, critical thinking, and problem-solving skills — all essential for success in the ever-changing IT landscape.</p><p><strong>Ready to embark on your IT adventure?</strong></p><p><a href="https://www.sab.ac.lk/">Sabaragamuwa University</a>’s<a href="https://www.sab.ac.lk/computing/"> Faculty of Computing</a> is the perfect launchpad for your IT journey. So, what are you waiting for? Join our vibrant community and unlock your full potential in the exciting world of technology!</p><p>more: <a href="http://www.sab.ac.lk/">www.sab.ac.lk</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62a3c03c97ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Start your journey with Go Language]]></title>
            <link>https://medium.com/@denuwankalubowila/start-your-journey-with-go-language-0df9fd7cec29?source=rss-a420ebdc4be------2</link>
            <guid isPermaLink="false">https://medium.com/p/0df9fd7cec29</guid>
            <category><![CDATA[go-language]]></category>
            <dc:creator><![CDATA[Vishwa Kalubowila]]></dc:creator>
            <pubDate>Sun, 24 Dec 2023 07:13:01 GMT</pubDate>
            <atom:updated>2023-12-24T07:13:01.258Z</atom:updated>
            <content:encoded><![CDATA[<h3>Start your journey with Go Language-Introduction</h3><p>This is my very first Medium article about the Go programming language. This article provides an introduction to Go and also discusses how Golang differs from other programming languages.</p><p><strong>Introduction:</strong></p><p>In today’s world, programming has become a highly demanded skill. It is the process of giving instructions step by step for a computer to execute a specific task. There are so many programming languages with different forms, such as C, Java, Python, JavaScript, Rust, and many more. Go also one of them.</p><p>Go, also known as Golang, is an open-source, compiled, and statically typed programming language developed by Google. The people behind the creation of Go Lang are Rob Pike, Ken Thompson, and Robert Griesemer. Go was published in November 2009.</p><p>Golang is a general-purpose programming language. This is popular for developing highly available and scalable web applications. Go is playing its role in cloud-based applications, server-side development, DevOps, command-line applications, and much more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4rkBgw5Y2YF_8b8AkymyKQ.png" /><figcaption>Let’s Go</figcaption></figure><p><strong>Key Features:</strong></p><p>Why would you choose Go as your server-side programming language among other languages such as Python and NodeJS that do the same job? Let’s discuss the key features of Golang.</p><p><strong>Simplicity:</strong> Go is designed to be easy to learn and use. The syntax used in Go is simple and concise. Therefore, it improves readability and maintainability.</p><p><strong>Concurrency:</strong> Go has built-in support for concurrency. It allows developers to work with multi-core and distributed systems. Goroutines and channels are the concepts of the Go concurrent feature, which we will discuss in upcoming articles.</p><p><strong>Garbage collection:</strong> Unlike C, Go has a feature to manage memory automatically. It means the garbage collector frees memory when it is no longer in use. It frees developers from allocating and de-allocating memory.</p><p><strong>Standard Library:</strong> Go has a strong library to support file handling, error handling, and much more. We can use them as packages.</p><p><strong>Platform Independent:</strong> Go is a compiled language. The source code is compiled into binary code, and it can be run on Mac OS, Linux, or Windows without any trouble.</p><p>Some popular applications developed in Golang are:</p><ul><li>Docker</li><li>Kubernetes</li><li>UBER</li><li>PayPal</li><li>Netflix</li></ul><p><strong>Conclusion:</strong></p><p>Most developers are moving to GoLang, which provides excellent development experience with concurrency, fast compiling, garbage collection, and a standard library. As well, it also improves cloud and server-side performance. The largest companies, like Google, PayPal, and Netflix, are moving to Golang. If you need to learn Go, no matter if you are a beginner or an expert, it is easy to do.</p><p>Alright, that’s all for now. Thank you for reading so far.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0df9fd7cec29" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>