<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vaibhav Lande</title>
    <description>The latest articles on DEV Community by Vaibhav Lande (@vaibhav_lande_8019e7ea035).</description>
    <link>https://dev.to/vaibhav_lande_8019e7ea035</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2577451%2F2e7ada82-36e0-483b-a457-745169a11f8d.jpg</url>
      <title>DEV Community: Vaibhav Lande</title>
      <link>https://dev.to/vaibhav_lande_8019e7ea035</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vaibhav_lande_8019e7ea035"/>
    <language>en</language>
    <item>
      <title>Data Exchange Between Components Using Angular Signals</title>
      <dc:creator>Vaibhav Lande</dc:creator>
      <pubDate>Fri, 03 Jan 2025 15:36:27 +0000</pubDate>
      <link>https://dev.to/vaibhav_lande_8019e7ea035/data-exchange-between-components-using-angular-signals-39i4</link>
      <guid>https://dev.to/vaibhav_lande_8019e7ea035/data-exchange-between-components-using-angular-signals-39i4</guid>
      <description>&lt;p&gt;Previously, Angular developers relied on &lt;strong&gt;@Input, @Output, or shared services&lt;/strong&gt; to exchange data between parent and child components. While effective, these methods often introduced tighter coupling and complexity when managing global or shared states.&lt;/p&gt;

&lt;p&gt;With the release of signals in Angular 16, and further enhancements in Angular 19, a new approach has emerged that simplifies data sharing. Signals provide a reactive, declarative, and performance-optimized way to transfer data, even between unrelated components.If you are new to signal please go through &lt;a href="https://dev.to/vaibhav_lande_8019e7ea035/angular-signals-51c"&gt;Angular Signals and It's benifits&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this guide, we’ll explore how to use signals step by step to share data between unrelated components in Angular efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-Step Guide
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Create a Shared Signal Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvqwn4vnb42mciwhqgvsg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvqwn4vnb42mciwhqgvsg.png" alt="Image description" width="720" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.Parent Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8rq2ih9lqr456e07p76.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8rq2ih9lqr456e07p76.png" alt="Image description" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.Child Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo7g7uv7qxptsgha8679t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo7g7uv7qxptsgha8679t.png" alt="Image description" width="800" height="473"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run application and check data will be updated once update button is clicked.
In image each line details added in commented line.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Why Use Signals?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Decoupled Architecture&lt;/strong&gt;: Signals allow components to share state without direct dependencies, leading to more modular and maintainable code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Reactivity&lt;/strong&gt;: Components automatically update when the signal value changes, reducing the need for manual subscriptions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimized Performance&lt;/strong&gt;: Signals minimize unnecessary DOM updates, ensuring efficient change detection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;😍 If you enjoy the content, please 👍 like, 🔄 share, and 👣 follow for more updates!&lt;br&gt;
Join me on a professional journey through my LinkedIn profile:&lt;a href="https://www.linkedin.com/in/vaibhav-lande-full-stack/" rel="noopener noreferrer"&gt;Vaibhav Lande&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>angular</category>
      <category>typescript</category>
      <category>interview</category>
    </item>
    <item>
      <title>Angular Signals and Their Benefits</title>
      <dc:creator>Vaibhav Lande</dc:creator>
      <pubDate>Fri, 03 Jan 2025 09:59:22 +0000</pubDate>
      <link>https://dev.to/vaibhav_lande_8019e7ea035/angular-signals-51c</link>
      <guid>https://dev.to/vaibhav_lande_8019e7ea035/angular-signals-51c</guid>
      <description>&lt;p&gt;In this article, we will explore the exciting world of Angular Signals and their remarkable benefits for building modern, efficient, and scalable web applications.&lt;/p&gt;

&lt;p&gt;Signals represent a revolutionary approach to state management and change detection, addressing key challenges developers face with traditional frameworks. By the end of this guide, you'll have a clear understanding of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is a signal?&lt;/li&gt;
&lt;li&gt;Types of Angular Signals.&lt;/li&gt;
&lt;li&gt;Benefits of using signal.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, let’s start the power of Angular Signals!&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a signal?
&lt;/h2&gt;

