<?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 Dilshan Boteju on Medium]]></title>
        <description><![CDATA[Stories by Dilshan Boteju on Medium]]></description>
        <link>https://medium.com/@dilshankavinga?source=rss-5ecec9f4d9f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*EAi3YxkwICCWlrzZ</url>
            <title>Stories by Dilshan Boteju on Medium</title>
            <link>https://medium.com/@dilshankavinga?source=rss-5ecec9f4d9f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 12:10:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dilshankavinga/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[Diagnosing Intermittent Redis Latency]]></title>
            <link>https://medium.com/pickme-engineering-blog/diagnosing-intermittent-redis-latency-165043a65f8d?source=rss-5ecec9f4d9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/165043a65f8d</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[production-engineering]]></category>
            <dc:creator><![CDATA[Dilshan Boteju]]></dc:creator>
            <pubDate>Fri, 04 Sep 2026 06:23:19 GMT</pubDate>
            <atom:updated>2026-09-04T06:23:19.228Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8loUCP7R7yX2Vjqp-vmCCw.png" /></figure><p>Intermittent latency is difficult because it rarely leaves one perfect piece of evidence. In our promotion service, the cache cluster looked healthy, traffic was not at its peak, and the slow promotion changed from one incident to another. The root cause was eventually found in the space between what our application configuration appeared to say and what the process had actually created at runtime.</p><p>The incident became a Redis-client migration, but this is not a story about declaring one library the winner. It is about how we identified two connection-lifecycle failures, why they produced an unusual pattern, how we designed the replacement around consistency and isolation, and what the migration revealed about legacy data and observability.</p><blockquote>The important question was not “Why was Redis slow?” It was “Why did this application sometimes experience Redis as slow while the rest of the cluster looked normal?”</blockquote><h3>The first clue : The latency did not follow load</h3><p>The promotion verification endpoint had begun producing occasional latency alerts. Our first hypothesis was a hot key. Promotion verification evaluates multiple active offers, and a popular offer can receive a large number of reads. A hot key would have been a familiar explanation.</p><p>New Relic transaction traces took us one level deeper. Most of a slow transaction was being spent inside promotion validation, and most of that validation time was inside Redis field reads. In one captured incident, those reads represented roughly three quarters of the validation duration.</p><p>But the supposedly hot promotion was not stable. One trace highlighted one group of promotion codes; another trace highlighted a different group. Several unrelated keys could become slow together, then return to normal. Other applications using the same Redis cluster did not show the same behaviour.</p><p>That changed our direction. The shared factor was not a particular key or even a particular Redis node. It was the connection path used by this application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*fRgVAcrB8-t_gnx2ChfQ3A.png" /></figure><h3>The pool existed in configuration, but not at runtime</h3><p>The application properties contained a familiar set of Lettuce pool values: maximum active connections, minimum and maximum idle connections, and a maximum wait. On a configuration review, everything looked as though a pool of up to forty connections had been deliberately provisioned.</p><p>We then inspected the complete Maven dependency tree rather than stopping at the property file. The dependency that Spring Boot uses to construct the Lettuce pool — commons-pool2—was not present.</p><p>This was the first half of the root cause. Spring Boot only creates its pooling client configuration when that pooling implementation is on the classpath. Without it, the pool properties do not activate a real pool. The application had been running with Lettuce’s shared connection model while everyone reading the configuration believed it had a pool.</p><p>That distinction mattered because the service was not using Redis as a purely asynchronous pipeline. The promotion cache service called synchronous Spring Data operations from request threads. Each verification also evaluated several promotions, creating a burst of blocking reads. When the number of active promotions increased, the amount of Redis work per request increased even though inbound traffic did not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*AInmWjck3g51veEHej26nQ.png" /></figure><h3>Idle connections explained why quiet periods could be worse</h3><p>Missing pooling explained contention, but it did not fully explain why incidents were intermittent and often appeared outside peak traffic. We reviewed the connection lifecycle next.</p><p>The Lettuce path had no explicit TCP keepalive, no periodic health ping, and no proactive idle-connection validation or retirement. A long-lived TCP connection can be silently closed by something in the network path while the application still believes it is usable. The failure becomes visible only when a request tries to use that connection. That request waits while the client detects the problem and reconnects.</p><p>During heavy traffic, a connection is exercised continuously. During a quieter interval, it has enough idle time to become stale. This is why “the issue happens off-peak” was not evidence against a connection problem. It was one of the strongest clues supporting it.</p><p>The two faults reinforced each other. Because the configured pool had never activated, there were fewer independent connections to absorb a failure. When the shared connection became unhealthy, many request threads could experience the same reconnection delay. Meanwhile, the growing number of active promotions increased the number of synchronous calls competing for that path.</p><h4>The root cause was therefore two-part: the expected Lettuce connection pool was absent at runtime because its required pooling dependency was missing, and the remaining long-lived connection path had no proactive idle-connection health mechanism. Synchronous request fan-out amplified both conditions.</h4><h3>Why migrate? We could repair Lettuce, but chose an explicit connection model</h3><p>Adding commons-pool2, enabling keepalive, and adding connection validation would have been a valid minimal repair. We considered that path seriously because it preserved the existing data access code and the client-specific metrics already visible in production.</p><p>We chose to migrate the application-data path to Redisson instead. The service already used Redisson separately for Hibernate’s second-level cache, and Redisson exposed the connection-pool and connection-health model we wanted directly. The decision was about operational clarity and convergence — not a claim that Redisson makes Redis intrinsically faster.</p><p>The migration replaced synchronous RedisTemplate operations with Redisson maps and buckets, but we deliberately did not reuse the Hibernate cache client. Promotion counters and Hibernate cache regions have different namespaces, codecs, traffic patterns, consistency requirements, and failure consequences. A dedicated application-data client allowed us to tune one without affecting the other.</p><h3>Why reads and writes use the master path</h3><p>Promotion usage is not merely cached reference data. The counters influence whether a promotion is still eligible. Reading from a replica immediately after a write could return an older value while asynchronous replication catches up. That stale value could affect a business decision.</p><p>For that reason, we configured Redisson with readMode: MASTER. Redis Cluster already routes writes to the master that owns the key; readMode controls where eligible reads are sent. With master reads, a usage increment and the following validation observe the authoritative path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*HThZkNxTjrp11s-_gsJvbA.png" /></figure><p>Each choice involved a trade-off. Master-only reads provide the consistency needed for eligibility decisions but give up replica read scaling. A larger pool reduces application-side queueing but creates more server connections. Health pings make stale connections visible sooner but add background traffic. Retries absorb short network disruptions but can increase tail latency and must be treated carefully around writes whose result may be ambiguous.</p><p>The key namespace remained tenant-aware. The name mapper was attached programmatically because it depended on Spring-managed tenant context. Numeric counters used explicit long and double codecs so the new client could interpret existing values rather than inventing a new byte representation.</p><h3>Library version, configuration syntax, and legacy bytes all mattered</h3><p>The first implementation proved that “the code compiles” is a very small part of a client migration.</p><p>A Redisson version change altered configuration types and class locations. A YAML codec declaration that was valid for one version failed application startup with a class-not-found error in another. We also encountered reconnection behaviour that required moving to a version where reconnecting connections were not reused incorrectly after a cluster disruption. The lasting fix was not just updating the YAML; we added tests that load the actual runtime configuration with the exact library version used by the application.</p><p>Legacy numeric hashes introduced a different compatibility problem. A Java Long in source code does not guarantee identical bytes across clients. Explicit numeric codecs were required for the new client to continue reading and incrementing the existing usage and amount fields correctly.</p><p>The most visible issue came from short-lived promotion-usage details. The old implementation stored one JSON document as a field inside a Redis hash. The new implementation stored that JSON document directly as a string value because the outer key already uniquely identified the promotion, passenger, and condition. The new shape was simpler, but existing keys still had the old Redis type.</p><p>When the new code issued a string read against an old hash key, Redis correctly returned a type error. There were more than three million eligible legacy keys, which produced a large volume of errors until those entries were replaced.</p><h3>Why we did not simply delete all old keys</h3><p>We attempted to clean the legacy pattern, but scanning and deleting millions of keys drove Redis node CPU high enough to threaten cluster stability. At that point the cleanup was more dangerous than the temporary coexistence.</p><p>The old entries already had a TTL. We stopped the aggressive deletion, accepted that the overlap window would produce noise, and allowed normal expiration to remove the remaining keys. As requests arrived, the application built new entries in the new representation. The cluster recovered without another high-pressure cleanup operation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*T29p5TNPDv4D9296DQhyLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SorDEnrDZCaLfiFSZb4V8A.png" /></figure><p>This part of the incident changed how we think about migrations. A Redis key is not just a name and a value. Its data type, codec, field structure, TTL, and creation version form a data contract. Preserving the key name while changing the type is still a breaking change. In a future migration of this kind, a versioned namespace or a controlled dual-read strategy would make the transition explicit.</p><h3>Why our Redis dashboards went blank</h3><p>After the client changed, Grafana and New Relic no longer showed the Redis latency we were used to seeing. The application was still making Redis calls; our old telemetry simply belonged to Lettuce. The dashboard queried lettuce_command_* metrics, and those series naturally disappeared when Lettuce left the request path.</p><p>We added an application-owned timer around each Redisson operation. It records command name, success or error outcome, client identity, and tenant context. We also report the operation as a New Relic datastore segment. This restored visibility for reads, writes, increments, and deletes without depending on automatic instrumentation from a particular client library.</p><p>The Grafana section now combines average duration, request rate, histogram buckets, p99 duration, and maximum duration. Together they distinguish a broad slowdown from a small number of slow outliers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*5pHRs5qJLT4o6nu7bovRsw.png" /><figcaption>A production view after the migration</figcaption></figure><p>The chart shows a high and stable volume of full-value reads while average duration remains low. A short field-read tail-latency event is visible in the average and p99 panels, then recovers. The maximum panel contains a larger outlier, but the average and p99 do not rise with it.</p><p>That difference is important. Our maximum query uses a rolling window, so one slow command can remain visible as a plateau even though later commands are fast. It is evidence that an outlier occurred, not evidence that every request was slow. The combined view showed that the migrated path was handling sustained production traffic without a broad Redis slowdown.</p><h3>The solution was larger than a client replacement</h3><p>The original root cause was specific: a Lettuce pool that had never activated and a shared connection path without proactive idle health checks. But solving it safely required us to address several surrounding contracts.</p><p>We made the runtime connection model explicit. We separated application data from the Hibernate cache client. We chose master reads because usage counters participate in business decisions. We preserved tenant-aware names and legacy numeric encodings. We tested runtime YAML against the actual client version. We let TTL perform a safer data transition when bulk cleanup threatened the cluster. Finally, we moved command telemetry into the application so another implementation change would not make Redis invisible again.</p><blockquote>The client migration fixed the connection path. Understanding configuration activation, data compatibility, consistency, and observability made the fix production-safe.</blockquote><p>The incident began with a latency graph that seemed to implicate Redis. The deeper finding was that Redis itself was only one participant. The real behaviour emerged from request fan-out, synchronous access, dependency-conditional configuration, TCP connection lifecycle, cache data types, and monitoring assumptions. Looking across those boundaries — not staring harder at one graph — is what turned an intermittent symptom into an explainable root cause.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=165043a65f8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pickme-engineering-blog/diagnosing-intermittent-redis-latency-165043a65f8d">Diagnosing Intermittent Redis Latency</a> was originally published in <a href="https://medium.com/pickme-engineering-blog">The PickMe Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Actually Broke When we Migrated Pickme’s Promo Engine from Java 8 to Java 21]]></title>
            <link>https://medium.com/pickme-engineering-blog/what-actually-broke-when-we-migrated-pickmes-promo-engine-from-java-8-to-java-21-2c50be8e951c?source=rss-5ecec9f4d9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c50be8e951c</guid>
            <category><![CDATA[java21]]></category>
            <category><![CDATA[java-migration]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[rule-engine]]></category>
            <dc:creator><![CDATA[Dilshan Boteju]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 03:18:06 GMT</pubDate>
            <atom:updated>2026-08-11T03:18:06.829Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkX23v7hML2R8TzYprxwaQ.png" /></figure><p>At PickMe, the Promo Engine evaluates promotions against the context of a trip. A request comes in, the application finds candidate promotions, attaches trip and passenger facts, evaluates the conditions, and returns the eligible result.</p><p>The exact promotion rules are not important for this article. What matters is the shape of the system: cached objects, nested conditions, request-specific state, Kafka-backed data, and concurrent evaluation. Those characteristics are also common in fraud checkers, eligibility services, and approval workflows.</p><p>Now we migrate it from Java 8 and Spring Boot 2.6 to Java 21 and Spring Boot 3.2. The project compiles. The unit tests are green. The application starts in local and staging environments.</p><p>Are we done?</p><p>No. That is usually where the interesting part starts.</p><blockquote><strong>The main idea of this article:</strong> a major Java migration is not only a source-code migration. It is also a migration of library behaviour, object ownership, configuration, date formats, threads, and startup assumptions.</blockquote><h3>The Promo Engine in One Minute</h3><p>The Promo Engine keeps reusable promotions in an in-memory cache. For every request, it copies a matching promotion, attaches the current passenger and trip facts, and evaluates its conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*spVOF5wAVhESUFSS6u5CYw.png" /><figcaption><em>A simplified view of the Promo Engine evaluation flow.</em></figcaption></figure><pre>public record TripContext(<br>        Long passengerId,<br>        BigDecimal fare,<br>        String pickupZone) {}<br><br>public class Promotion {<br>    private String code;<br>    private Set&lt;PromotionCondition&gt; promotionConditions;<br>    private TripContext tripContext;<br>}</pre><p><em>The model above is deliberately condensed, as are the code samples that follow, but it preserves the object relationships and failure modes from the real migration.</em></p><h3>Why Move From Java 8 to Java 21?</h3><p>Java 8 was an excellent release. That is exactly why so many applications stayed on it for years. But keeping an application on Java 8 also keeps its framework and library choices close to the same generation.</p><p>Java 21 is an LTS release and gives a modern application several useful improvements:</p><ul><li><strong>A supported modern runtime:</strong> current security fixes, tooling, observability, and library ecosystems increasingly target newer JDKs.</li><li><strong>Better language modelling:</strong> records, pattern matching, improved switch expressions, and sealed classes can make rule models smaller and clearer.</li><li><strong>Modern concurrency options:</strong> virtual threads can simplify high-concurrency I/O workloads when used for the correct type of work.</li><li><strong>JVM improvements:</strong> years of garbage collector, runtime, container-awareness, and diagnostic improvements are included between Java 8 and Java 21.</li></ul><p>However, Java 21 does not automatically make every application faster. A poor query, shared mutable object, or expensive rule is still expensive. The upgrade gives us a better platform; application design still decides the result.</p><h4>Can we upgrade Java without upgrading Spring Boot?</h4><p>Sometimes — but only inside the framework’s supported Java range.</p><p>Spring Boot 2.6 officially supports Java versions up to Java 17. An application may appear to start on Java 21, but “it starts” is not the same as “the framework and all managed dependencies support this runtime.” Reflection, bytecode generation, proxies, test libraries, and embedded servers can fail later.</p><p>Spring Boot 3.2 requires at least Java 17 and officially supports Java 21. Therefore, if Java 21 is the destination, moving to a compatible Spring Boot generation is the safer target.</p><h4>Can we upgrade Spring Boot without upgrading Java?</h4><p>Not from Java 8 to Spring Boot 3. Spring Boot 3 requires Java 17 or newer and brings Spring Framework 6, Jakarta EE APIs, Hibernate 6, and newer managed dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vhL3MSnIE3aiyJWIx6Tvlw.png" /><figcaption><em>A staged migration reduces the size of each step; a coordinated migration is faster but creates a larger review and testing surface.</em></figcaption></figure><p>For a small application, a coordinated upgrade may be manageable. For a large multi-module application, first moving to the latest Spring Boot 2.7 release, then Java 17, Spring Boot 3, and finally Java 21 can make failures easier to isolate. This also follows Spring’s recommendation to reach the latest 2.7.x release before starting a Boot 3 migration. Either way, Java and Spring Boot versions should be selected as a tested compatibility pair.</p><h3>Upgrading the Ecosystem</h3><p>Changing Java from 8 to 21 moves much more than the compiler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*_XZY0uI4YQw4CgoQ0RzCWw.png" /></figure><h3>Why We Used OpenRewrite</h3><p>We could manually search for old imports, update every POM, fix deprecated APIs, and repeat the same work across all modules. That can work for a small project. In a large codebase, it is slow and easy to apply inconsistently.</p><p>OpenRewrite works on the structure and type information of source code instead of treating Java as plain text. A recipe can understand that an import, method call, Maven dependency, or configuration property represents a particular framework API.</p><p>For example, this configuration activates the Spring Boot 3.2 and Java 21 migration recipes:</p><pre>&lt;plugin&gt;<br>    &lt;groupId&gt;org.openrewrite.maven&lt;/groupId&gt;<br>    &lt;artifactId&gt;rewrite-maven-plugin&lt;/artifactId&gt;<br>    &lt;version&gt;6.44.0&lt;/version&gt;<br>    &lt;configuration&gt;<br>        &lt;exportDatatables&gt;true&lt;/exportDatatables&gt;<br>        &lt;activeRecipes&gt;<br>            &lt;recipe&gt;org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2&lt;/recipe&gt;<br>            &lt;recipe&gt;org.openrewrite.java.migrate.UpgradeToJava21&lt;/recipe&gt;<br>        &lt;/activeRecipes&gt;<br>    &lt;/configuration&gt;<br>    &lt;dependencies&gt;<br>        &lt;dependency&gt;<br>            &lt;groupId&gt;org.openrewrite.recipe&lt;/groupId&gt;<br>            &lt;artifactId&gt;rewrite-spring&lt;/artifactId&gt;<br>            &lt;version&gt;6.36.1&lt;/version&gt;<br>        &lt;/dependency&gt;<br>        &lt;dependency&gt;<br>            &lt;groupId&gt;org.openrewrite.recipe&lt;/groupId&gt;<br>            &lt;artifactId&gt;rewrite-migrate-java&lt;/artifactId&gt;<br>            &lt;version&gt;3.40.0&lt;/version&gt;<br>        &lt;/dependency&gt;<br>    &lt;/dependencies&gt;<br>&lt;/plugin&gt;</pre><p><em>Recipe and plugin versions continue to evolve, so the versions above are examples. The important part is the workflow.</em></p><h4>Step 1: Discover what is available</h4><pre>mvn rewrite:discover</pre><pre># Show more detail for one recipe<br>mvn rewrite:discover \<br>  -Ddetail=true \<br>  -Drecipe=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2</pre><p>discover confirms that the recipe artifacts are on the plugin classpath and shows which recipes are active. This avoids a confusing situation where the plugin runs successfully but the recipe you expected was never loaded.</p><h4>Step 2: Preview with a dry run</h4><pre>mvn rewrite:dryRun</pre><pre># Review the generated patch<br>less target/site/rewrite/rewrite.patch</pre><p>The exact report directory can vary with plugin configuration and version, but the idea is the same: dryRun produces a patch without editing source files.</p><p>This was especially useful for reviewing high-risk changes before mixing them with manual fixes. For example, a dry-run patch may show:</p><pre>- import javax.persistence.Entity;<br>+ import jakarta.persistence.Entity;</pre><pre>- &lt;version&gt;2.6.6&lt;/version&gt;<br>+ &lt;version&gt;3.2.12&lt;/version&gt;</pre><p>We can review the affected modules, identify recipes that are too broad, adjust exclusions, and rerun until the patch is understandable.</p><p>A dry run can also act as a CI guard. Setting failOnDryRunResults to true makes the build fail when a selected recipe still finds required changes.</p><pre>&lt;configuration&gt;<br>    &lt;failOnDryRunResults&gt;true&lt;/failOnDryRunResults&gt;<br>    &lt;activeRecipes&gt;<br>        &lt;recipe&gt;com.example.EnforceMigrationRules&lt;/recipe&gt;<br>    &lt;/activeRecipes&gt;<br>&lt;/configuration&gt;</pre><h4>Step 3: Apply and review</h4><pre>mvn rewrite:run<br>git status --short<br>git diff<br>mvn test</pre><p>We did not treat rewrite:run as the end of the migration. We treated it as a generated change set that still required code review, compilation, tests, and runtime verification.</p><h3>Is anything better than OpenRewrite?</h3><p>There is no single tool that is better for every migration. The right choice depends on what is changing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*mybWC5q3lKpqKQjrU2GfZA.png" /></figure><p>For the multi-module Promo Engine, OpenRewrite was a good starting point because one recipe could coordinate changes across Java source, POM files, framework APIs, and configuration. Manual review remained essential for persistence behaviour, mapping semantics, Kafka startup, and concurrency.</p><blockquote><strong>Lesson:</strong> use OpenRewrite to reduce repetitive work, not to replace engineering judgement.</blockquote><h4>The Biggest Problem: A Copy That Was Not Really a Copy</h4><p>The Java 8 Promo Engine used ModelMapper, which performs mapping at runtime using reflection. During the migration we replaced it with MapStruct, which generates mapping code during compilation and makes that behaviour visible.</p><p>The mapper interface looked simple:</p><pre>@Mapper(componentModel = &quot;spring&quot;)<br>public interface PromotionFactMapper {<br>    Promotion copyPromotion(Promotion source);<br>}</pre><p>We expected a completely independent promotion. But an early generated mapping did something similar to this:</p><pre>Set&lt;PromotionCondition&gt; sourceConditions = source.getPromotionConditions();</pre><pre>if (sourceConditions != null) {<br>    target.setPromotionConditions(new LinkedHashSet&lt;&gt;(sourceConditions));<br>}</pre><p>A new set was created, but the condition objects inside it were still shared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*g4TtUiQd7m1CyVSnZcbubA.png" /><figcaption><em>The collection was copied, but its mutable elements were not.</em></figcaption></figure><p>Think about evaluating the same promotion for two trips. We created a separate promotion container for each trip but placed the same physical condition objects inside both. When one evaluation changed a condition’s parent reference, the other evaluation saw that change.</p><p>In the real domain model, a condition had a back-reference to its parent promotion:</p><pre>public class PromotionCondition {<br>    private Promotion relatedToPromotion;<br>    private String expression;<br>}</pre><p>After mapping, we changed that reference to the request-specific promotion.</p><pre>@AfterMapping<br>default void rewire(@MappingTarget Promotion target) {<br>    target.getPromotionConditions().forEach(condition -&gt;<br>        condition.setRelatedToPromotion(target)<br>    );<br>}</pre><p>It worked perfectly with one request. With concurrent requests, every thread changed the same condition object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dWDbGkvgvi3A7eS8ggUzw.png" /><figcaption><em>A race condition created by shared mutable mapping state.</em></figcaption></figure><p>This is why the issue can disappear during local and staging testing. If Request A finishes before Request B starts, no thread overwrites the reference. Under production concurrency, overlapping requests eventually create the failing timing.</p><p>The correct fix was not another null check. A null check could hide the exception while the application still evaluates the wrong request data.</p><p>The correct fix was a real element-by-element copy.</p><pre>@Mapper(componentModel = &quot;spring&quot;)<br>public interface PromotionFactMapper {</pre><pre>    Promotion copyPromotion(Promotion source);</pre><pre>    @Mapping(target = &quot;relatedToPromotion&quot;, ignore = true)<br>    PromotionCondition copyCondition(PromotionCondition source);</pre><pre>    default Set&lt;PromotionCondition&gt; copyConditions(<br>            Set&lt;PromotionCondition&gt; source) {</pre><pre>        if (source == null) {<br>            return null;<br>        }</pre><pre>        return source.stream()<br>            .map(this::copyCondition)<br>            .collect(Collectors.toCollection(LinkedHashSet::new));<br>    }</pre><pre>    @AfterMapping<br>    default void rewire(@MappingTarget Promotion target) {<br>        target.getPromotionConditions().forEach(condition -&gt;<br>            condition.setRelatedToPromotion(target)<br>        );<br>    }<br>}</pre><p>We then inspected MapStruct’s generated implementation to confirm it called copyCondition() for every item.</p><blockquote><strong>Lesson:</strong> replacing a mapper is an object-semantics change. Test identity with assertNotSame(), not only field equality, and read the generated code.</blockquote><h3>Kafka Upgrades: Compatible Does Not Mean Unchanged</h3><p>A Spring Boot upgrade normally brings a newer Kafka client. A newer client can communicate with an older broker through protocol negotiation, but application APIs and runtime behaviour can still change.</p><p>For example, the Kafka Streams state-store query moved from a two-argument method:</p><pre>// Older API<br>kafkaStreams.store(<br>    storeName,<br>    QueryableStoreTypes.keyValueStore()<br>);</pre><p>to a parameter object:</p><pre>// Newer API<br>kafkaStreams.store(<br>    StoreQueryParameters.fromNameAndType(<br>        storeName,<br>        QueryableStoreTypes.keyValueStore()<br>    )<br>);</pre><p>That is the easy part because the compiler can find it. Thread behaviour is more subtle.</p><p>CompletableFuture.runAsync() uses a shared executor unless we provide one. Kafka, Avro, or another library may use the thread context classloader to find application classes. A generic pool thread is not always equivalent to a Spring-managed application thread.</p><pre>// Looks harmless, but the executor is selected by the JDK<br>CompletableFuture.runAsync(this::startKafkaStreams);</pre><h3>Why did it fail only in production?</h3><p>During the Promo Engine deployment, the same artifact started correctly in staging but failed during production startup. The difference was not the Kafka broker or the application code. It was the CPU limit.</p><p>The production container exposed four processors, so the common ForkJoinPool had a parallelism of three and CompletableFuture used its worker threads. In this execution path, those workers had the system classloader as their context classloader. The application was packaged as an executable WAR, so dependencies inside WEB-INF/lib were visible through Spring Boot&#39;s application classloader, not the plain system classloader.</p><p>Kafka received the serializer as a class name and tried to resolve it through that worker thread’s context classloader. The result was a startup error similar to:</p><pre>ConfigException: Class org.apache.kafka.common.serialization.StringSerializer<br>could not be found</pre><p>The staging container had a 1.6-CPU limit, giving it an effective common-pool parallelism of at most one. This CompletableFuture path therefore used a thread-per-task fallback. That new thread inherited the application classloader, and startup succeeded. A smaller environment accidentally avoided the bug.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*2jBXCDpgxKSUWz11wbv2sQ.png" /><figcaption><em>Resource limits changed the execution path, not merely its speed.</em></figcaption></figure><p>There are two useful defences. First, when a configuration API accepts a Class, pass the class object instead of its name. This removes an unnecessary runtime class lookup.</p><pre>// Avoid a string-to-class lookup when the API accepts Class&lt;?&gt;<br>props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);</pre><pre>// More fragile across classloader boundaries<br>props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());</pre><p>Second, make asynchronous infrastructure startup explicit instead of allowing the JDK to choose a global executor.</p><p>In the Promo Engine we created a dedicated virtual-thread executor. The important part is not merely that the threads are virtual; it is that the executor is application-owned and every thread receives the Spring Boot application classloader.</p><pre>@Bean(name = &quot;promoInitExecutor&quot;, destroyMethod = &quot;shutdown&quot;)<br>ExecutorService promoInitExecutor() {<br>    ClassLoader appLoader =<br>        Thread.currentThread().getContextClassLoader();</pre><pre>    return Executors.newThreadPerTaskExecutor(task -&gt; {<br>        Thread thread = Thread.ofVirtual()<br>            .name(&quot;promo-initialization-&quot;, 0)<br>            .unstarted(task);<br>        thread.setContextClassLoader(appLoader);<br>        return thread;<br>    });<br>}</pre><p>We then passed that executor explicitly to both startup tasks:</p><pre>CompletableFuture&lt;Void&gt; kafkaFuture = CompletableFuture.runAsync(<br>    kafkaInitializer::init,<br>    promoInitExecutor<br>);</pre><pre>CompletableFuture&lt;Void&gt; cacheFuture = CompletableFuture.runAsync(<br>    executorApiService::loadCache,<br>    promoInitExecutor<br>);</pre><pre>CompletableFuture.allOf(kafkaFuture, cacheFuture).join();</pre><p>Startup order also matters. If promotion evaluation depends on Kafka-backed state, the application should not report itself ready before that state is available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XnuT778vklkAaCBMuz8KrA.png" /><figcaption><em>Readiness should mean the application can make a correct decision.</em></figcaption></figure><blockquote><strong>Lesson:</strong> environment size can change concurrency control flow, not only performance. Verify client-to-broker compatibility, API changes, thread context, startup ordering, and readiness as separate concerns.</blockquote><h3>Configuration Changes Can Fail Silently</h3><p>Compilation failures are useful because they stop us. Configuration changes are dangerous because the application may continue with a default value.</p><p>Redis property names changed between Spring Boot generations:</p><pre># Spring Boot 2.x<br>spring.redis.cluster.nodes=redis-01:6379,redis-02:6379<br>spring.redis.timeout=5000</pre><pre># Spring Boot 3.x<br>spring.data.redis.cluster.nodes=redis-01:6379,redis-02:6379<br>spring.data.redis.timeout=5000ms</pre><p>If the old property is ignored, the client may fall back to a default such as localhost:6379. The Java code is valid. The property file looks familiar. The application connects to the wrong place.</p><p>So we should verify effective runtime configuration: the resolved host, timeouts, pool sizes, health indicators, and environment overrides — not only the text in application.properties.</p><h3>The Invisible Date-Time Character</h3><p>Date-time was not the biggest migration problem, but it was one of the best examples of why API contracts should not depend on human formatting.</p><p>These two values look the same:</p><pre>&quot;6/5/26, 7:00 AM&quot;   // U+0020 before AM<br>&quot;6/5/26, 7:00 AM&quot;    // U+202F before AM</pre><p>The second value contains a narrow no-break space. A strict parser expecting a regular ASCII space can reject it.</p><p>The compatibility fix normalized the character, used an explicit locale, and accepted the existing formats during the transition.</p><pre>public Date parseLegacyDate(String value)<br>        throws ParseException {</pre><pre>    String normalized = value.replace(&#39;\u202F&#39;, &#39; &#39;);<br>    SimpleDateFormat formatter =<br>        new SimpleDateFormat(&quot;M/d/yy, h:mm a&quot;, Locale.ENGLISH);<br>    formatter.setLenient(false);</pre><pre>    return formatter.parse(normalized);<br>}</pre><p>The better long-term contract is an ISO 8601 value with an explicit offset:</p><pre>2026-06-05T07:00:00+05:30</pre><p>We should also choose Java Time types according to meaning: LocalDate for a date, LocalTime for a local time, LocalDateTime for a timezone-free local value, and Instant for a point on the global timeline.</p><h3>A Practical Migration Checklist</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*EH28vy3F_ay7kejKHtm59Q.png" /></figure><h3>Conclusion</h3><p>A Java 8 to Java 21 migration is valuable. It gives us a supported runtime, modern language capabilities, newer frameworks, and a better foundation for future work.</p><p>But changing the Java version is only the visible part.</p><p>The real migration includes every hidden assumption around the code: whether a mapper creates independent objects, whether a background thread can load application classes, whether startup means ready, whether old configuration keys are still recognized, and whether a space is actually an ASCII space.</p><p>So the migration is not complete when the build is green. It is complete when the application’s behaviour is understood and verified on the new runtime.</p><blockquote><strong>If there is one thing to remember:</strong> when replacing a framework or library, do not only ask, “Does the new API compile?” Ask, “Which old behaviours was my application depending on without knowing it?”</blockquote><h3>References</h3><ul><li><a href="https://docs.openrewrite.org/recipes/java/spring/boot3/upgradespringboot_3_2">OpenRewrite — Migrate to Spring Boot 3.2</a></li><li><a href="https://docs.openrewrite.org/recipes/java/migrate/upgradetojava21">OpenRewrite — Migrate to Java 21</a></li><li><a href="https://docs.openrewrite.org/reference/rewrite-maven-plugin">OpenRewrite Maven Plugin</a></li><li><a href="https://docs.spring.io/spring-boot/docs/2.6.7/reference/html/getting-started.html#getting-started.system-requirements">Spring Boot 2.6.7 System Requirements</a></li><li><a href="https://docs.spring.io/spring-boot/docs/3.2.12/reference/html/getting-started.html#getting-started.system-requirements">Spring Boot 3.2.12 System Requirements</a></li><li><a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide">Spring Boot 3.0 Migration Guide</a></li><li><a href="https://github.com/spring-projects-experimental/spring-boot-migrator">Spring Boot Migrator</a></li><li><a href="https://docs.spring.io/spring-boot/docs/3.2.12/reference/html/howto.html#howto.properties-and-configuration.migrate-3.0">Spring Boot Properties Migrator</a></li><li><a href="https://mapstruct.org/documentation/stable/reference/html/">MapStruct Reference Guide</a></li><li><a href="https://kafka.apache.org/36/javadoc/org/apache/kafka/streams/KafkaStreams.html">Kafka Streams 3.6 API</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c50be8e951c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/pickme-engineering-blog/what-actually-broke-when-we-migrated-pickmes-promo-engine-from-java-8-to-java-21-2c50be8e951c">What Actually Broke When we Migrated Pickme’s Promo Engine from Java 8 to Java 21</a> was originally published in <a href="https://medium.com/pickme-engineering-blog">The PickMe Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka or RabbitMQ? What’s Better?]]></title>
            <link>https://medium.com/@dilshankavinga/kafka-or-rabbitmq-whats-better-6bb53cf55be7?source=rss-5ecec9f4d9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bb53cf55be7</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Dilshan Boteju]]></dc:creator>
            <pubDate>Fri, 25 Oct 2024 07:05:31 GMT</pubDate>
            <atom:updated>2024-10-25T07:05:31.868Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s the deal. This article does not discuss what is best to use out of Kafka or RabbitMQ (even though it&#39;s implied in the title). This article does not make any comparison between those two and its features. Rather, this article is about the concept of these two different message-streaming tools and the industry-level use cases in which they can be used. Trust me, after you read this article ( to the end, hopefully), they both have their own use cases and where one is better suited than the other. So hang on tight; let’s dive in.</p><h3>Why Message Broker?</h3><p>Most of the time, we implement microservices based on REST(sometimes it is graphic). When implementing a solution based on the REST, we expect it to be asynchronous. What asynchronous means is we don’t wait for things to happen. It not blocking our next call. But the protocol we use to do the microservices most of the time is HTTP, which is synchronous. So, as long as we use REST API using HTTP/HTTPS to implement microservices, this becomes synchronous. To avoid that, the biggest and the best solution we have is message-streaming. Out of all the message brokers out there, what should we choose? That is the biggest question. There are lots of them out there, but for this article, we’re going to talk about the most popular two, RabbitMQ and Apache Kafka.</p><p>Nowadays, most people dive right into Kafka because it is a kind of posh farmwork. It can handle tons of throughput as per the documentation, is robust, and has powerful cluster distribution management. All of those are true, but the real question is, do we really need all of those things in our solution? It&#39;s like getting a sandwich from a shop 50m away from your home by motorcycle vs. taking your BMW car. That is the question that this article answers.</p><h3>Kafka vs RabbitMQ — Concepts</h3><p>So these two are there for different purposes, although sometimes we mix these based on the requirement. RabbitMQ is an ordinary queue management protocol. (Remember, first in, first out in data structures). So Kafka also acts almost the same, but it is more than that. We consider it a stream processing system. It is great at processing a stream of messages, unlike rabbitMQ. There are many more differences between these two, how they work and their architecture, but that is the main difference. We use rabbitMQ with the <strong>Advanced Message Queuing Protocol(AMQP)</strong> library. This library is mainly used for rabbitMQ, and Kafka has their own client and stuff.</p><p>The biggest difference here is that rabbitMQ is a <strong>SMART BORKER</strong>. This means that we can do all the routing(content-based routing, header-based routing, etc.) inside the rabbitMQ. But Kafka is, more or less, a dumb broker. We can do all those things with the broker in Kafka, but there’s a different architecture to achieve them. So, this overall picture shows the differences between these two.</p><p>Let&#39;s explore how Kafka and rabbitMQ work, then compare what and when to use each. Since this will be a complete use-case base, we must consider different use cases to determine which to use.</p><h3>Kafka vs RabbitMQ — Senario 1</h3><p>For example, we’re developing a system where a bunch of perches orders are being created. Once you create a perches order, it must go through an approval process, which will take 2 minutes. So clearly, it is a bad design if we keep the user waiting for 2 minutes until it gets approved. It will be a very unpleasant user experience. So instead of clicking the button and waiting for 2 minutes, we give a button to submit perches orders to the queue in the back-end, and the queue will take it and process it. So, let’s assume we have such a system where we submit 10 orders per minute for approval. So we indeed need a queue management system. The nature of this problem is that the approval process needs to happen <strong>only in </strong>your system, not including some other third party. Even if there’s some other system, it doesn’t care about your order until it gets approved by your system. So we take these orders, 10 orders per minute, we approve it, and then send the notification saying it&#39;s approved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*5maKRJPvM6L8fG1vEumUUg.png" /></figure><p>So, a system like the RabbitMQ queue managment system is an idol. Why? Because the system we described previously is an ordinary queue requirement. We send something into the queue, then take first come first out of the queue and do the rest of the processing. But on the other hand, Kafka can do the same. However, Kafka is not designed for something like this. For example, let&#39;s say two types of perches orders require two approval processes. One type can be items less than 10 go to one approval process, and items more than 10 go to different approval processes. In RabbitMQ <strong>AMQP, </strong>this works because it has something called <strong>Exchanges, </strong>where the publisher publishes the message. Different queues are bound to this exchange, which receives the published message. In Exchange, we can have something called a route key, which is used to push this message to the queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*3rJOZTV5aTHGDSTU8_dgsg.png" /></figure><p>There are several exchange types based on their behaviour, like <strong>Fanout Exchange, </strong>which copies the message from the exchange to every queue that bids to that exchange. Then, there’s a <strong>Direct Exchange, </strong>where we can target messages to a particular queue(based on exchange configuration) so that consumers can attach to the required queue. We can decide which queue to reach from the broker based on message properties, Header properties, or something else.</p><p>We can&#39;t do this in Kafka(native Kafka). It’s not designed to do this. But some Kafka variants with some plug-ins wrapped up with it can achieve this. For this article, we talk about native Kafka. Kafka, we can push the message in one of the topics, the same as RabbitMQ does with Exchanges, and we can attach consumers to the same topic. Then, the consumers will get the message. Then, it’s up to consumers to decide what to do with the message. It’s a pub-sub pattern.</p><h3>Kafka vs RabbitMQ — Senario 2</h3><p>Another example is, let&#39;s say, a sales order system. The requirement is that once a sales order is ready, other systems should be notified about it, which Kafka is best suited for. But let’s say that among these systems, there is a legacy system in which APIs are hidden or don&#39;t know how to be called. Using Kafka, we can change that. Let’s say this legacy system saves its sales order to a database table. In such a situation, we can use <strong>Change data capture (CDC) </strong>to trigger and publish the saved data as a message to a Kafka topic. Then, whatever service(can be an application, file store, or S3 bucket) is interested in, that legacy system can get notified and act upon it every time it saves a sales order(where Kafka connectors come in handy).</p><p>So, if something happens but we only want our module to be concerned about it, we can use RabbitMQ. But if something happens, and many other parties are concerned about it, we can use Kafka.</p><h3>Kafka vs RabbitMQ — Senario 3</h3><p>Let&#39;s take another different example. Let’s assume messages are coming to 10 messages per minute. Let&#39;s see how RabbitMQ and Kafka handle this scenario</p><blockquote>RabbitMQ</blockquote><p>for RabbitMQ; it comes to Exchange and then to the queue where the consumer is attached to the queue. However, the consumer can process 2 messages per minute. This means there will be lots of messages on the queue that are piling up to process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*zaDHH0BbXkDSnH4q0L8-gA.png" /></figure><p>So, the obvious choice is to add more consumers to the queue. If we add 5 consumers instead of one, each process 2 messages per minute, will process all 10 messages per minute. Which solves our problem. consumers will process these messages in round-robin way(consumer 1 get 1st and 6th message, consumer 2 get 2nd and 7th message like wise).</p><p>But let&#39;s say some messages take a longer time to process, as shown in the diagram below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*gzSJ1X4VncWQXjAImv14Vw.png" /></figure><p>So it seems like consumer 1 gets messages that require a longer time to process while consumer 3 gets messages that take a short time to process. So, in that case, consumer 3 will be idle most of the time while consumer 1 is working. RabbitMQ doesn’t wait for consumers to finish processing. It keeps sending the message.</p><p>So, to avoid this, RabbitMQ has something called fair dispatch. What happen is there’s a property called prefetch. Let’s say we set the prefetch count as 2. RabbitMQ will only give 2 messages per consumer, and it waits for the process to give another 2 messages. In that case, one consumer will not pile up with messages, or other consumers will go idol.</p><p>Also, the default nature of rabbitMQ is to delete the message from the queue once a consumer consumes it. What is consumer fails to process the message?, the message is gone. To resolve that, rabbitMQ has something called the ack(acknowledgement) mechanism. We can inform the queue not to do the auto acknowledgement. Rather, we can acknowledge it once the message is processed or saved somewhere.</p><blockquote>Kafka</blockquote><p>When it comes to the same scenario, 10 messages per minute and one consumer takes 15 seconds to process the message of a cause; we can add more customers to the topic. But unlike RabbitMQ, every consumer gets the same message. If this is a problem for our design, for example, we don&#39;t want some consumers to get the same message; there’s a solution for that, too. This is where Kafka consumer Gropus comes into play. However, there are still some limitations, which is why if we decide to go with Kafka, the design distribution mechanism should be perfect.</p><p>In Kafka, we can create multiple partitions within the same topic. If the ordering of the messages matters, we should always send the message with the key. When the key is null, the record is sent randomly to one of the available partitions of the topic. If a key exists, Kafka hashes the key, and the result is used to map the message to a specific partition. This ensures that messages with the same key end up in the same partition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*6PGLXSSEHq_P4jgKtas98A.png" /></figure><p>As an example, let&#39;s say we’re sending employee details as a message, and we can use the employee ID as the key. We can guarantee that employee details with the same employee ID are delivered into the same partition. In this, Kafka maintains order within a single partition, not within the topic. So we can take different consumers and configure them to the same consumer group using the group name in every consumer, so the partition will deliver the message using a round robbing pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*ahNjJjf459tYMUCLHpql9g.png" /></figure><p>But here’s the catch. The number of consumers should not exceed the number of partitions. This means if we have 3 partitions but 4 consumers, the fourth one always will be ideal. We can get the same RabbitMQ behaviour, but the number of consumers can’t exceed the number of partitions in the <strong>same consumer group.</strong></p><p>The Next burning question is when you have this many parties and this many consumers, how does Kafka know which message to deliver to which consumer? Unlike RabbitMQ, Kafka has retained the policy. We can retain the message within Kafka. But RabbitMQ deletes it as soo as we acknowledge it. So we can re-visit the message within Kafka later. To do that, Kafka uses something called consumer offset. The consumer offset is a way of tracking the sequential order in which messages are received by Kafka topics. As an example, let&#39;s say we have a microservice consuming the message from the Kafka topic, but suddenly, it shuts down. Then when it restarts, it will consume the message where it stopped. Not from the beginning.</p><h3>Conclusion</h3><p>Now, if we think about scenario 3, using Kafka can cater to the requirement but requires more configuration, while RabbitMQ supports this requirement default. So, we can use Kafka, where we use RabbitMQ, but we need to be careful with configurations.</p><p>So, based on these scenarios, we can conclude that it is not about which one is better than the other, but rather which one is good for the given requirement.</p><p><em>Read More..</em></p><ul><li><a href="https://medium.com/javarevisited/how-to-use-spring-profiles-8ad3baa56d51">How to use Spring Profiles?</a></li><li><a href="https://medium.com/javarevisited/what-is-springboot-security-and-how-to-setup-325c6753b320">What is Springboot Security and How to Setup?</a></li><li><a href="https://medium.com/javarevisited/15-system-design-tradeoffs-every-senior-developer-must-know-692e3f9b90ce">15 System Design Tradeoffs Every Senior Developer Must Know</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bb53cf55be7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Database partitioning, sharding, and replication.]]></title>
            <link>https://medium.com/@dilshankavinga/understanding-database-partitioning-sharding-and-replication-d77ddb95cf5c?source=rss-5ecec9f4d9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d77ddb95cf5c</guid>
            <dc:creator><![CDATA[Dilshan Boteju]]></dc:creator>
            <pubDate>Thu, 01 Aug 2024 16:26:33 GMT</pubDate>
            <atom:updated>2024-08-01T16:26:33.817Z</atom:updated>
            <content:encoded><![CDATA[<p>First, these main concepts make databases work more efficiently, handling large amounts of data optimally. They also improve the performance, manageability, and availability of larger databases. By the way, these concepts can be used in both SQL and NoSQL databases.</p><p>Before we dive into this, remember there are more ways to optimize our CURD operations, like database normalization(basic), optimizing queries, etc.</p><p><strong>What is partitioning?</strong></p><p>It is a general term for dividing tables in a database instance into smaller sub-tables or partitions.</p><p>Now, what kind of situation does partitioning need to be used for? Over time, tables containing large amounts of data may experience performance issues with long-running queries and data manipulation (DML) operations. In these situations, dividing the dataset into smaller, more manageable parts can be an effective solution.</p><p>There are typically two main strategies for database partitioning:</p><ol><li>vertical partitioning</li><li>horizontal partitioning</li></ol><p>The primary purpose of vertical partitioning is to handle regularly updated columns. To avoid changing the rest of the data needlessly, separate these columns into a new table or partition(most like highly normalization).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*5yiYpIVqEG-kBh22.png" /></figure><p>Horizontal partitioning splits a table into several partitions according to its rows. Imagine you have 100 user records in the user table. Now, in horizontal partitioning, you can split 50 users into one user table and the rest into another table. Each partition holds a fraction of the original table’s rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*B4mltDIGcRlqWD6H.png" /></figure><p><strong>What is Sharding?</strong></p><p>Sharding is a subset of partitioning, but different shards are distributed across multiple servers. Let’s say in the database you have customers in a region vice like the United States (US), Japan(JP), Spain(SP), and Sri Lanka (SL). So, in this case, multiple customers (records) can be in the US region. So, if millions of customer records exist, US customers will be put in one database. JP customers in another database. So, in this case, reading and writing the data can be done fast because it does not take millions of recodes to find the data. So if the US customer needs their data retrieved from the database, it can just get the data from the US region shared with only US customer data. This will add more performance to the system.</p><p>This is just one example. You can do it another way, like if there are millions of customer records instead of a region alphabetical order in the customer name. Names start with the letter ‘A’ in one shard, and so on(since not many names start with ‘X’,’ Y’, and ‘Z’, all three can be one shard). It may sound like indexing, but not entirely. It will guarantee processing by a separate data processing engine, separate memory, and everything separate.</p><p><strong>What is Replication?</strong></p><p>Data replication involves creating copies of the same data and distributing them across different servers. By storing data copies in various locations, organizations can safeguard against data loss due to unexpected events such as disasters, outages, or other disruptions. If one server fails, others can step in, ensuring high availability and fault tolerance.</p><p>Also, we can do like write operations using the primary database and read operations using replicas. These replicas can be synced almost in real-time, or we can use replicas as a backup by sending the data from time to time using log shipping techniques.</p><p>Replication and sharding are often used together. When combined, sharding divides the database into smaller partitions to scale it. At the same time, replication maintains multiple copies of each partition to enhance data reliability and availability. This approach allows the system to efficiently handle large volumes of data and remain resilient against potential failures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d77ddb95cf5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating Multi-Tenancy: A Clear Path to Shared Digital Success]]></title>
            <link>https://medium.com/@dilshankavinga/navigating-multi-tenancy-a-clear-path-to-shared-digital-success-883d355eb586?source=rss-5ecec9f4d9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/883d355eb586</guid>
            <dc:creator><![CDATA[Dilshan Boteju]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 11:26:18 GMT</pubDate>
            <atom:updated>2024-01-03T11:26:18.337Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pZwI3i7OoZDxpyRp.jpg" /><figcaption>Multi-Tenancy</figcaption></figure><h4>Introduction</h4><p>Multi-tenancy is a concept that’s gaining traction in the world of technology, particularly in cloud computing and software as a service (SaaS). In its essence, multi-tenancy is a way of maximizing resource efficiency and providing cost-effective solutions for businesses. In this article, we’ll break down the concept of multi-tenancy into simple terms, using real-world examples to illustrate its significance.</p><h4>Why Multi-tenancy?</h4><p>Before the advent of multi-tenancy, organizations adhered to a traditional approach characterized by siloed infrastructure and isolated computing environments. In this antiquated model, each business unit or department operated its own dedicated servers and hardware, leading to inefficient resource utilization and significant duplication of efforts. Companies had to individually purchase, install, and maintain software and hardware for each application, resulting in higher costs and a lack of scalability. The isolated nature of this approach meant that upgrading or maintaining applications required intricate attention to each server, making the process complex, time-consuming, and prone to errors. Overall, the old approach hindered agility, scalability, and cost-effectiveness, prompting the evolution towards multi-tenancy as a superior alternative in the modern era of interconnected and collaborative computing.</p><p>Multi-tenancy has emerged as a transformative paradigm in technology due to its ability to revolutionize resource efficiency, scalability, and cost-effectiveness. In contrast to the old approach of isolated infrastructure, multi-tenancy enables multiple tenants or users to share common resources on a single platform. This shared model leverages economies of scale, optimizing resource utilization and significantly reducing costs associated with hardware, maintenance, and upgrades. The flexibility of multi-tenancy allows for seamless scalability, dynamically allocating resources based on the varying needs of individual tenants. Centralized maintenance streamlines updates and patches, eliminating the complexities of the traditional model and ensuring improvements are universally applied. Moreover, the collaborative nature of multi-tenancy fosters improved data sharing and cooperation among tenants while maintaining strict data isolation and security. Ultimately, multi-tenancy represents a forward-thinking approach that enhances efficiency, flexibility, and collaboration in the ever-evolving landscape of digital technology.</p><blockquote>Multi-tenancy is like turning a big building into apartments where different families live independently but share the same infrastructure, like the hallway and the elevator. In the same way, in the world of technology, multi-tenancy means sharing computer resources like servers and software among different groups or “tenants.” This is much more efficient because everyone benefits from the same resources, making things cost less and work better. It’s like having a big playground where many kids can play using the same swings and slides — everyone gets to have fun without needing a separate playground for each person. Multi-tenancy helps computers and software work together smarter and saves a lot of time and money for everyone involved.</blockquote><h4>Understanding Multi-Tenancy:</h4><p>Let’s try to understand it using the previous apartment example. Imagine you’re the owner of an apartment building with multiple apartments. Each apartment is independent and has its own set of keys, ensuring privacy and security for its occupants. Now, let’s translate this scenario into the digital realm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*gfiXnFQLQtO_YkMm96B-mA.png" /><figcaption>Tenants are using common utilities and resources.</figcaption></figure><p>In the world of technology, multi-tenancy is like having a single software application that serves multiple users or “tenants” in a shared environment. These tenants can be individual users, departments within a company, or even separate organizations. The key is that they all use the same software application but maintain distinct and secure spaces within it.</p><h4>Database architectures</h4><p>Multi-tenant applications often require a robust and scalable database architecture to efficiently manage data for multiple tenants while ensuring isolation and performance. Here are some common database architecture types for multi-tenant applications:</p><ul><li><strong>Shared Database, Shared Schema: </strong>In this database architecture for multi-tenant applications, all tenants utilize a single database with a common schema. Each record is tagged with a “tenant ID” to differentiate data between tenants. This approach simplifies maintenance and reduces costs but may pose challenges in terms of customization and could lead to potential performance bottlenecks due to shared resources.</li><li><strong>Shared Database, Separate Schema: </strong>Similar to the shared database model, this approach allows for separate schemas for each tenant. While offering more customization options, it increases the complexity of database management and maintenance efforts. This is suitable for scenarios where tenants require unique data structures but still benefit from some shared components.</li><li><strong>Separate Database, Shared Schema: </strong>Each tenant has its own dedicated database, but all databases share a common schema. This provides better isolation than a shared database but comes with increased resource usage and maintenance overhead. This model is advantageous when balancing customization needs with the desire for consistent data structures across tenants.</li><li><strong>Separate Database, Separate Schema:</strong> Offering the highest level of isolation, each tenant in this architecture has an individual database with a unique schema. This approach ensures complete data separation and tailored customization for each tenant. While providing maximum flexibility, it also comes with increased infrastructure requirements and maintenance complexity, making it suitable for applications with stringent data privacy and customization requirements, such as ERP systems.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*RMScYLmZRuXhgUx8.png" /></figure><p>Simply put, <em>Michelle</em>, <em>Gary</em> and <em>Laura</em> use the same application. But <em>Michelle</em> and <em>Gary</em> work for the same organization whose <em>tenet ID</em> is <strong>1</strong>. But <em>Laura</em> works for a different organization whose <em>tenet ID</em> is <strong>2</strong>. Even those whose data are recorded in the same database only can access their tenet data.</p><h4>Conclusion:</h4><p>Multi-tenancy simplifies the complex world of computing by sharing resources efficiently. Whether it’s cloud computing, SaaS, or other technology services, understanding this concept is crucial for businesses aiming to optimize their operations. By embracing multi-tenancy, organizations can foster collaboration, increase efficiency, and drive innovation in an increasingly interconnected digital landscape.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=883d355eb586" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unraveling the Potential of Semantic Web Technologies]]></title>
            <link>https://medium.com/@dilshankavinga/unraveling-the-potential-of-semantic-web-technologies-17dfab52bf94?source=rss-5ecec9f4d9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/17dfab52bf94</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[cicd-pipeline]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Dilshan Boteju]]></dc:creator>
            <pubDate>Sun, 31 Dec 2023 05:37:52 GMT</pubDate>
            <atom:updated>2023-12-31T05:37:52.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JaurHnr8KV7l9ljq.png" /><figcaption>Sir Tim Berners-Lee Semantic Technology</figcaption></figure><p>The evolution of the World Wide Web has witnessed significant advancements, with the Semantic Web emerging as a revolutionary paradigm. Semantic Web technologies promise to transform the way information is organized, linked, and understood on the Internet. In this article, we delve into the intricacies of Semantic Web technologies, exploring their foundations, key components, applications, and the transformative impact they can have on the digital landscape.</p><p>The term “semantic” denotes comprehension or meaning. Because of this, the Semantic Web differs fundamentally from other data-related technologies (such as relational databases or the World Wide Web itself) in that it is <strong><em>focused on meaning rather than structure</em></strong>. Note: Semantic Search and Natural Language Processing (NLP) are two more semantic technologies.</p><h4>Foundations of Semantic Web Technologies</h4><blockquote>At its core, the Semantic Web is an extension of the traditional web where information is not only presented for human consumption but is also structured and understandable by machines. The foundation of Semantic Web technologies lies in resource description frameworks (RDF), which provide a standardized way of describing resources and their relationships. RDF enables the creation of a web of linked data, forming the backbone of the Semantic Web.</blockquote><p>Imagine the internet as a giant library where information is stored in books. The traditional web is like a library where books are placed on shelves, and we humans can read and understand them. However, machines, like computers, find it challenging to comprehend this information as we do.</p><p>Now, let’s introduce the Semantic Web. It’s like a super-smart library where the books not only contain information but also have special labels and tags that machines can easily understand. This labeling system is what we call RDF, or resource description framework.</p><p>In simpler terms, RDF is like adding labels to the books in our library. Each label describes a particular aspect of the book, such as its author, genre, or publication date. These labeled books, when connected, create a web of linked data. This web is the backbone of the Semantic Web.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/0*psFufOQlQ2mBgqMX" /><figcaption>Smart Snippets turn web pages into databases</figcaption></figure><p>Let’s break it down with an example:</p><ol><li><strong>Traditional Web (Without Semantic Web):</strong></li></ol><ul><li>Book: “Alice in Wonderland”</li><li>Information: The book is written by Lewis Carroll.</li></ul><p>On the traditional web, this information is presented as it is, but machines might need help understanding the relationship between the book and its author.</p><p>2. <strong>Semantic Web (With RDF):</strong></p><ul><li>Book: “Alice in Wonderland”</li><li>Label: Author — Lewis Carroll</li></ul><p>In the Semantic Web, we add labels to our information. Now, the machine can quickly grasp that Lewis Carroll is the author of “Alice in Wonderland.”</p><p>This structured information becomes powerful when you have many labeled books connected together. For instance, you can easily find all books by Lewis Carroll or explore a genre by following the labeled connections.</p><h4>Key Components of Semantic Web Technologies:</h4><ol><li><strong>RDF (Resource Description Framework):</strong> RDF serves as the fundamental building block, allowing the representation of information in a machine-readable format. It utilizes subject-predicate-object triples to create relationships between resources.</li><li><strong>OWL (Web Ontology Language):</strong> OWL is a powerful language for expressing ontologies, which define the relationships and properties of concepts within a particular domain. It enhances the expressiveness of RDF by enabling the creation of complex relationships and classifications.</li><li><strong>SPARQL (SPARQL Protocol and RDF Query Language):</strong> SPARQL is the query language for the Semantic Web, facilitating the extraction of information from RDF datasets. It allows developers to query data across diverse sources, making it a crucial component for creating intelligent applications.</li></ol><h4>Applications of Semantic Web Technologies:</h4><ul><li><strong>Improved Data Integration:</strong> Semantic Web technologies enable seamless integration of data from diverse sources. By providing a common framework for describing relationships, data silos can be broken down, and information can be linked across domains.</li><li><strong>Enhanced Search and Discovery:</strong> Traditional search engines rely on keyword matching, often leading to information overload. Semantic Web technologies, on the other hand, enable more precise and context-aware searches, enhancing the relevance and accuracy of search results.</li><li><strong>Knowledge Graphs:</strong> Companies and organizations are leveraging Semantic Web technologies to build knowledge graphs, representing interconnected information in a structured format. Knowledge graphs facilitate a deeper understanding of data and support intelligent decision-making processes.</li><li><strong>AI and Machine Learning Integration:</strong> Semantic Web technologies provide a structured framework for integrating AI and machine learning models. By enhancing the interoperability of data, these technologies enable more effective utilization of advanced analytics in various domains.</li></ul><h4>What are the tools we need to build Semantic Web Applications?</h4><p>Building Semantic Web applications involves using various frameworks and technologies that support the principles of the Semantic Web. Below are the frameworks and technologies that provide a solid foundation for building applications that leverage the principles of the Semantic Web, making data more interconnected and machine-understandable. Depending on your specific needs and preferences, you may choose a combination of these tools to develop Semantic Web applications(only popular ones are listed here).</p><ol><li><strong>Resource Description Framework (RDF):</strong> Jena, RDFlib, Apache Marmotta.</li><li><strong>SPARQL (SPARQL Protocol and RDF Query Language):</strong> Apache Jena Fuseki, Virtuoso, RDF4J.</li><li><strong>Web Ontology Language (OWL):</strong> Protege, OWL API.</li><li><strong>Linked Data:</strong> LOD2 Stack, D2R Server.</li><li><strong>Triplestore:</strong> Apache Jena TDB, Virtuoso, Stardog.</li></ol><blockquote>Since Apache Jena included most tools required to develop Semantic Web applications, I created an application using ReactJs and Sprinngboot which you can find the GitHub links below</blockquote><ul><li><a href="https://github.com/dilshan93/demo-blazegraph-frontend.git">FrontEnd</a></li><li><a href="https://github.com/dilshan93/demo-blazegraph.git">BackEnd</a></li></ul><h4>Conclusion</h4><p>the Semantic Web represents a paradigm shift in how we conceptualize and utilize information on the Internet. By providing a standardized and machine-understandable framework, Semantic Web technologies pave the way for a more intelligent and interconnected digital ecosystem. As industries continue to embrace these technologies, we can anticipate a future where information is not just presented but is truly comprehended, opening new possibilities for innovation and discovery.</p><p>Happy Coding Everyone !!</p><h4>References:</h4><ul><li>Cambridge Semantics. (n.d.). Introduction to the Semantic Web. [online] Available at: <a href="https://cambridgesemantics.com/blog/semantic-university/intro-semantic-web/">https://cambridgesemantics.com/blog/semantic-university/intro-semantic-web/</a>.</li><li>Ontotext. (n.d.). What is Semantic Technology? [online] Available at: <a href="https://www.ontotext.com/knowledgehub/fundamentals/semantic-technology/">https://www.ontotext.com/knowledgehub/fundamentals/semantic-technology/</a>.</li><li>Maureen (2022). What Is the Semantic Web? (Includes Examples). [online] 1Kosmos. Available at: <a href="https://www.1kosmos.com/blockchain/semantic-web/">https://www.1kosmos.com/blockchain/semantic-web/</a> [Accessed 31 Dec. 2023].</li><li>Cagle, K. (n.d.). <em>The Semantic Web Comes of Age</em>. [online] Forbes. Available at: <a href="https://www.forbes.com/sites/cognitiveworld/2018/08/03/the-importance-of-schema-org/?sh=20fea81533b9">https://www.forbes.com/sites/cognitiveworld/2018/08/03/the-importance-of-schema-org/?sh=20fea81533b9</a> [Accessed 31 Dec. 2023].</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17dfab52bf94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Microservices Landscape: A Comprehensive Roadmap]]></title>
            <link>https://medium.com/@dilshankavinga/navigating-the-microservices-landscape-a-comprehensive-roadmap-c9fd7271ee5b?source=rss-5ecec9f4d9f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9fd7271ee5b</guid>
            <dc:creator><![CDATA[Dilshan Boteju]]></dc:creator>
            <pubDate>Thu, 28 Dec 2023 05:11:19 GMT</pubDate>
            <atom:updated>2023-12-28T05:11:19.163Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1Tn4WtarHRqb9A0Ygm_4Q.gif" /><figcaption>credited to <a href="https://www.linkedin.com/in/hinaaroraa?miniProfileUrn=urn%3Ali%3Afs_miniProfile%3AACoAABpDUJ0BowkjKeWqbn5vmgqWb1KgpzPW6qI">Hina Arora</a></figcaption></figure><p>In the ever-evolving software development landscape, microservices have emerged as a transformative architectural approach. Breaking down monolithic applications into smaller, independent services can improve scalability, flexibility, and maintainability. However, adopting a microservices architecture requires careful planning and execution. In this article, we’ll explore a comprehensive roadmap for successfully navigating the microservices journey.</p><h4>Languages/ Framework</h4><p>Choosing a programming language involves considering project requirements, developer expertise, community support, performance, and scalability. For example, Python (Flask as the framework example)is favored for data science due to its simplicity, while languages like Java(Spring as the framework example) are chosen for enterprise applications.</p><ul><li>Python -&gt; Django, Flask</li><li>Java -&gt; Spring Boot</li><li>Golang -&gt; Gin, Echo</li><li>JavaScript -&gt; Node.js (for server-side), React, Angular, Vue.js (for client-side)</li></ul><h4>Databases</h4><p>The right database for a project involves considering factors such as data structure, scalability, performance, and the nature of the application. For instance, relational databases like PostgreSQL are suitable for applications requiring complex queries and transactions, while NoSQL databases like MongoDB excel in handling large volumes of unstructured data with high scalability. Assess the data consistency requirements to determine whether a strong consistency model (e.g., in relational databases) or eventual consistency (common in NoSQL databases) is more appropriate.</p><ul><li>Relational Databases -&gt; MySQL, PostgreSQL, Oracle Database, MS SQL</li><li>NoSQL Databases -&gt; MongoDB, Cassandra, Couchbase</li></ul><h4>Security</h4><p>Security mechanisms play a crucial role in modern web applications, providing a standardized and secure way to handle authentication, authorization, and secure information exchange between different components. Understanding how to implement and properly configure JWT, OAuth 2.0, and related protocols is essential for building secure and scalable systems.</p><ul><li>JWT (JSON Web Token)</li><li>OAuth 2.0</li><li>OpenID Connect</li></ul><h4>Continuous Integration/Continuous Deployment (CI/CD)</h4><p>CI/CD is integral to microservices development, streamlining the process of building, testing, and deploying code changes. In a microservices architecture, CI involves automatically integrating code changes from multiple developers into a shared repository, triggering automated tests to maintain code quality. CD extends CI by automatically deploying successfully tested code changes to production or staging environments. Tools like Jenkins, GitLab CI, or GitHub Actions facilitate CI/CD pipelines for microservices, orchestrating the entire workflow. This approach ensures rapid and reliable delivery of new features, enhancements, or bug fixes, promoting agility and minimizing deployment risks in a distributed microservices ecosystem.</p><ul><li>Jenkins</li><li>GitLab</li><li>Spinnaker</li></ul><h4>Monitoring</h4><p>Monitoring in a microservices architecture is crucial for maintaining system health and identifying potential issues. Tools like <strong>Prometheus and Grafana</strong> can be used for real-time monitoring, capturing metrics from each microservice. These metrics might include response times, error rates, and resource usage. A distributed tracing system, like <strong>Jaeger or Zipkin</strong>, enables tracking requests as they traverse multiple microservices, providing insights into performance bottlenecks. Log aggregation tools, such as <strong>ELK Stack (Elasticsearch, Logstash, Kibana)</strong>, centralize logs from various microservices for easier troubleshooting and analysis.</p><blockquote>So far these are the things that must be included when you are developing a microservice echo system. Below are the components that need to be implemented based on the requirement which makes your life easy.</blockquote><h4>Message Broker</h4><p>Message Broker in a microservices architecture acts as a communication middleware, enabling asynchronous communication between microservices. Examples of message brokers include Apache Kafka and RabbitMQ. Microservices can publish messages to specific topics or queues, allowing other microservices to subscribe and consume them independently. This decouples microservices, enhancing scalability and fault tolerance. For instance, in an e-commerce system, a product service could publish product updates to a message broker, and other services like inventory or recommendation could subscribe to relevant topics for real-time updates.</p><ul><li>Apache Kafka</li><li>RabbitMQ</li><li>ActiveMQ</li><li>Amazon SNS (Simple Notification Service)</li><li>NATS</li></ul><h4>Container and Container orchestration</h4><p>Containers in microservices provide lightweight, portable, and consistent runtime environments for applications, encapsulating dependencies and ensuring consistency across various stages of the development lifecycle. Examples include :</p><ul><li>Docker</li><li>Podman</li></ul><p>These containers package microservices and their dependencies into container images, enabling consistent deployment across diverse environments.</p><p>Container Orchestration further enhances microservices management, automating tasks like scaling, load balancing, and service discovery. Kubernetes, a popular container orchestration tool, ensures seamless deployment, scaling, and management of microservices. For example, in an e-commerce microservices application, Docker containers encapsulate individual services like inventory management, while <strong>Kubernetes</strong> orchestrates their deployment, scaling, and communication for a cohesive and scalable system.</p><h4>Cloud Provider</h4><p>Cloud Provider in a microservices context refers to the third-party cloud service that hosts and provides infrastructure for the microservices applications. These providers offer scalable and reliable infrastructure services, enabling microservices to be deployed and scaled dynamically based on demand. For instance, a microservices-based e-commerce application might leverage AWS to host its various services, such as user authentication, product catalog, and payment processing, benefiting from the cloud provider’s scalability and availability features.</p><ul><li>Amazon Web Services (AWS)</li><li>Microsoft Azure</li><li>Google Cloud Platform (GCP)</li></ul><p>That’s it guys. I hope this was interesting for you. Happy coding !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9fd7271ee5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>