<?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 Bharat Aggarwal on Medium]]></title>
        <description><![CDATA[Stories by Bharat Aggarwal on Medium]]></description>
        <link>https://medium.com/@bharataggarwal143?source=rss-d89573943ad5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*n8IvZLQn1MwWRdkBrhj2rg.jpeg</url>
            <title>Stories by Bharat Aggarwal on Medium</title>
            <link>https://medium.com/@bharataggarwal143?source=rss-d89573943ad5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 09:09:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bharataggarwal143/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[A Spec Nobody Reviewed Is Vibe Coding With Better Stationery]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/javarevisited/a-spec-nobody-reviewed-is-vibe-coding-with-better-stationery-9fc16d03243f?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/2040/1*2lHYDdnHDgeXM5eEHMw6uA.png" width="2040"></a></p><p class="medium-feed-snippet">AI made writing specifications free. That&#x2019;s exactly why most of them are worthless.</p><p class="medium-feed-link"><a href="https://medium.com/javarevisited/a-spec-nobody-reviewed-is-vibe-coding-with-better-stationery-9fc16d03243f?source=rss-d89573943ad5------2">Continue reading on Javarevisited »</a></p></div>]]></description>
            <link>https://medium.com/javarevisited/a-spec-nobody-reviewed-is-vibe-coding-with-better-stationery-9fc16d03243f?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fc16d03243f</guid>
            <category><![CDATA[aidlc]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[adl]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 13:29:40 GMT</pubDate>
            <atom:updated>2026-07-26T14:58:46.032Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Guide to Multi-Tenancy in Spring Boot]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bharataggarwal143/a-guide-to-multi-tenancy-in-spring-boot-d6d759ce0c39?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/1536/1*k8gJ5FseNrhsPCQV-idGbg.jpeg" width="1536"></a></p><p class="medium-feed-snippet">Part 3: Production Deployment &amp; Operating at Scale</p><p class="medium-feed-link"><a href="https://medium.com/@bharataggarwal143/a-guide-to-multi-tenancy-in-spring-boot-d6d759ce0c39?source=rss-d89573943ad5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bharataggarwal143/a-guide-to-multi-tenancy-in-spring-boot-d6d759ce0c39?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6d759ce0c39</guid>
            <category><![CDATA[multitenancy]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[scalability]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 15:11:56 GMT</pubDate>
            <atom:updated>2026-02-01T15:12:56.164Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Guide to Multi-Tenancy in Spring Boot]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bharataggarwal143/a-guide-to-multi-tenancy-in-spring-boot-bd5260ef2d52?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/1536/1*LPhIxEOQ8QC781xlY_aIsw.png" width="1536"></a></p><p class="medium-feed-snippet">Part 2: Advanced Security, Performance Optimization &amp; Testing</p><p class="medium-feed-link"><a href="https://medium.com/@bharataggarwal143/a-guide-to-multi-tenancy-in-spring-boot-bd5260ef2d52?source=rss-d89573943ad5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bharataggarwal143/a-guide-to-multi-tenancy-in-spring-boot-bd5260ef2d52?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd5260ef2d52</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[multitenancy]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[testing]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 11:33:53 GMT</pubDate>
            <atom:updated>2026-02-01T15:14:53.966Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Guide to Multi-Tenancy in Spring Boot]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/javarevisited/a-guide-to-multi-tenancy-in-spring-boot-ea1fb92fd787?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/1678/1*m-CuFO9A0FPSruV5Xvxydg.png" width="1678"></a></p><p class="medium-feed-snippet">Part 1: Architecture Foundations &amp; Core Patterns</p><p class="medium-feed-link"><a href="https://medium.com/javarevisited/a-guide-to-multi-tenancy-in-spring-boot-ea1fb92fd787?source=rss-d89573943ad5------2">Continue reading on Javarevisited »</a></p></div>]]></description>
            <link>https://medium.com/javarevisited/a-guide-to-multi-tenancy-in-spring-boot-ea1fb92fd787?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea1fb92fd787</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[multitenancy]]></category>
            <category><![CDATA[jpa]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sat, 27 Dec 2025 13:07:32 GMT</pubDate>
            <atom:updated>2026-02-01T15:14:03.433Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Outbox to the Rescue: Event Driven Systems]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bharataggarwal143/outbox-to-the-rescue-event-driven-systems-a0f8d8ac5d23?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/1650/0*ergw_JSi-87u1f_W.png" width="1650"></a></p><p class="medium-feed-snippet">Why Event Driven Microservices&#xA0;?</p><p class="medium-feed-link"><a href="https://medium.com/@bharataggarwal143/outbox-to-the-rescue-event-driven-systems-a0f8d8ac5d23?source=rss-d89573943ad5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bharataggarwal143/outbox-to-the-rescue-event-driven-systems-a0f8d8ac5d23?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0f8d8ac5d23</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[outbox]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sat, 19 Apr 2025 13:33:20 GMT</pubDate>
            <atom:updated>2025-09-28T15:44:53.920Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Simplifying Request Throttling and Real World Application]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bharataggarwal143/simplifying-request-throttling-and-real-world-application-aa781b7e383c?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/1024/0*IACYZILiXRkPf3rK.png" width="1024"></a></p><p class="medium-feed-snippet">Understanding the &#x201C;WHAT&#x201D; and &#x201C;WHY&#x201D;</p><p class="medium-feed-link"><a href="https://medium.com/@bharataggarwal143/simplifying-request-throttling-and-real-world-application-aa781b7e383c?source=rss-d89573943ad5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bharataggarwal143/simplifying-request-throttling-and-real-world-application-aa781b7e383c?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa781b7e383c</guid>
            <category><![CDATA[system-architecture]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[throttling]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sat, 28 Dec 2024 13:33:13 GMT</pubDate>
            <atom:updated>2024-12-28T13:33:13.372Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Master Authentication Using Spring Security (JWT)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bharataggarwal143/master-authentication-using-spring-security-jwt-411fef32b6e8?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/740/1*vTt6GFff8RfSyIw7v-cSPA.png" width="740"></a></p><p class="medium-feed-snippet">In the world of web development and microservices, ensuring robust authentication mechanisms is paramount to safeguarding sensitive user&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@bharataggarwal143/master-authentication-using-spring-security-jwt-411fef32b6e8?source=rss-d89573943ad5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bharataggarwal143/master-authentication-using-spring-security-jwt-411fef32b6e8?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/411fef32b6e8</guid>
            <category><![CDATA[spring-security-6]]></category>
            <category><![CDATA[keycloak]]></category>
            <category><![CDATA[jwt]]></category>
            <category><![CDATA[spring-boot-3]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sun, 28 Apr 2024 15:52:28 GMT</pubDate>
            <atom:updated>2025-04-19T06:44:09.814Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Java Parallel Streams: Boon or Bane ?]]></title>
            <link>https://medium.com/@bharataggarwal143/java-parallel-streams-boon-or-bane-c6df247f3656?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6df247f3656</guid>
            <category><![CDATA[parallelstream]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[concurrency]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Sun, 02 Jul 2023 15:18:57 GMT</pubDate>
            <atom:updated>2023-07-23T06:21:23.622Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java Parallel Streams: Boon or Bane</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*nWMzOtD8Fd4341j1RujB1g.jpeg" /></figure><p>Java 8 introduced the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html">Stream API</a> to process a collection or an array in a declarative way. Moreover, it allows us to use the power of multi-core architecture for parallel processing of data using parallel streams.</p><h4>Let’s witness the performance it offers us, using the below code snippet (based on NQ model)</h4><blockquote>Oracle presented a simple model that can help us determine whether parallelism can offer us a performance boost. In the <em>NQ</em> model, <em>N</em> stands for the number of source data elements, while <em>Q</em> represents the amount of computation performed per data element.</blockquote><pre>employeeNames.stream()<br>             .map(Main::performComputation)<br>             .collect(Collectors.toList());<br><br>employeeNames.stream().parallel()<br>             .map(Main::performComputation)<br>             .collect(Collectors.toList());</pre><p><strong>Execution Results With Different Parameters</strong>:</p><p><em>N(Data Set) Small <br>Q(computation) high, eg: string manipulation using regex</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*pFjROt6rldgiqFLMf1jDpA.png" /></figure><p>The above results clearly tell Parallel Stream outperforms Stream in the given circumstances.</p><p><em>N(Data Set) Small<br>Q(computation) low, basic manipulation — trim()</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*r02nsDRAffAQ3wyYl-4RtQ.png" /></figure><p>The tables are turned quickly. As soon as the computation cost decreases, streams start to outperform parallel streams. Parallel streams perform even worse than streams as they have associated cost of multi-threading with them.</p><p><em>N(Data Set) High<br>Q(computation) low, basic manipulation — trim()</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*n9O3scVoz_2piy9p5hq44A.png" /></figure><p>The parallel streams outperforms streams this time, following the NQ model. As soon as N increases significantly, parallelism starts to offer performance boost.</p><h3>Understanding Parallel Streams and the pitfalls</h3><p>How it works?</p><ol><li><strong>Uses threads from </strong><a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ForkJoinPool.html"><strong>ForkJoinPool.commonPool()</strong></a><br>Don’t use parallel streams for network calls as that might choke the application as it uses threads from the same pool utilized across the application. It is best used for CPU bounded tasks.</li><li><strong>Splits the data into chunks</strong><br>It doesn’t work well when splitting the data structure is inherently costly. <br>Eg 1: Collections use spliterator() for splitting the data. Splitting an ArrayList(indexed) is much faster than a LinkedList(non-indexed). <br>Eg 2: Stream.iterate(0, i → i + 1).limit(n). The values generated by the iterate() method are not known before the stream is executed which makes process of splitting inefficient.<br>In such cases it has a negative impact on the performance.</li><li><strong>Executes the data chunks</strong><br>The stream lambda operations must be stateless because the results from a stateful parameter can be non-deterministic or even unexpected as the data will be processed by multiple threads which may lead to race condition on shared state. Even stream operations like distinct(), sorted(), etc. are stateful which has extra performance overhead when executed in parallel streams.</li><li><strong>Combines the data chunks<br></strong>The result order of the terminal operation of the stream depends upon the collection. For ordered collection, the encounter order is preserved(eg: ArrayList) but for unordered collection(eg: HashSet), we don’t have any control on the result order. The performance of a parallel stream on a ordered collection can be improved by calling unordered() operation on the stream.</li></ol><p>Other factors to consider to avoid side effects:</p><ol><li>Use IntStream, LongStream, etc. which works with primitive data types like int, long, etc. to avoid the performance cost of boxing, unboxing the primitive data types in parallel streams.</li></ol><h3><strong>Conclusion:</strong></h3><p>To take full advantage of parallel streams, we should adhere to above highlighted principles and avoid the common pitfalls.</p><p>Share feedback over <a href="https://www.linkedin.com/in/bharat-aggarwal-632869123/">LinkedIn</a> or comments section below.</p><p>Happy coding !💻</p><h3>References:</h3><ol><li><a href="https://www.udemy.com/course/java-multithreading-concurrency-performance-optimization/">https://www.udemy.com/course/java-multithreading-concurrency-performance-optimization/</a></li><li><a href="https://blogs.oracle.com/javamagazine/post/java-parallel-streams-performance-benchmark#:~:text=A%20parallel%20stream%20is%20executed,being%20executed%20in%20multiple%20threads">https://blogs.oracle.com/javamagazine/post/java-parallel-streams-performance-benchmark#:~:text=A%20parallel%20stream%20is%20executed,being%20executed%20in%20multiple%20threads</a>.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6df247f3656" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Perfected JPA @OneToOne Relation]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@bharataggarwal143/perfected-jpa-onetoone-relation-9af4bdcdaf2?source=rss-d89573943ad5------2"><img src="https://cdn-images-1.medium.com/max/600/1*_19pD4vD6BsvULJiPHOVzw.jpeg" width="600"></a></p><p class="medium-feed-snippet">Optimizing database look up and memory</p><p class="medium-feed-link"><a href="https://medium.com/@bharataggarwal143/perfected-jpa-onetoone-relation-9af4bdcdaf2?source=rss-d89573943ad5------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@bharataggarwal143/perfected-jpa-onetoone-relation-9af4bdcdaf2?source=rss-d89573943ad5------2</link>
            <guid isPermaLink="false">https://medium.com/p/9af4bdcdaf2</guid>
            <category><![CDATA[hibernate]]></category>
            <category><![CDATA[jpa]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[performance]]></category>
            <dc:creator><![CDATA[Bharat Aggarwal]]></dc:creator>
            <pubDate>Thu, 13 Apr 2023 13:05:57 GMT</pubDate>
            <atom:updated>2025-04-19T06:47:07.033Z</atom:updated>
        </item>
    </channel>
</rss>