&lt;p&gt;A signal is a new reactive primitive that allows you to build angular applications in a reactive style.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Angular Signals
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Writable Signals&lt;/strong&gt;: This allows you to create a signal with a value that can be updated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbgb9s32uj3yn4aq5v68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbgb9s32uj3yn4aq5v68.png" alt="Image description" width="766" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Readonly Signals&lt;/strong&gt;: Readonly signals can be accessed to read their value but can't be changed using set or update methods. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc67ixrvgy3t3p823wvz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc67ixrvgy3t3p823wvz.png" alt="Image description" width="628" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Computed Signals&lt;/strong&gt;: Depend on other signals and compute a value based on them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effects&lt;/strong&gt;: Run logic whenever the value of one or more signals changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm29pz97wy69yfd9rtkg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flm29pz97wy69yfd9rtkg.png" alt="Image description" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of using signal
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Fine-Grained Reactivity&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signals enable more precise change detection by reacting only to changes in specific data rather than traversing the entire component tree.&lt;/li&gt;
&lt;li&gt;This reduces unnecessary DOM updates and boosts application performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example: Without signals, a component with multiple bindings might trigger change detection across all bindings, even if only one changes. Only the dependent bindings are updated with signals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Push-Based Model&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signals use a push-based reactivity model: updates propagate directly to affected consumers (like templates or other signals).&lt;/li&gt;
&lt;li&gt;This eliminates the need for Angular to check every component manually during change detection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Traditional (Pull-Based): Angular’s default change detection traverses components and checks for changes.&lt;br&gt;
With Signals: Change detection occurs only for parts of the app influenced by the changed signal, reducing overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplified State Management&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signals naturally manage state, making it easier to maintain and debug reactive applications.&lt;/li&gt;
&lt;li&gt;They integrate seamlessly into Angular’s reactivity model, removing the need for external state management libraries in many cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Predictable and Declarative Updates&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signals ensure that state changes are predictable and declarative, meaning developers can explicitly define dependencies and control how changes propagate.&lt;/li&gt;
&lt;li&gt;This eliminates ambiguity in determining why and when a change detection cycle runs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Improved Performance in Large Applications&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In large applications, reducing unnecessary change detection cycles drastically improves performance.&lt;/li&gt;
&lt;li&gt;Signals allow Angular to skip parts of the component tree unaffected by the change, making them ideal for optimizing resource-heavy or real-time apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Seamless Integration with computed and effect&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signals can be combined with computed for derived values and effect for side effects, offering more control over how changes propagate and are detected.
Example:
const count = signal(0);
const doubleCount = computed(() =&amp;gt; count() * 2);
count.set(1);  // Only &lt;code&gt;doubleCount&lt;/code&gt; recalculates and updates its dependent views.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Better Debugging and Tooling&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Signals provide a straightforward API to monitor and debug reactive changes in the application state.&lt;/li&gt;
&lt;li&gt;Developers can easily trace which signals triggered specific updates, reducing debugging time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;😍 If you enjoy the content, please 👍 like, 🔄 share, and 👣 follow for more updates!&lt;br&gt;
Join me on a professional journey through my LinkedIn profile:&lt;a href="https://www.linkedin.com/in/vaibhav-lande-full-stack" rel="noopener noreferrer"&gt;Vaibhav Lande&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>interview</category>
      <category>fullstack</category>
      <category>rxjs</category>
    </item>
    <item>
      <title>API Versioning in .Net Core.</title>
      <dc:creator>Vaibhav Lande</dc:creator>
      <pubDate>Mon, 23 Dec 2024 05:30:00 +0000</pubDate>
      <link>https://dev.to/vaibhav_lande_8019e7ea035/api-versioning-in-net-core-2o0n</link>
      <guid>https://dev.to/vaibhav_lande_8019e7ea035/api-versioning-in-net-core-2o0n</guid>
      <description>&lt;h2&gt;
  
  
  What is API versioning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;API versioning helps you to manage and maintain different versions of endpoints.&lt;/li&gt;
