<?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 java jargon on Medium]]></title>
        <description><![CDATA[Stories by java jargon on Medium]]></description>
        <link>https://medium.com/@javajargon977?source=rss-590bd5a362e1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5M1HU6QqKeLjTX95</url>
            <title>Stories by java jargon on Medium</title>
            <link>https://medium.com/@javajargon977?source=rss-590bd5a362e1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:50:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@javajargon977/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[ Strangler Fig Pattern: How Modern Systems Escape Monolith Hell]]></title>
            <link>https://medium.com/@javajargon977/strangler-fig-pattern-how-modern-systems-escape-monolith-hell-f817dbeba4bb?source=rss-590bd5a362e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f817dbeba4bb</guid>
            <dc:creator><![CDATA[java jargon]]></dc:creator>
            <pubDate>Thu, 26 Mar 2026 05:48:17 GMT</pubDate>
            <atom:updated>2026-03-26T05:48:17.879Z</atom:updated>
            <content:encoded><![CDATA[<h3>(And How companies like Razorpay transitioned to microservices)</h3><h3>🚨 The Problem: When Your Monolith Starts Breaking</h3><p>Every backend engineer hits this stage:</p><ul><li>Deploy takes <strong>15–30 minutes</strong></li><li>One change → breaks 5 unrelated modules</li><li>Scaling = scale entire app (not just hot paths)</li><li>DB locks, connection pool exhaustion, slow queries…</li></ul><p>This is <strong>monolith gravity</strong>.</p><p>Monoliths start simple… but over time:</p><ul><li>Tight coupling increases</li><li>Ownership becomes unclear</li><li>Feature velocity drops</li><li>Scaling becomes expensive</li></ul><h3>🌱 Enter: Strangler Fig Pattern</h3><p>The <strong>Strangler Fig Pattern</strong> is a <strong>gradual migration strategy</strong> from monolith → microservices.</p><p>Inspired by a real tree:</p><ul><li>A fig grows around a host tree</li><li>Slowly replaces it</li><li>Eventually the original disappears</li></ul><p>Same idea in software:<br> 👉 Build new system <em>around</em> the old<br> 👉 Replace piece-by-piece<br> 👉 Kill the monolith last</p><h3>🧠 Core Idea (In One Line)</h3><blockquote><strong><em>Don’t rewrite. Replace incrementally.</em></strong></blockquote><h3>🏗️ Architecture View</h3><pre>Clients<br>             |<br>        API Gateway<br>        /        \<br>  Monolith    Microservices</pre><h3>Key Components</h3><ol><li><strong>Facade / API Gateway</strong></li></ol><ul><li>Routes requests</li><li>Decides: monolith vs new service</li></ul><p><strong>2.Legacy Monolith</strong></p><ul><li>Still runs production traffic</li><li>Slowly shrinking</li></ul><p><strong>3.New Microservices</strong></p><ul><li>Replace specific features</li><li>Built independently</li></ul><h3>🔄 Migration Lifecycle</h3><h3>1. Transform</h3><ul><li>Identify module (e.g., payments)</li><li>Build new service</li></ul><h3>2. Coexist</h3><ul><li>Route some traffic to new service</li><li>Keep monolith as fallback</li></ul><h3>3. Eliminate</h3><ul><li>Shift all traffic</li><li>Delete old code</li></ul><h3>⚙️ Step-by-Step Example (Relatable)</h3><p>Let’s say you have:</p><pre>Monolith:<br>- Users<br>- Orders<br>- Payments<br>- Notification</pre><h3>Step 1 → Extract Payments</h3><pre>API Gateway → Payments Service<br>            → Monolith (rest)</pre><h3>Step 2 → Extract Orders</h3><pre>API Gateway → Orders Service<br>            → Payments Service<br>            → Monolith</pre><h3>Final</h3><pre>API Gateway → Users Service<br>            → Orders Service<br>            → Payments Service<br>            → Notifications Service</pre><p>👉 Monolith = gone</p><h3>💡 Why This Works (Engineering Perspective)</h3><h3>1. No Big-Bang Risk</h3><p>Rewriting everything = high failure rate<br> Strangler = safe incremental change</p><h3>2. Continuous Delivery</h3><p>You can ship features during migration</p><h3>3. Scoped Failures</h3><p>Microservices isolate failures<br> (No more “one bug kills entire system”)</p><h3>4. Gradual Scaling</h3><p>Scale only hot services (e.g., payments)</p><h3>⚠️ Hidden Complexity (Most People Ignore)</h3><p>This is where real engineering starts:</p><h3>🔴 Data is the hardest part</h3><ul><li>Shared DB → nightmare</li><li>Need:</li><li>DB per service</li><li>Event-driven sync</li><li>eventual consistency</li></ul><h3>🔴 Dual writes problem</h3><p>During migration:</p><ul><li>monolith + microservice both writing</li></ul><h3>🔴 Debugging becomes distributed</h3><p>Logs → traces → correlation IDs</p><h3>🏦 Case Study: Razorpay Journey</h3><blockquote><em>(Public engineering talks + industry patterns — reconstructed architecture insight)</em></blockquote><h3>🏁 Initial State</h3><p>Razorpay started as a <strong>monolithic system</strong>:</p><ul><li>Payments</li><li>Orders</li><li>Subscriptions</li><li>Settlements</li><li>Dashboard</li></ul><p>Problems:</p><ul><li>Payments are high-throughput, latency-critical</li><li>Other modules not equally critical<br> 👉 But monolith forced everything to scale together</li></ul><h3>🚀 Transition Strategy (Strangler Fig in Action)</h3><h3>1. Introduced API Layer</h3><p>All requests → centralized gateway</p><p>👉 Critical step: <strong>control routing</strong></p><h3>2. Extracted High-Impact Domains First</h3><p>Instead of random splitting:</p><ul><li>Payments (core)</li><li>Orders</li><li>Webhooks</li></ul><p>👉 Reason:</p><ul><li>High traffic</li><li>Independent scaling needed</li></ul><h3>3. Built Microservices Around Core Domains</h3><p>Each service:</p><ul><li>Own DB</li><li>Own deployment</li><li>Own scaling rules</li></ul><p>Example:</p><pre>Payment Service → handles transactions<br>Order Service   → order lifecycle<br>Webhook Service → async events</pre><h3>4. Gradual Traffic Shift</h3><ul><li>Initially:</li><li>100% → monolith</li><li>Then:</li><li>10% → microservice</li><li>Then:</li><li>100% → microservice</li></ul><p>👉 Zero downtime migration</p><h3>5. Event-Driven Architecture</h3><p>To avoid tight coupling:</p><ul><li>Kafka / queues for communication</li><li>Async processing for:</li><li>settlements</li><li>notifications</li></ul><h3>6. Killing the Monolith</h3><p>Once services stabilized:</p><ul><li>Removed legacy modules</li><li>Reduced monolith footprint</li></ul><h3>🧠 Key Engineering Decisions Razorpay Likely Took</h3><h3>✅ Domain-driven extraction</h3><p>Split by business capability (not tables)</p><h3>✅ API Gateway first</h3><p>Without routing control → impossible</p><h3>✅ Async-first mindset</h3><p>Payments → sync<br> Everything else → async</p><h3>✅ Observability</h3><ul><li>Logging</li><li>tracing</li><li>monitoring (critical in distributed systems)</li></ul><h3>⚡ Real-World Insight (From Engineers)</h3><p>From dev community:</p><blockquote><em>“Keep monolith running, route traffic gradually, retire modules slowly”</em></blockquote><p>And also:</p><blockquote><em>“Never rewrite. Use strangler pattern.”</em></blockquote><h3>🧩 When Should You Use It?</h3><p>Use Strangler Fig if:</p><ul><li>Large legacy system</li><li>Cannot stop feature development</li><li>Need gradual modernization</li><li>Business cannot tolerate downtime</li></ul><h3>❌ When NOT to Use</h3><ul><li>Small app → just refactor</li><li>No team maturity</li><li>No observability tooling</li><li>No clear domain boundaries</li></ul><h3>🧠 Final Takeaways</h3><ul><li>Microservices are not step 1 → they are step N</li><li>Strangler Fig is the <strong>only sane way</strong> to migrate at scale</li><li>Real challenge is:</li><li>data separation</li><li>observability</li><li>service boundaries</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f817dbeba4bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Database Deep Dive]]></title>
            <link>https://medium.com/@javajargon977/the-database-deep-dive-cf95bcc83ef1?source=rss-590bd5a362e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf95bcc83ef1</guid>
            <dc:creator><![CDATA[java jargon]]></dc:creator>
            <pubDate>Thu, 26 Mar 2026 05:48:08 GMT</pubDate>
            <atom:updated>2026-03-26T05:48:08.153Z</atom:updated>
            <content:encoded><![CDATA[<p>Outages, scaling, partitioning, N+1 nightmares..</p><h3>Database Outages:<br>Why They Happen</h3><p>Database outages are rarely dramatic explosions. They’re usually a slow accumulation of bad decisions — a missing index here, an unbounded query there, a connection pool that’s one deployment away from collapse. Let’s break down the real culprits.</p><h3>1. Connection Pool Exhaustion</h3><p>Every database has a limit on how many simultaneous connections it can hold. When your application opens more connections than the pool allows, new requests start queuing — and eventually timing out.</p><p>┌──────────────────────────────────────────────┐ │ Application Servers (100 each × 5 = 500) │ │ Each server: 100 connections │ └────────────────────┬─────────────────────────┘ │ 500 connections ▼ ┌─────────────────┐ │ PostgreSQL │ │ max_conn: 200 │ ◄── 300 connections rejected! └─────────────────┘</p><p><strong>Fix:</strong> Use a connection pooler like <strong>PgBouncer</strong> (Postgres) or <strong>ProxySQL</strong> (MySQL). These sit between your app and DB, multiplexing thousands of app connections onto a small pool of real DB connections.</p><h3>2. Long-Running Transactions &amp; Lock Contention</h3><p>A transaction that stays open for seconds (or minutes!) holds locks on rows. Other queries pile up waiting for those locks to release. Eventually your query queue fills up, latency spikes, and the app appears frozen.</p><p>SQL — the silent killer</p><pre>-- Transaction A opens, updates a row, then does something slow<br>BEGIN;<br>UPDATE orders SET status = &#39;processing&#39; WHERE id = 42;</pre><pre>-- Now it calls an external payment API... for 30 seconds<br>-- Row 42 is LOCKED for those 30 seconds</pre><pre>-- Meanwhile, Transaction B is waiting...<br>UPDATE orders SET status = &#39;cancelled&#39; WHERE id = 42;<br>-- ↑ BLOCKED. And 500 more queries pile up behind it.</pre><p>⚠ Golden Rule</p><p>Never make network calls (HTTP, Redis, queues) inside a database transaction. Keep transactions as short as possible — ideally just the DB operations themselves.</p><h3>3. Runaway Queries (Full Table Scans)</h3><p>A query that worked fine on 10,000 rows becomes catastrophic on 50 million rows. Without an index, the DB reads every single row. A few of these queries running concurrently can peg CPU at 100% and starve everything else.</p><h3>4. Cascading Failures</h3><p>One slow query causes connection pool exhaustion. The connection pool exhaustion causes app server timeouts. App servers start retrying, creating <em>more</em> load. The DB falls over completely. This is a cascade — and it’s why circuit breakers and rate limiting are not optional at scale.</p><h3>Scaling the Database</h3><p>Before you scale horizontally (adding more machines), squeeze everything out of vertical scaling. Most databases are under-optimized before they need to be distributed.</p><p>Scaling the Api Servers are easy but database it needs to be done carefully</p><h3>Level 1 — Vertical Scaling</h3><p>More RAM = bigger buffer pool = more data served from memory, fewer disk reads. Faster CPUs handle more concurrent queries. This is your first move — it’s cheap and requires zero architecture changes.But its temporary becuase vertical scaling has hardware limitations.So you can use this for quick fix to handle outage.</p><h3>Level 2 — Read Replicas</h3><p>Separate read traffic from write traffic. 80–90% of most app traffic is reads. Route them to replicas and your primary DB only handles writes.</p><p>┌─────────────────────┐ Writes ──►│ Primary (Leader) │──► replication └─────────────────────┘ │ ┌────┴─────┐ ▼ ▼ Reads ──────────────────► Replica-1 Replica-2 (analytics) (app reads)</p><h3>Level 3 — Caching Layer</h3><p>Put Redis or Memcached in front of your DB for frequently-read, rarely-changing data (user profiles, product catalogs, configs). A cache hit avoids the DB entirely.</p><p>Cache-aside pattern</p><pre>def get_user(user_id):<br>    cache_key = f&quot;user:{user_id}&quot;</pre><pre>    # 1. Check cache first<br>    cached = redis.get(cache_key)<br>    if cached:<br>        return json.loads(cached)</pre><pre>    # 2. Cache miss → hit the DB<br>    user = db.query(&quot;SELECT * FROM users WHERE id = %s&quot;, user_id)</pre><pre>    # 3. Populate cache for next time (TTL: 5 min)<br>    redis.setex(cache_key, 300, json.dumps(user))<br>    return user</pre><h3>Level 4 — Connection Pooling</h3><p>PgBouncer for Postgres, ProxySQL for MySQL. This alone can 10x the number of “connections” your app thinks it has, without changing anything on the DB side.</p><h3>Level 5 — sharding (The real Horizontal Scaling which solves most of issues).</h3><p>But lets first understand sharding and partitioning.</p><p>“You have a table with 200 million rows. Queries are slow. Should you partition or shard? The answer depends on where your pain actually is.”Partitioning</p><p><strong>Partitioning</strong> splits a single large table into smaller physical pieces, but they’re still managed by the <em>same database instance</em>. The query planner can skip irrelevant partitions entirely — this is called <strong>partition pruning</strong>.</p><p>one of example of partitioning</p><h4>Range Partitioning — Best for time-series data</h4><p>SQL — PostgreSQL range partition</p><pre>-- Main table with 200M rows of events<br>CREATE TABLE events (<br>    id          BIGSERIAL,<br>    created_at  TIMESTAMPTZ NOT NULL,<br>    user_id     BIGINT,<br>    event_type  TEXT<br>) PARTITION BY RANGE (created_at);</pre><pre>-- Each month gets its own partition<br>CREATE TABLE events_2025_01<br>    PARTITION OF events<br>    FOR VALUES FROM (&#39;2025-01-01&#39;) TO (&#39;2025-02-01&#39;);</pre><pre>CREATE TABLE events_2025_02<br>    PARTITION OF events<br>    FOR VALUES FROM (&#39;2025-02-01&#39;) TO (&#39;2025-03-01&#39;);</pre><pre>-- Query only scans 1 partition instead of 200M rows!<br>SELECT * FROM events<br>WHERE created_at &gt;= &#39;2025-01-15&#39;<br>  AND created_at  &lt; &#39;2025-01-16&#39;;</pre><h3>Sharding</h3><p><strong>Sharding</strong> goes further — it splits data across <em>multiple separate database instances</em> (or servers). Each shard is an independent database. This is how you scale writes horizontally.</p><p>ALL PAYMENTS DATA │ ┌─────┴──────┐ │ Shard Key │ (e.g. user_id % 3) └─────┬──────┘ │ ┌─────┼──────┐ ▼ ▼ ▼ DB-0 DB-1 DB-2 user_id user_id user_id %3=0 %3=1 %3=2</p><h3>Performance issues due to some of mistakes</h3><h3>The N+1 Problem:<br>The Query That Eats Your Database</h3><p>The N+1 problem is one of the most common performance killers in any ORM-backed application. It’s deceptively simple: instead of 1 query, your app fires N+1 queries — where N is the number of records you’re working with.</p><p>Here’s an one example which is based on Rails</p><blockquote>users = User.all</blockquote><blockquote>users.each do |user|<br> user.orders<br>end</blockquote><p>— 1 query<br>SELECT * FROM users;</p><p>— N queries (per user)<br>SELECT * FROM orders WHERE user_id = 1;<br>SELECT * FROM orders WHERE user_id = 2;<br>SELECT * FROM orders WHERE user_id = 3;</p><p>how to avoid?</p><blockquote>users = User.includes(:orders)</blockquote><p>SELECT * FROM users;</p><p>SELECT * FROM orders WHERE user_id IN (1,2,3,…);</p><p>Now the N+1 issue fixed.</p><h3>EXISTS vs JOIN:<br>The One-to-Many Trap</h3><p>When you have a one-to-many relationship (one user → many orders), you often want to find users <em>who have at least one order</em>. Most developers reach for a JOIN. But in many cases, EXISTS is significantly faster.</p><h3>The Scenario</h3><p>You have a users table (1 million rows) and an orders table (20 million rows). You want to find all users who have placed at least one order in the last 30 days.</p><h4>The JOIN Approach (Often Slower)</h4><p>SQL — JOIN with DISTINCT</p><pre>-- Problem: JOIN produces duplicates (one row per order)<br>-- DISTINCT must de-duplicate → expensive sort operation<br>SELECT DISTINCT u.id, u.name, u.email<br>FROM users u<br>JOIN orders o ON o.user_id = u.id<br>WHERE o.created_at &gt;= NOW() - INTERVAL &#39;30 days&#39;;</pre><pre>-- If a user placed 50 orders, that user appears 50 times<br>-- before DISTINCT collapses them.<br>-- → Massive intermediate result set<br>-- → Expensive sort/hash to deduplicate</pre><h4>The EXISTS Approach (Usually Faster)</h4><p>SQL — EXISTS short-circuits immediately</p><pre>SELECT u.id, u.name, u.email<br>FROM users u<br>WHERE EXISTS (<br>    SELECT 1<br>    FROM orders o<br>    WHERE o.user_id = u.id<br>      AND o.created_at &gt;= NOW() - INTERVAL &#39;30 days&#39;<br>    LIMIT 1  -- optional hint, EXISTS already short-circuits<br>);</pre><pre>-- EXISTS stops scanning orders the moment it finds ONE match.<br>-- No duplicates → no DISTINCT → no sort.<br>-- The outer query returns exactly one row per user. ✅</pre><h3>Why EXISTS Is Faster in This Case</h3><p>JOIN approach: User 1 → finds 50 orders → 50 intermediate rows .User 2 → finds 10 orders → 10 intermediate rows …1M users × avg 5 orders = 5M intermediate rows Then sort + deduplicate all 5M rows 💀 EXISTS approach: User 1 → finds 1st order → STOP ✓ (user qualifies) User 2 → finds 1st order → STOP ✓ (user qualifies) User 3 → scans all orders → none found → user excluded No duplicates, no sort ✅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*AJEPD_K6vqGOiT25fKsl8w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf95bcc83ef1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Your Clock Changes Twice a Year — And How It Can Break Your Software!]]></title>
            <link>https://medium.com/@javajargon977/why-your-clock-changes-twice-a-year-and-how-it-can-break-your-software-3fffdd718ade?source=rss-590bd5a362e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fffdd718ade</guid>
            <dc:creator><![CDATA[java jargon]]></dc:creator>
            <pubDate>Tue, 11 Mar 2025 19:08:27 GMT</pubDate>
            <atom:updated>2025-03-11T19:08:27.604Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why Your Clock Changes Twice a Year — And How It Can Break Your Software! Why UTC is the Safe Choice</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*cRDEUcQs4kicDOfuTJfq8w.jpeg" /></figure><p><strong>Understanding DayLight Savings Time (DST)</strong></p><p>As a newcomer in IT, I was surprised when my senior said, “Our meetings with the foreign client will now be an hour earlier due to DST.” I had never heard of DST before! This conversation made me realize how <strong>Daylight Saving Time (DST)</strong> can affect software applications and scheduling.</p><p>DST is when we change our clocks to make better use of daylight. This means that twice a year, we either move the clock forward or back, which can cause confusion in software systems.<br> How DST Changes the Day</p><p>DST creates unusual days that are not the standard 24 hours:</p><blockquote><strong>Spring Forward (23-Hour Day)</strong><br> Clocks skip one hour. <br>For example, at 2:00 AM, the clock jumps to 3:00 AM.<br>This means that 2:30 AM never happens, making that day only 23 hours long.</blockquote><blockquote><strong>Fall Back (25-Hour Day)</strong></blockquote><blockquote>Clocks go back one hour. For instance, at 2:00 AM, the clock goes back to 1:00 AM.</blockquote><blockquote>This means that 2:30 AM happens twice, creating a day that is 25 hours long.</blockquote><p>These changes can cause problems for software systems that rely on local time for scheduling tasks.</p><p><strong>The Risks of DST in Software</strong></p><p>DST can lead to unexpected issues in software systems, especially with scheduled tasks:<br> <strong>Scenario 1: Duplicate Payments</strong></p><p>Imagine you have a payment job set to run at 2:00 AM on the last day of the month. If that day has a Fall Back change:</p><pre>The clock moves back to 2:00 AM again.</pre><pre>Your payment job might run twice, causing duplicate payments.</pre><p><strong>Scenario 2: Incorrect Time Display</strong></p><p>If your app shows “2 hours ago,” but uses local time:</p><pre>During Spring Forward, it might show &quot;3 hours ago&quot; instead of &quot;2 hours ago.&quot;</pre><pre>During Fall Back, it might show &quot;1 hour ago&quot; instead of &quot;2 hours ago.&quot;</pre><p>These mistakes happen because local time changes with DST, making it unreliable for accurate calculations.<br> Why UTC is the Best Choice</p><p>Coordinated Universal Time (UTC) does not change with DST, making it a reliable option for scheduling tasks. By using UTC:</p><pre>Jobs will always run at the same time, regardless of local time changes.</pre><pre>Timestamps remain consistent and unaffected by DST shifts.</pre><p>Example</p><p>If you schedule a job at 2:30 AM UTC, it will run at that exact time no matter where your server is located or if there are any DST changes.<br> Best Practices for Developers</p><p>To avoid issues caused by DST, follow these tips:</p><pre>Store Timestamps in UTC: Always save timestamps in UTC in your database and convert them to local time only when showing them to users.</pre><pre>Schedule Jobs in UTC: Use UTC for all scheduled tasks to ensure they run consistently without being affected by DST.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fffdd718ade" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lessons from My First few Months as an Intern: What I Wish I Knew]]></title>
            <link>https://medium.com/@javajargon977/lessons-from-my-first-few-months-as-an-intern-what-i-wish-i-knew-b2c1282cd67c?source=rss-590bd5a362e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2c1282cd67c</guid>
            <category><![CDATA[intern-experience]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[java jargon]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 14:27:47 GMT</pubDate>
            <atom:updated>2024-12-15T14:27:47.363Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-g10gnrEHqdufzUt1dlg-A.png" /></figure><p>Entering the software industry as an early developer can be both exciting and overwhelming. You’re eager to learn new tools, dive into the latest technologies, and make a name for yourself. But not everything shiny and new is necessarily the best choice for every project. Based on my experience as an intern and a fresh developer, I’ve learned a few key lessons that I wish I had known sooner. If I had a chance to speak to early developers outside, here’s what I’d share.</p><p><strong>Lesson 1: Focus on the Basics, Not Just the Buzzwords</strong> When I started, I was fascinated by all the tech jargon — microservices, GraphQL, gRPC, and more. These are powerful tools, but they’re not always necessary right off the bat. I learned that it’s easy to get caught up in the excitement of using cutting-edge technologies, but the reality is that they’re not always the right fit for every project, especially when you’re still getting your footing as a developer.</p><p>For instance, I once asked my senior developer if we used these technologies at our company. His response was eye-opening: “We only use them when the project requires it.” He explained that our clients were typically small businesses that needed quick, reliable solutions rather than a perfectly optimized tech stack. This experience taught me that sometimes simplicity is key. Overengineering can slow down development and delay a product’s launch, which could result in missed opportunities.</p><p><strong>Lesson 2: Adaptability is Your Best Friend</strong> Early in my career, I was primarily trained in Java and Spring Boot, which was great. But when I decided to explore other technologies, I faced a steep learning curve. Moving from a static language like Java to dynamic ones like JavaScript and Ruby was initially challenging. I had to adjust my mindset about how code works and get comfortable with different ways to debug and optimize applications.</p><p>Adaptability is crucial for any developer. It’s not just about knowing different languages or frameworks — although that’s part of it. It’s also about understanding the underlying concepts, such as data structures, algorithms, and system design, that can be applied across different technologies. This mindset will make you a more versatile developer and prepare you for a wider range of projects and problems.</p><p><strong>Lesson 3: Code Readability and Reusability</strong> <br> One of the biggest mistakes I made early on was writing code that was too complex and difficult to maintain. I didn’t always prioritize code readability or reusability because I was focused on getting things to work, without considering how someone else (or even I in the future) might need to modify or expand the code.</p><p>Now, I understand that writing clean, maintainable code is essential. It’s not just about following best practices; it’s about making sure your code can be understood by others and reused effectively in different contexts. This approach saves time, reduces bugs, and improves the quality of your work.</p><p><strong>Lesson 4: Understand the Context of Your Work</strong> The type of company you work for can significantly influence the tools and technologies you use. For example, at service-based companies, the focus is often on delivering quick, high-quality solutions with minimal overhead. In contrast, startups may experiment with more bleeding-edge technologies to stay competitive. Large product companies, on the other hand, might have the resources to invest in sophisticated tech stacks and scaling solutions from the start.</p><p>Understanding the context of your work is crucial. It helps you make informed decisions about which technologies to use and when to apply them. Don’t assume that every project will require the same approach or the same tech stack.</p><p><strong>Lesson 5: Clarify Your Task Before Starting</strong><br> When you’re assigned a task, it’s easy to think you understand everything from the start. But I quickly found out there’s often more to it than meets the eye.Always ask questions and confirm any uncertainties with your mentor or team before diving into development. This helps avoid misunderstandings that can lead to overengineering or missing key details. Taking the time to clarify ensures that your work aligns with what’s really needed.</p><p>Conclusion: As an early developer, you’re in a prime position to shape your career in a way that suits your strengths and interests. My advice is to focus on understanding the fundamentals, being adaptable, and not overengineering solutions. Learn from your experiences, seek feedback from more experienced colleagues, and don’t be afraid to experiment. Your career is a journey of continuous learning, and every step, even the mistakes, is a valuable lesson.</p><blockquote>I’d love to hear your perspectives as well! Please feel free to share your thoughts and experiences in the comments. Every intern’s journey is unique, and I’m interested in learning from others’ experiences too.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2c1282cd67c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Streams: Simplifying Data Processing]]></title>
            <link>https://medium.com/@javajargon977/java-streams-f33d933509fd?source=rss-590bd5a362e1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f33d933509fd</guid>
            <category><![CDATA[javastreams]]></category>
            <category><![CDATA[java8]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java8-streams]]></category>
            <dc:creator><![CDATA[java jargon]]></dc:creator>
            <pubDate>Wed, 27 Dec 2023 16:38:48 GMT</pubDate>
            <atom:updated>2023-12-27T16:38:48.945Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In </em><strong><em>java 8</em></strong><em>, the stream API was introduced to unleash the power of </em><strong><em>functional programming</em></strong><em>,it internally works with </em><strong><em>functional interface</em></strong><em> concept and </em><strong><em>lambdas.</em></strong></p><p><em>So streams normally used for </em><strong><em>data processing or data manipulation </em></strong><em>operations on collections,In simpler terms streams perform operations on Collection’s object whereas Collections store the data.</em></p><p><strong><em>Example:</em></strong></p><pre>import java.util.stream.Stream;<br><br>public class JavaStreams {<br>    public static void main(String[] args) {<br>        //define stream using Stream class  note :there are multiple ways to define<br>        Stream&lt;Integer&gt;  streams= Stream.of(10,9,8,7,6,5);<br>       //Accessing streams<br>        streams.forEach(i -&gt; System.out.print(i + &quot; &quot;));//prints  10 9 8 7 6 5 <br>        <br>        // Example of creating a stream from a list<br>        List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3, 4, 5);<br>        Stream&lt;Integer&gt; stream = numbers.stream();<br>    }<br><br>}<br><br></pre><p><strong><em>Some Common Stream operations:</em></strong></p><ul><li><strong><em>filter()</em></strong><em>: Selects elements based on a specified criterion.</em></li><li><strong><em>note:</em></strong><em>They return a new Stream so we need to store them.</em></li></ul><pre>import java.util.*;<br>import java.util.stream.Stream;<br><br>public class JavaStreams {<br>    public static void main(String[] args) {<br>     <br>        List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);<br>        List&lt;Integer&gt; evenNumbers = numbers.stream()<br>                .filter(n -&gt; n % 2 == 0) // Keep only even numbers<br>                .collect(Collectors.toList());<br><br>    }<br><br>}</pre><p><strong>.</strong><strong><em>map()</em></strong><em>: Transforms each element using the provided function. Similar to filter() it also returns a new stream</em></p><pre>import java.util.*;<br>import java.util.stream.Stream;<br>import java.util.stream.Collectors;<br>public class JavaStreams {<br>    public static void main(String[] args) {<br>      <br>        List&lt;String&gt; words = Arrays.asList(&quot;apple&quot;, &quot;banana&quot;, &quot;cherry&quot;);<br>        List&lt;String&gt; wordLengths = words.stream()<br>                .map(String::toUpperCase) // Map each word to its Uppercase<br>                .collect(Collectors.toList());<br>        // output :[APPLE, BANANA, CHERRY]<br>       <br>    }<br>   /*note : example map(x-&gt;x*x) - squaring each number in lists or operations <br>   like dividing each number in list by certian number map(x-&gt;x/2)<br>}</pre><p><strong><em>reduce()</em></strong><em>: Performs a reduction on the elements using an associative accumulation function.</em></p><pre>import java.util.*;<br>import java.util.stream.Stream;<br>import java.util.stream.Collectors;<br>public class JavaStreams {<br>    public static void main(String[] args) {<br>     <br><br>        List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3, 4, 5);<br>        int sum = numbers.stream()<br>                .reduce(0, Integer::sum); // Sum all elements (start with 0)<br>           System.out.print(sum);<br>    }<br>   // output:total sum of all elements<br>   // Note :u can also use Integer::min or max to find min max as well<br>}</pre><p><strong><em>distinct()</em></strong><em>: Filters out duplicate elements.</em></p><pre>import java.util.*;<br>import java.util.stream.Stream;<br>import java.util.stream.Collectors;<br>public class JavaStreams {<br>    public static void main(String[] args) {<br>     <br>        List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 2, 3, 4, 4, 5);<br><br>        numbers.stream()<br>               .distinct()//prints distinct elements<br>               .forEach(System.out::println);<br><br>    }<br><br>}</pre><ul><li><strong><em>limit()</em></strong><em>: Limits the stream to a specified number of elements.</em></li><li><strong><em>skip()</em></strong><em>: Skips a specified number of elements in the stream.</em></li></ul><pre>import java.util.*;<br>import java.util.stream.Stream;<br>import java.util.stream.Collectors;<br>public class JavaStreams {<br>    public static void main(String[] args) {<br>    <br>        List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);<br><br>        List&lt;Integer&gt; limited = numbers.stream()<br>                .limit(5)<br>                .collect(Collectors.toList());<br>        System.out.println(&quot;Limited: &quot; + limited);<br><br>        List&lt;Integer&gt; skipped = numbers.stream()<br>                .skip(5)<br>                .collect(Collectors.toList());<br>        System.out.println(&quot;Skipped: &quot; + skipped);<br><br>    }<br><br>}</pre><pre>output:  Limited: [1, 2, 3, 4, 5]<br>         Skipped: [6, 7, 8, 9, 10]</pre><ul><li><strong><em>allMatch()</em></strong><em>: Returns true if all elements match a given predicate.</em></li><li><strong><em>anyMatch()</em></strong><em>: Returns true if any element matches a given predicate.</em></li><li><strong><em>noneMatch()</em></strong><em>: Returns true if no elements match a given predicate</em>.</li></ul><pre>import java.util.*;<br>import java.util.stream.Stream;<br>import java.util.stream.Collectors;<br>public class JavaStreams {<br>    public static void main(String[] args) {<br>      <br>        List&lt;Integer&gt; numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);<br><br>        boolean allEven = numbers.stream()<br>                .allMatch(n -&gt; n % 2 == 0);<br>        System.out.println(&quot;All are even? &quot; + allEven);<br><br>        boolean anyEven = numbers.stream()<br>                .anyMatch(n -&gt; n % 2 == 0);<br>        System.out.println(&quot;Any even number? &quot; + anyEven);<br><br>        boolean noneDivisibleBy11 = numbers.stream()<br>                .noneMatch(n -&gt; n % 11 == 0);<br>        System.out.println(&quot;None divisible by 11? &quot; + noneDivisibleBy11);<br><br><br>    }<br><br>}</pre><pre>output:<br>All are even? false<br>Any even number? true<br>None divisible by 11? true</pre><p><em>Next up, we’ll explore how Java Streams team up with custom classes to simplify everyday coding tasks. Get ready for straightforward examples that showcase how Streams make operations smoother when working with your own classes. Stay tuned for a hands-on journey through the power of Streams in real-world scenarios!</em></p><blockquote><em>“STAY TUNED JARGONS!”</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f33d933509fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>