<?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 Kamal Janghel on Medium]]></title>
        <description><![CDATA[Stories by Kamal Janghel on Medium]]></description>
        <link>https://medium.com/@kamaljanghel?source=rss-e16301ae42ce------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RVsxedUg3QnNWqRG</url>
            <title>Stories by Kamal Janghel on Medium</title>
            <link>https://medium.com/@kamaljanghel?source=rss-e16301ae42ce------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 02:24:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kamaljanghel/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[Mastering Database & Caching Strategies in Parking Lot System Design]]></title>
            <link>https://medium.com/@kamaljanghel/mastering-database-caching-strategies-in-parking-lot-system-design-b12006a50938?source=rss-e16301ae42ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/b12006a50938</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[radishes]]></category>
            <category><![CDATA[cache]]></category>
            <category><![CDATA[high-level-design]]></category>
            <dc:creator><![CDATA[Kamal Janghel]]></dc:creator>
            <pubDate>Wed, 21 May 2025 12:32:17 GMT</pubDate>
            <atom:updated>2025-05-21T12:51:09.959Z</atom:updated>
            <content:encoded><![CDATA[<p>In the high-level design of a parking lot management system, one of the most critical components is how the application interacts with the database layer. The system must efficiently handle diverse data types, including both structured data (like vehicle entry logs and user credentials) and unstructured data (such as images from license plate recognition). To ensure optimal performance and scalability, especially during peak traffic hours, the architecture must include an intelligent database and caching strategy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HL9EfjZMlm9SStDzBIkoGA.png" /></figure><p>In this article, we’ll deep dive into the caching mechanisms used in a high-traffic parking lot software system, but first, let’s quickly review the types of databases involved (e.g., relational databases, NoSQL databases) and why each was chosen based on system requirements and access patterns.</p><h3><strong>Structured Data — SQL Database</strong></h3><p>Most of the data involved in a parking lot system is structured. For example:</p><ul><li>Vehicle Details: Vehicle number, entry time, unique ID</li><li>Parking Slot Information</li><li>Payment Information</li><li>User and Employee Details</li></ul><p>Given the highly relational nature of parking lot system data, an SQL-based relational database is the ideal choice. These databases offer strong data consistency, support for complex join operations, and the ability to execute advanced SQL queries, making them well-suited for managing structured data such as vehicle records, user information, and parking slot availability. The use of relational databases in system architecture ensures data integrity, scalability, and reliability — key attributes for building a robust parking management system.</p><h3>Unstructured Data — AWS S3</h3><p>In addition to handling structured data, a modern parking lot management system must also process and store unstructured data. For example, when a vehicle is scanned at the entry or exit gate, its license plate image or other associated photos must be captured and stored. These are binary files — classified as unstructured data — and are most efficiently stored using a scalable object storage service such as Amazon S3 or Google Cloud Storage. Leveraging cloud object storage ensures high availability, durability, and cost-effective storage of large volumes of multimedia data within the system.</p><p>For this purpose, <strong>AWS S3</strong> is a suitable option as it:</p><ul><li>Efficiently stores and retrieves large unstructured data (e.g., images, logs)</li><li>Is highly durable and scalable</li><li>Integrates well with other AWS services</li></ul><h3>Caching — Redis</h3><p>Frequent updates to dynamic data — such as the real-time availability of parking spots — can significantly increase the database load and cause latency, especially if every user request directly interacts with the primary relational database. To mitigate this performance bottleneck, implementing an effective caching strategy is crucial. By using a distributed cache like Redis or Memcached, the system can reduce read and write pressure on the database, improve response times, and enhance the scalability of the parking management system during peak usage.</p><p><strong>Redis</strong>, an in-memory key-value data store, is an ideal caching solution here. Here’s why:</p><ul><li><strong>Low latency</strong>: Redis operates in memory, making reads/writes extremely fast</li><li><strong>High throughput</strong>: Can handle a large number of read/write operations per second</li><li><strong>Support for TTL</strong>: Helps in auto-expiring cache entries, perfect for time-sensitive data like parking spot availability</li><li><strong>Data Structures</strong>: Redis supports useful data structures like lists, sets, and sorted sets which can be leveraged for queueing and ranking features in the system</li></ul><p>By using Redis, we can significantly reduce the load on our primary SQL database and improve the performance and responsiveness of the parking lot system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b12006a50938" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Parking Lot System Design: From Requirements to Scalable Architecture]]></title>
            <link>https://medium.com/@kamaljanghel/mastering-parking-lot-system-design-from-requirements-to-scalable-architecture-2cd74c5e73ca?source=rss-e16301ae42ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cd74c5e73ca</guid>
            <category><![CDATA[design]]></category>
            <category><![CDATA[parking]]></category>
            <category><![CDATA[hld]]></category>
            <category><![CDATA[parking-lot]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <dc:creator><![CDATA[Kamal Janghel]]></dc:creator>
            <pubDate>Wed, 21 May 2025 12:05:16 GMT</pubDate>
            <atom:updated>2025-05-21T12:05:16.914Z</atom:updated>
            <content:encoded><![CDATA[<p>System Design for Parking lot is one of most asked interview questions, today we try to deep dive to understand the Scalable Design of Parking Lot.</p><h3><strong>Requirements</strong></h3><blockquote><strong>Functiona Requirements</strong></blockquote><p>Entry and Exit the Vehicle, Allocation of Parking Spot, Calculating Parking charges based o Vehicle type, Generating Receipt</p><blockquote><strong>Non Functional Requirements</strong></blockquote><p>Scalable, low-latency, high available</p><blockquote><strong>Assumptions</strong></blockquote><p>Multi-level Parking system, Dynamic prices based on number of hours</p><h3><strong>Application Flow</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i05kXJ91MVV8gk81UXQiNQ.png" /></figure><p><strong>Step1 — Vehicle Entry</strong></p><ul><li>Scan the Vehicle number and generate Unique id</li><li>Identity vehicle type — 2 wheeler, 3 wheeler, 4 wheelers</li><li>Capture entry timestamp — for billing and tracking time</li></ul><p><strong>Step 2 — Parking Lot assignment</strong></p><ul><li>Determine the Parking spot based on Vehicle type</li><li>Assign the Parking spot and update the slot status as occupied in Database</li><li>Calculate the parking fees based on — duration of stay, type of vehicle</li><li>Update the DB for assign parking spot status and vehicle id and type</li></ul><p><strong>Step 3 — Payment service</strong></p><ul><li>Integrate payment gateway service (Razorpay, Paypal, Stripe)</li><li>Store the payment status in Database</li></ul><p><strong>Step 4 — Vehicle Exit and Notification</strong></p><ul><li>Scan the Vehicle Id in exit gate to update the status of vehicle</li><li>Calculate the final amount based on parking duration (exit time — entry time ) based on vehicle type</li><li>Update the Parking Spot as available in System</li><li>Update the Payment details like Status and final amount with vehicle type and parking duration</li><li>Generate and Send receipt via notification</li></ul><h3><strong>Database Schema</strong></h3><p>Database schema to manage vehicle tracking, Parking spot allocation, Pricing calculation and Payment processing for smart parking system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n0W-jrAO6530q8Lx5YlbnQ.png" /></figure><h3>Conclusion</h3><p>Parking Lot System is most asked common interview question being asked from last year in most of top company to test candidate ability to apply design fundamentals to real world use-cases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cd74c5e73ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns in Serverless Application]]></title>
            <link>https://medium.com/@kamaljanghel/design-patterns-in-serverless-application-a51509936fef?source=rss-e16301ae42ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/a51509936fef</guid>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[application]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Kamal Janghel]]></dc:creator>
            <pubDate>Sat, 08 Mar 2025 07:34:19 GMT</pubDate>
            <atom:updated>2025-03-08T07:34:19.803Z</atom:updated>
            <content:encoded><![CDATA[<p>Serverless applications require important design patterns to ensure <strong>scalability, reliability, performance, and cost efficiency</strong>. Serverless applications can run on various cloud platforms, such as <strong>AWS Lambda, Azure Functions, and Google Cloud Functions</strong>.</p><h4>Minimizing Cold Starts</h4><p>Cold start refers to the time a function takes to initialize after being idle for some time. It’s the warm-up time required before execution.</p><p><strong>Action Items:</strong></p><ul><li>Design functions with a <strong>small code footprint</strong> and load only essential libraries.</li><li>Choose <strong>faster runtimes</strong> — languages like <strong>Node.js and Python</strong> have lower cold start times compared to <strong>Java or .NET</strong>.</li><li>Use <strong>Provisioned Concurrency</strong> in AWS Lambda to keep functions warm.</li></ul><h4>Optimizing Event-Driven Applications</h4><p>Serverless applications rely on event-driven workflows, but inefficient event sources can cause performance bottlenecks.</p><p><strong>Action Items:</strong></p><ul><li>Choose the <strong>right event source</strong> — WebSockets for real-time communication, S3 for batch processing.</li><li>Use <strong>asynchronous processing</strong> with <strong>SQS, SNS, and Kinesis</strong>.</li><li>Keep <strong>event payloads short and optimized</strong>.</li></ul><h4>Using Asynchronous Processing for Scalability</h4><p>Asynchronous processing prevents bottlenecks when handling high request volumes.</p><p><strong>Action Items:</strong></p><ul><li>Use <strong>SQS, SNS, and EventBridge</strong> to decouple services.</li><li>Offload background tasks like <strong>image processing and report generation</strong> to asynchronous workflows.</li><li>Use <strong>Step Functions</strong> for long-running processes</li></ul><h4>Ensuring Event Ordering and Deduplication</h4><p>High traffic can result in unordered or duplicate event processing, causing data consistency issues.</p><p><strong>Action Items:</strong></p><ul><li>Use <strong>FIFO (First-In-First-Out) SQS</strong> queues for ordered message processing.</li><li>Store event IDs in <strong>DynamoDB or Redis</strong> to prevent duplicate processing.</li><li>Leverage <strong>Kafka or Kinesis</strong> for event streaming with ordering guarantees.</li></ul><h4>Optimizing Database Connections</h4><p>Traditional databases like <strong>MySQL and PostgreSQL</strong> require persistent connections, which do not work well with ephemeral serverless functions.</p><p><strong>Action Items:</strong></p><ul><li>Use <strong>serverless-friendly databases</strong> like <strong>DynamoDB</strong> or <strong>Aurora Serverless</strong>.</li><li>Implement <strong>RDS Proxy</strong> to manage connection pooling efficiently.</li><li>Use <strong>caching solutions</strong> like <strong>Redis or CloudFront</strong> to minimize database calls.</li></ul><h4>Handling Idempotency and Retries</h4><p>Network failures and <strong>at-least-once delivery models</strong> can lead to duplicate event processing.</p><p><strong>Action Items:</strong></p><ul><li>Implement <strong>idempotency keys</strong> by storing processed event IDs.</li><li>Use <strong>Dead Letter Queues (DLQ)</strong> to capture failed messages.</li><li>Implement <strong>exponential backoff retries</strong> for failed requests.</li></ul><h4>Optimizing Cost Efficiency</h4><p>Serverless pricing follows a <strong>pay-per-use model</strong>, but inefficient design can lead to unnecessary costs.</p><p><strong>Action Items:</strong></p><ul><li>Optimize <strong>memory allocation</strong> — sometimes increasing memory reduces execution time and lowers cost.</li><li>Use <strong>Lambda@Edge</strong> to reduce API Gateway costs.</li><li>Choose <strong>longer execution times</strong> only when necessary, such as for batch jobs.</li></ul><p>By following these best practices, you can build <strong>highly efficient, scalable, and cost-effective</strong> serverless applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a51509936fef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Service Discovery in Microservices]]></title>
            <link>https://medium.com/@kamaljanghel/service-discovery-in-microservices-75202e87f83b?source=rss-e16301ae42ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/75202e87f83b</guid>
            <category><![CDATA[service-discovery]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[system-design-project]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Kamal Janghel]]></dc:creator>
            <pubDate>Tue, 07 May 2024 11:29:42 GMT</pubDate>
            <atom:updated>2024-05-07T11:29:42.085Z</atom:updated>
            <content:encoded><![CDATA[<p>When microservice run locally, It has dedicated IP address <br>but when i got deploy in cloud there is no dedicated IP address, everything will be dynamics IP address therefore can not make assumption that service will have this IP address</p><p>It become difficult to implement because we don’t know, which instance we have to call, we can hard code one at a time, so the question here is</p><h3><strong>How service 1 will recognize to call service 2 ?</strong></h3><p>Service discovery is one of the solution, Its a process that automatically detecting devices and service on a network.<br>Service discovery protocol SDP is a network standard that accomplish detecting of network by identifying resources.</p><h3><strong>2 Types of service Discovery</strong></h3><p><strong>Service side service discovery</strong> — allow client application to find service through a router or a load balancer.<br><strong>Client side service discovery</strong> — allow client application to find by query a service registry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*YcysZdiPIe_iPHUBvSUSgQ.png" /><figcaption>Types of Service Discovery</figcaption></figure><h3><strong>3 Component of service discovery</strong></h3><p><strong>Provider</strong> — Register and deregister itself when entring and existing system <br><strong>Consumer</strong> — Get the location in registry then connect to service provider <br><strong>Register</strong> — DB which contain location of services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*gr6leoNUIFPV-w5z6Ydmdg.png" /><figcaption>Components of Service Discovery</figcaption></figure><p>Happy Learning !!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75202e87f83b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top Java 8 Interview Questions]]></title>
            <link>https://medium.com/@kamaljanghel/top-java-8-interview-questions-67aa14c5787?source=rss-e16301ae42ce------2</link>
            <guid isPermaLink="false">https://medium.com/p/67aa14c5787</guid>
            <category><![CDATA[code]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Kamal Janghel]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 19:23:29 GMT</pubDate>
            <atom:updated>2023-07-06T19:23:29.914Z</atom:updated>
            <content:encoded><![CDATA[<p>What is code to print Even number of Array by Using Java 8</p><p>List&lt;Integer&gt; list3 = Arrays.<em>asList</em>(10,15,8,49,25,98,32);<br>List&lt;Integer&gt; ans = list3.stream().filter(n -&gt; n%2 == 0).collect(Collectors.<em>toList</em>());<br>System.<em>out</em>.println(ans);<br>System.<em>out</em>.println(list3.stream().filter(n-&gt; n%2 == 1).collect(Collectors.<em>toList</em>()));<br>list3.stream().filter(n -&gt; n%2 == 1).forEach(System.<em>out</em>::println);<br>System.<em>out</em>.println();</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67aa14c5787" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>