&lt;li&gt;It allows the developer to add new functionality instead of changing the existing ones as some clients rely on an older version&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common ways to implement API versioning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;URL versioning: &lt;a href="https://localhost:7091/api/v1/weatherForecast" rel="noopener noreferrer"&gt;https://localhost:7091/api/v1/weatherForecast&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Header versioning: &lt;a href="https://localhost:7091/api/weatherForecast" rel="noopener noreferrer"&gt;https://localhost:7091/api/weatherForecast&lt;/a&gt; -H 'X-Api-Version: 1'&lt;/li&gt;
&lt;li&gt;Query parameter versioning: &lt;a href="https://localhost:7091/api/weatherForecast?api-version=1" rel="noopener noreferrer"&gt;https://localhost:7091/api/weatherForecast?api-version=1&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Implement URL versioning
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create Project with .NetCore web api template&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install Nuget packages&lt;br&gt;
&lt;strong&gt;Asp.Versioning.Mvc&lt;/strong&gt; : &lt;strong&gt;Required for MVC controller end Point&lt;/strong&gt; and&lt;br&gt;
&lt;strong&gt;Asp.Versioning.Mvc.ApiExplorer&lt;/strong&gt;: Required for ASP.NET Core API Versioning.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqv2nlsg4uvrznyjcc6j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqv2nlsg4uvrznyjcc6j.png" alt="Image description" width="368" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;AddApiVersioning&lt;/strong&gt; to provide options for API versioning &lt;strong&gt;ApiVersioningOptions&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb00x1y4jn3qre0oebzqr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb00x1y4jn3qre0oebzqr.png" alt="Image description" width="800" height="163"&gt;&lt;/a&gt;&lt;br&gt;
Added the definition of each line in the comment (refer to the above snapshot).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At the controller level specify the supported API version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ed9nnul47xntm1tghlp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ed9nnul47xntm1tghlp.png" alt="Image description" width="665" height="521"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Postman Result&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7h6mig93zskvhz58z03n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7h6mig93zskvhz58z03n.png" alt="Image description" width="800" height="101"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucab9r4uwugb2gl76rsq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fucab9r4uwugb2gl76rsq.png" alt="Image description" width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;😍 If you enjoy the content, please 👍 like, 🔄 share, and 👣 follow for more updates!&lt;br&gt;
Join me on a professional journey through my LinkedIn profile: &lt;a href="//www.linkedin.com/in/vaibhav-lande-full-stack"&gt;Vaibhav Lande&lt;/a&gt;&lt;/p&gt;

</description>
      <category>interview</category>
      <category>webapi</category>
      <category>dotnetcore</category>
      <category>azure</category>
    </item>
    <item>
      <title>Microservice communication using Kafka</title>
      <dc:creator>Vaibhav Lande</dc:creator>
      <pubDate>Fri, 20 Dec 2024 13:42:47 +0000</pubDate>
      <link>https://dev.to/vaibhav_lande_8019e7ea035/-13nh</link>
      <guid>https://dev.to/vaibhav_lande_8019e7ea035/-13nh</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/vaibhav_lande_8019e7ea035" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2577451%2F2e7ada82-36e0-483b-a457-745169a11f8d.jpg" alt="vaibhav_lande_8019e7ea035"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/vaibhav_lande_8019e7ea035/net-core-microservice-communication-using-kafka-422e" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;.Net Core Microservice Communication Using Kafka.&lt;/h2&gt;
      &lt;h3&gt;Vaibhav Lande ・ Dec 20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#eventdriven&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#microservices&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#interview&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#dotnetcore&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>microservices</category>
      <category>kafka</category>
      <category>dotnet</category>
      <category>backenddevelopment</category>
    </item>
    <item>
      <title>.Net Core Microservice Communication Using Kafka.</title>
      <dc:creator>Vaibhav Lande</dc:creator>
      <pubDate>Fri, 20 Dec 2024 11:43:20 +0000</pubDate>
      <link>https://dev.to/vaibhav_lande_8019e7ea035/net-core-microservice-communication-using-kafka-422e</link>
      <guid>https://dev.to/vaibhav_lande_8019e7ea035/net-core-microservice-communication-using-kafka-422e</guid>
      <description>&lt;p&gt;In today’s data-driven world, real-time data processing is critical for many applications. To meet this demand, &lt;strong&gt;Apache Kafka&lt;/strong&gt; has emerged as a leading open-source platform for managing and processing data streams at scale. Known for its robustness and efficiency, Kafka has become the go-to solution for stream processing.&lt;/p&gt;

&lt;p&gt;In this blog, we’ll explore the core concepts of Apache Kafka, its advantages, and how microservices communicate using Kafka. By the end of this journey, you’ll be well-equipped to use Apache Kafka to its full potential, from understanding the theory to configuring it within your .net application.&lt;/p&gt;

&lt;p&gt;So, let’s start with basic information about Kafka and its benefits.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Apache Kafka?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Apache Kafka is an open-source distributed streaming platform.&lt;/li&gt;
&lt;li&gt;Kafka helps you to decouple applications through &lt;strong&gt;Producers&lt;/strong&gt; and 
&lt;strong&gt;Consumers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Producers and Consumers communicate events through topics.&lt;/li&gt;
&lt;li&gt;Topics are created in the broker, Kafka can have 1 to 100s of brokers.&lt;/li&gt;
&lt;li&gt;It's highly scalable and available through its replication of topics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vzybuhpa36n255823mo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vzybuhpa36n255823mo.png" alt="components of Kafka" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Components of Kafka architecture
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Producer&lt;/strong&gt;: The producer in Kafka is responsible for sending data or messages to Kafka topics.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Broker&lt;/strong&gt;: Kafka brokers are the core servers that manage the storage, retrieval, and distribution of messages. They handle tasks like message persistence, partitioning of data, and replication across nodes to ensure fault tolerance and reliability.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Topic&lt;/strong&gt;: Topics act as message categories in Kafka, where producers publish records. Each topic represents a stream of related data, providing an organizational structure that simplifies data management and consumption.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Partition&lt;/strong&gt;: Kafka topics are divided into partitions, allowing for parallel data processing. Partitions enable horizontal scalability by distributing the data load across multiple brokers, enhancing both performance and fault tolerance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Consumer&lt;/strong&gt;: Consumers retrieve and process messages from Kafka topics. They enable downstream applications to react to real-time data, making them fundamental for building data-driven applications, analytics, and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Offset&lt;/strong&gt;: Offsets are unique identifiers for messages within a partition. Consumers use offsets to keep track of their progress in reading messages, allowing them to resume from where they left off even after restarts.&lt;/p&gt;

&lt;p&gt;Possible Values for auto.offset.reset:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;earliest&lt;/strong&gt;:&lt;br&gt;
This setting makes the consumer start reading from the earliest message available in the topic if no offset exists (e.g., on the first run).&lt;br&gt;
If the consumer’s current offset is out of range (e.g., messages have been deleted), it will start reading from the earliest available offset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;latest&lt;/strong&gt;:&lt;br&gt;
With this setting, the consumer starts reading from the latest message (i.e., the next message to be produced).&lt;br&gt;
This is useful when you only care about new messages and don’t need to process older messages that the consumer missed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;none&lt;/strong&gt;:&lt;br&gt;
This value tells Kafka to throw an error if no offset is found or the offset is out of range.&lt;br&gt;
This is useful if you want to ensure that your application always processes data from a known valid offset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;anything else:&lt;/strong&gt;&lt;br&gt;
If the value of auto.offset.reset is set to anything other than the above options, it will be considered invalid, and Kafka will throw an error.&lt;/p&gt;

&lt;p&gt;Now, let’s begin building microservice communication with Kafka, step by step.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Docker desktop.&lt;/li&gt;
&lt;li&gt;Run Command "docker-compose -f kafka.yml up"

&lt;ul&gt;
&lt;li&gt;This command will download Zookeeper and Kafka images and run at the 
docker desktop application&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funsa9g20dhjyiq68mks5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Funsa9g20dhjyiq68mks5.png" alt="Image description" width="780" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiemui5kkhhm2uwhzp0xu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiemui5kkhhm2uwhzp0xu.png" alt="Image description" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an (MicroserviceWithKafka)Empty solution using Visual Studio and add two .net core web API(Producer and Consumer) &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcgf8wsbb94qibq1mxn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcgf8wsbb94qibq1mxn3.png" alt="Image description" width="445" height="110"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Confluent.Kafka nuget package to both APIs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjezfxrvi1tokb1hvb11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbjezfxrvi1tokb1hvb11.png" alt="Image description" width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;5.&lt;strong&gt;Producer API&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create KafkaProducer.cs class which will be responsible for getting data from the controller post end Point and producing data to a topic&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87pzl49gpqjotbhgx6ey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F87pzl49gpqjotbhgx6ey.png" alt="Image description" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6.&lt;strong&gt;Consumer API&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a hosted service that will consume data from the topic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7vrpob6kcpiwtig9qrd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv7vrpob6kcpiwtig9qrd.png" alt="Image description" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Run application and trigger producer end point and based on that respective consumer will get trigger with latest data from topic&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;In this article, we have shared practical demo code to understand Apache Kafka and how it’s used in communication between microservices. Using Confluent’s .NET Producer and Consumer APIs is simple and straightforward, which makes it easy to adopt them for real microservices/streaming apps.&lt;/p&gt;

&lt;p&gt;😍 If you enjoy the content, please 👍 like, 🔄 share, and 👣 follow for more updates!&lt;br&gt;
Join me on a professional journey through my LinkedIn profile: &lt;a href="//www.linkedin.com/in/vaibhav-lande-full-stack"&gt;Vaibhav Lande&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download the Source code: &lt;a href="https://github.com/VaibhavLande/MicroServiceWithKafka" rel="noopener noreferrer"&gt;Github Link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>eventdriven</category>
      <category>microservices</category>
      <category>interview</category>
      <category>dotnetcore</category>
    </item>
    <item>
      <title>Microservice VS Monolithic</title>
      <dc:creator>Vaibhav Lande</dc:creator>
      <pubDate>Thu, 19 Dec 2024 15:03:34 +0000</pubDate>
      <link>https://dev.to/vaibhav_lande_8019e7ea035/microservice-vs-monolith-3h13</link>
      <guid>https://dev.to/vaibhav_lande_8019e7ea035/microservice-vs-monolith-3h13</guid>
      <description>&lt;p&gt;&lt;strong&gt;Monolithic Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Monolithic applications are designed as a single, unified package that encapsulates all the necessary components and services. These applications operate as one complete unit, often sharing the same database and tightly coupling their functionalities.&lt;/p&gt;

&lt;p&gt;A visual representation of monolithic architecture typically shows all components and services packaged together in a single block, regardless of whether a service-oriented approach is used.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj721qfsms6y0f7844iau.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj721qfsms6y0f7844iau.png" alt="Monolithic Architecture" width="698" height="269"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Aspects&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Single Repo: One repository to rule them all.&lt;/li&gt;
&lt;li&gt;Easy to Scale (At the Start): Straightforward scaling approach.&lt;/li&gt;
&lt;li&gt;Simplified Deployment: One-click deployment, one system.&lt;/li&gt;
&lt;li&gt;Lower Infrastructure Costs: One server, fewer headaches.&lt;/li&gt;
&lt;li&gt;Reduced Complexity: Perfect for small-medium apps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Microservices Architecture&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In contrast, microservices architecture involves breaking down the application into smaller, independent services. Each service runs in its own space and communicates with other services via lightweight messaging protocols, such as REST, Azure/AWS service bus, or messaging queues. Each microservice is self-contained, owning its own database and domain logic, which ensures modularity and independence.&lt;/p&gt;

&lt;p&gt;A diagrammatic representation of microservices architecture would highlight the distributed nature of these independent services, each directly managing its own database.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjavude982ytf35a4vzwj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjavude982ytf35a4vzwj.png" alt="Microservice Architecture" width="633" height="240"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Aspects&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fault Isolation: Bugs remain limited in their service.&lt;/li&gt;
&lt;li&gt;Scaling each service independently based on the requirement.&lt;/li&gt;
&lt;li&gt;Testing Made Easier: Test specific services independently.&lt;/li&gt;
&lt;li&gt;Ownership: Independent teams own services.&lt;/li&gt;
&lt;li&gt;Easier Revamps: Upgrade or rewrite single services.&lt;/li&gt;
&lt;li&gt;Debugging: Focused logs make debugging faster.&lt;/li&gt;
&lt;li&gt;Developer Experience: More autonomy and no code conflicts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;😍 If you enjoy the content, please 👍 like, 🔄 share, and 👣 follow for more updates!&lt;br&gt;
Join me on a professional journey through my LinkedIn profile: &lt;a href="//www.linkedin.com/in/vaibhav-lande-full-stack"&gt;Vaibhav Lande&lt;/a&gt;&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>netcore</category>
      <category>eventdriven</category>
      <category>interview</category>
    </item>
  </channel>
</rss>
