<?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 anudeep billa on Medium]]></title>
        <description><![CDATA[Stories by anudeep billa on Medium]]></description>
        <link>https://medium.com/@billa.anudeep143?source=rss-4ee4a11da5de------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*GmM1gB_5rR4bTkFh</url>
            <title>Stories by anudeep billa on Medium</title>
            <link>https://medium.com/@billa.anudeep143?source=rss-4ee4a11da5de------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:48:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@billa.anudeep143/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[Distributed Transactions in Spring Boot Microservices: Simplified Guide]]></title>
            <link>https://medium.com/@billa.anudeep143/distributed-transactions-in-spring-boot-microservices-simplified-guide-ce1e3a9191c0?source=rss-4ee4a11da5de------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce1e3a9191c0</guid>
            <dc:creator><![CDATA[anudeep billa]]></dc:creator>
            <pubDate>Tue, 19 Dec 2023 19:44:05 GMT</pubDate>
            <atom:updated>2023-12-19T19:44:05.574Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GoCbYRDTawChdY4VUCu0pg.png" /><figcaption>Img Src:<a href="https://miro.medium.com/v2/resize:fit:690/1*ZbA4HrE9XKF4FziPs2MNfQ.png"> https://miro.medium.com/v2/resize:fit:690/1*ZbA4HrE9XKF4FziPs2MNfQ.png</a></figcaption></figure><p>Have you ever wondered how complex applications like e-commerce websites or banking systems manage to execute numerous operations simultaneously without error, especially when these operations span across different services and databases? The key to this orchestration lies in understanding what a transaction is and how distributed transactions are managed in a microservices architecture.</p><h3>What is a Transaction?</h3><p>At its core, a transaction in software systems is a group of operations that are executed as a single unit. This concept is crucial for maintaining data integrity and consistency, particularly in database operations. The most classic example of a transaction can be found in the banking sector. Consider a simple fund transfer from one account to another. This operation consists of two main steps: debiting an amount from one account and crediting it to another. These two operations together form a single transaction. The critical aspect here is that both operations must either be completed successfully or not executed at all. If the debit operation is successful but the credit operation fails due to some error, the transaction must be rolled back, reverting the debit to maintain the balance in the accounts. This is where the ACID properties of transactions come into play:</p><ul><li><strong>Atomicity</strong>: This property ensures that all operations within a transaction are treated as a single unit. The transaction either fully happens or doesn’t happen at all.</li><li><strong>Consistency</strong>: This guarantees that a transaction can only bring the system from one valid state to another, maintaining database rules and constraints.</li><li><strong>Isolation</strong>: Transactions are often executed concurrently. Isolation ensures that concurrent transactions do not interfere with each other.</li><li><strong>Durability</strong>: Once a transaction is committed, it remains so, even in case of system failures. This ensures that the results of the transaction are permanently recorded</li></ul><h3>Transactions in Monolithic Architecture vs. Microservices Architecture</h3><p>Understanding the differences in transaction management between monolithic and microservices architectures is crucial for developers and architects. These differences highlight how various architectural designs influence the approach to ensuring data consistency and integrity in software applications.</p><h4>Transactions in Monolithic Architecture</h4><p>In a monolithic architecture, the application is developed as a single, indivisible unit. This includes its database interactions, business logic, and user interface components. Transactions in such a setup are typically straightforward to manage due to the centralized nature of the data and services.</p><h4>Example:</h4><p>Consider a simple online bookstore in a monolithic architecture. When a user makes a purchase, several steps occur:<br>1. The inventory is checked and updated.<br>2. The payment is processed.<br>3. The order is recorded.</p><p>These steps are executed as part of a single transaction in the same database. If any step fails, the entire transaction is rolled back to maintain data consistency. This rollback is easy to manage since all the steps are tightly integrated and interact with a single database system.</p><p>The ACID (Atomicity, Consistency, Isolation, Durability) properties are inherently maintained in this architecture. The monolithic structure ensures that transactions are atomic, the database remains consistent after transactions, operations are isolated, and changes are durable.</p><h4>Transactions in Microservices Architecture</h4><p>Microservices architecture breaks down an application into smaller, independent services, each with its database. This distributed nature poses significant challenges in maintaining transactional integrity across different services and databases.</p><h4>Example:</h4><p>Let’s transform the online bookstore into a microservices architecture. The application is now split into separate services: Inventory Service, Payment Service, and Order Service. Each service has its database.</p><p>When a user places an order, the transaction spans across these services:<br>1. The Inventory Service checks and updates the stock.<br>2. The Payment Service processes the payment.<br>3. The Order Service records the order.</p><p>In this scenario, managing the transaction is more complex. If the payment processing fails after the inventory is updated, we need a mechanism to revert the inventory update to maintain data consistency. Unlike the monolithic architecture, we can’t rely on a single database transaction rollback.</p><h3><em>How to manage the transaction isolation level for concurrent requests?</em></h3><p>We can address these challenges with the help of @Transcational Annotation, a two-phase commit (2PC) pattern or SAGA pattern. Let’s try to understand each in a bit more detail</p><h3>Declarative Transaction Management</h3><p>This approach is one of the main highlights of Spring’s transaction capabilities. It promotes a cleaner, POJO-driven methodology, allowing developers to annotate methods that need to be executed within transaction boundaries.</p><ul><li><strong>@Transactional Annotation:</strong> The heart of declarative transaction management. By annotating a method with @Transactional, Spring ensures that the method is executed within a transactional context. This simplifies the developer&#39;s role, focusing more on business logic rather than infrastructural concerns.</li></ul><pre>import org.springframework.stereotype.Service;<br>import org.springframework.transaction.annotation.Transactional;<br>import org.springframework.beans.factory.annotation.Autowired;<br><br>@Service<br>public class BookstoreService {<br>    <br>    @Autowired<br>    private InventoryService inventoryService;<br>    @Autowired<br>    private PaymentService paymentService;<br>    @Autowired<br>    private OrderRepository orderRepository;<br><br>    @Transactional<br>    public void processOrder(Order order) {<br>        // Step 1: Check and update inventory<br>        boolean inventoryUpdated = inventoryService.updateInventory(order.getBookId(), order.getQuantity());<br>        if (!inventoryUpdated) {<br>            // If inventory update fails, transaction will be automatically rolled back<br>            throw new RuntimeException(&quot;Failed to update inventory for book: &quot; + order.getBookId());<br>        }<br><br>        // Step 2: Process payment<br>        boolean paymentProcessed = paymentService.processPayment(order.getPaymentDetails());<br>        if (!paymentProcessed) {<br>            // If payment processing fails, transaction will be automatically rolled back<br>            throw new RuntimeException(&quot;Payment processing failed for order: &quot; + order.getId());<br>        }<br><br>        // Step 3: Record the order<br>        orderRepository.save(order);<br>    }<br>}<br><br></pre><ul><li>@Transactional Annotation: By annotating the processOrder method with @Transactional, we tell Spring to manage this method as a transaction. This means that all the operations within this method are either completed successfully or none at all.</li><li><strong>Automatic Rollback:</strong> If any operation within this method fails (e.g., inventory update fails or payment processing fails), Spring’s transaction management will automatically roll back any changes made up to the point of failure. This ensures data consistency and integrity.</li><li><strong>Simplified Workflow:</strong> The primary advantage here is the simplicity of managing complex workflows. The developer focuses on the business logic, while Spring handles the transaction boundaries and rollback mechanisms.</li></ul><h3>Two-Phase Commit — 2PC</h3><p>The Two-Phase Commit is a distributed algorithm that allows multiple services to agree on a common outcome in a transaction. It is mainly used to ensure atomicity across a distributed system. The pattern involves two phases:</p><ol><li><strong>Prepare Phase:</strong> Each participant (service) prepares to complete the transaction and votes either to commit or abort.</li><li><strong>Commit Phase: </strong>Based on the voting in the prepare phase, if all services are ready to commit, the coordinator initiates the commit phase. If any service votes to abort, the transaction is rolled back across all services.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UfleJZTot3sMNLcI_wNxdw.png" /></figure><p>In this example, when a user attempts to book a ticket, the Orchestrator begins the 2PC process to ensure both the booking and payment are either completed or both are aborted, maintaining the atomicity of the transaction across the distributed system.</p><p>The process is as follows:</p><ol><li>The Orchestrator sends a request to the Booking Service to prepare for booking. The Booking Service ensures it can reserve the ticket and responds affirmatively.</li><li>Concurrently, the Orchestrator sends a request to the Payment Service to prepare for payment. The Payment Service verifies payment can be processed and responds that it’s prepared.</li><li>Upon receiving affirmative responses from both services, the Orchestrator sends a message to commit the booking. The Booking Service finalizes the reservation and confirms the booking commitment.</li><li>The Orchestrator then sends a message to the Payment Service to commit the payment. The Payment Service processes the payment and confirms the transaction commitment.</li><li>Finally, the Orchestrator concludes the transaction process, ensuring the user that the ticket has been booked.</li></ol><h3>Challenges with 2PC</h3><p>Implementing 2PC in Spring microservices can pose several challenges:</p><ul><li><strong>Synchronous Blocks</strong>: The 2PC pattern requires services to wait during the preparation phase, which can lead to synchronous blocks and increased response times.</li><li><strong>Single Point of Failure</strong>: The orchestrator/coordinator becomes a single point of failure. If it crashes or becomes unavailable, the entire transaction can be left in an indeterminate state.</li><li><strong>Data Inconsistency: </strong>In the event of a service failure during the commit phase, it can be challenging to ensure that all services roll back to their previous state, leading to potential data inconsistency.</li><li><strong>Complex Error Handling:</strong> Handling errors and implementing rollback mechanisms in microservices can be complex due to the distributed nature of the services.</li><li><strong>Resource Locking: </strong>During the prepare phase, resources may be locked, which can reduce system performance and responsiveness</li></ul><p>In a microservice architecture, especially one using Spring, the 2PC pattern is less favored due to these challenges. Instead, patterns like Saga are often preferred, as they offer a way to handle distributed transactions without the need for tight coordination and locking, thus providing better resilience and performance in distributed systems.</p><h3>Saga Pattern</h3><p>The Saga pattern is a sequence of local transactions, where each service performs its part of the process. If any step fails, compensating transactions are executed to undo the previous steps, ensuring data consistency without the need for a two-phase commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VHZL9VJS-jzh3KWUyJpmng.png" /></figure><p>In the given scenario, the process to book a seat for an event involves three key steps: blocking the seat, receiving payment, and confirming the booking. These steps are likely handled by different microservices. Here’s how the Saga pattern applies:</p><ol><li><strong>Block Seat: </strong>The seat reservation service attempts to block a seat. If successful, it sends an event message to the next service.</li><li><strong>Receive Payment:</strong> The payment service listens for the seat blocked event, attempts to process the payment, and upon success, sends an event message to confirm the booking.</li><li><strong>Confirm Booking:</strong> The booking service listens for the payment received event and finalizes the booking, confirming the seat reservation.</li></ol><p>If any step in this sequence fails, for example, if the payment processing fails after the seat has been blocked, compensating transactions are triggered:</p><ul><li><strong>Refund Payment: </strong>If payment was initially recorded but failed afterward, the payment service would issue a refund.</li><li><strong>Unblock Seat:</strong> In response to payment failure, the seat reservation service would unblock the seat.</li><li><strong>Cancel Booking:</strong> Similarly, if the booking had been initially noted but could not be confirmed, the booking service would cancel the booking.</li></ul><p>This series of compensating transactions ensures that the system remains consistent and that all services revert to their initial state before the Saga began.</p><p>Sample Pusedocode</p><pre>@Service<br>public class BookingSagaService {<br><br>    @Autowired<br>    private SeatReservationService seatReservationService;<br><br>    @Autowired<br>    private PaymentService paymentService;<br><br>    @Autowired<br>    private BookingService bookingService;<br><br>    public void executeSaga(Order order) {<br>        try {<br>            // Step 1: Block Seat<br>            seatReservationService.blockSeat(order.getEventId(), order.getSeatId());<br>            // Step 2: Receive Payment<br>            paymentService.processPayment(order.getPaymentDetails());<br>            // Step 3: Confirm Booking<br>            bookingService.confirmBooking(order);<br>        } catch (SeatReservationException | PaymentProcessingException | BookingException e) {<br>            // Handle compensating transactions<br>            compensateTransaction(order);<br>            throw e;<br>        }<br>    }<br><br>    private void compensateTransaction(Order order) {<br>        // Compensate Block Seat<br>        seatReservationService.unblockSeat(order.getEventId(), order.getSeatId());<br>        // Compensate Receive Payment<br>        paymentService.refundPayment(order.getPaymentDetails());<br>        // Compensate Confirm Booking<br>        bookingService.cancelBooking(order);<br>    }<br>}<br><br>// Exceptions for illustration<br>class SeatReservationException extends RuntimeException { /* ... */ }<br>class PaymentProcessingException extends RuntimeException { /* ... */ }<br>class BookingException extends RuntimeException { /* ... */ }<br><br>// Placeholder methods for services<br>class SeatReservationService {<br>    void blockSeat(String eventId, String seatId) { /* ... */ }<br>    void unblockSeat(String eventId, String seatId) { /* ... */ }<br>}<br><br>class PaymentService {<br>    void processPayment(PaymentDetails paymentDetails) { /* ... */ }<br>    void refundPayment(PaymentDetails paymentDetails) { /* ... */ }<br>}<br><br>class BookingService {<br>    void confirmBooking(Order order) { /* ... */ }<br>    void cancelBooking(Order order) { /* ... */ }<br>}<br><br>// Placeholder domain classes<br>class Order {<br>    private String eventId;<br>    private String seatId;<br>    private PaymentDetails paymentDetails;<br>    // Getters and setters<br>}<br><br>class PaymentDetails {<br>    // Payment details fields<br>    // Getters and setters<br>}</pre><ul><li>Each service (SeatReservationService, PaymentService, and BookingService) has a method to perform its transaction as well as a compensating method to undo it.</li><li>If an exception is thrown at any point during the saga execution, the compensateTransaction method is called to execute the compensating transactions to rollback the changes made up to that point.</li><li>The executeSaga method orchestrates the entire booking process, ensuring that if any part fails, the system remains in a consistent state.</li></ul><h3>Conclusion</h3><p>Spring Boot offers a suite of tools tailored for handling distributed transactions within a microservice ecosystem, accommodating both the Two-Phase Commit (2PC) and Saga transaction patterns. These patterns provide mechanisms to maintain consistency across disparate services within a distributed system.</p><p>The 2PC pattern is a conventional technique that employs a centralized coordinator to govern transactions across various services. This method guarantees atomicity, where all participating services either commit or abort changes together, thus ensuring data consistency across the system. Despite its robustness in maintaining consistency, the 2PC approach presents several drawbacks when applied to microservices. It can introduce performance bottlenecks due to the synchronous nature of its operations, increase system complexity, and create potential single points of failure. Moreover, resource locking during the transaction can impede the scalability and resilience that microservices aim to provide.</p><p>In contrast, the Saga pattern emerges as a more decentralized approach, where transactions are broken down into a series of local transactions. Each service handles its segment of the overall process, and in the case of failures, compensating transactions are triggered to revert the system to its initial state. This pattern aligns more naturally with the distributed and loosely coupled nature of microservices, offering improved fault tolerance and system responsiveness.</p><p>Spring Boot also simplifies transaction management within individual microservices through the declarative ‘@Transactional’annotation. This allows developers to define transaction boundaries directly in the application code, leaving the runtime to manage transactional complexities such as rollbacks and commits. The ‘@Transactional’annotation is particularly beneficial in maintaining cleaner and more maintainable service methods, as it abstracts away the boilerplate code associated with programmatic transaction management. However, it’s important to note that ‘@Transactional’is typically used for local transactions within a service and does not directly manage distributed transactions across services.</p><p>In summary, Spring Boot’s support for 2PC and Saga patterns, combined with the convenience of the ‘@Transactional’annotation, equips developers with a robust set of options for managing transactions. By understanding the characteristics and use cases for each pattern, as well as the advantages of Spring’s transactional annotations, developers can make informed decisions to architect resilient and consistent microservice applications.</p><p>References :</p><p><a href="https://blog.knowledge-cafe.dev/distributed-transaction-in-spring-boot-microservices">https://blog.knowledge-cafe.dev/distributed-transaction-in-spring-boot-microservices</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce1e3a9191c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Concept to Code: Our Silver Finish at HackNC2023]]></title>
            <link>https://medium.com/@billa.anudeep143/concept-to-code-our-silver-finish-at-hacknc2023-d46f20a6bd0c?source=rss-4ee4a11da5de------2</link>
            <guid isPermaLink="false">https://medium.com/p/d46f20a6bd0c</guid>
            <dc:creator><![CDATA[anudeep billa]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 22:42:01 GMT</pubDate>
            <atom:updated>2023-10-31T22:42:01.101Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i2EUB_CV9nzcDv3J69-yGg.png" /></figure><h3><strong><em>Setting the Stage: The Electric Atompshere of HackNC</em></strong></h3><p>Stepping into HackNC2023 felt like entering a pulsating hub of innovation. With over 1300 eager minds registering and 80 dynamic teams gearing up, the atmosphere was thick with anticipation. These 36 hours weren’t just about coding; they were about brainstorming, innovating, and pushing boundaries. <strong>As accolades like the ‘Most Innovative Hack’ award from Cisco graced our team and we clinched 2nd place overall</strong>, the journey felt surreal. But HackNC was more than just awards and coding sessions. Sponsored by over 20 industry giants, including the likes of Cisco, Bandwidth, Wells Fargo, Zillis, John Deere etc, this event was a melting pot of themes, challenges, and opportunities. For those unfamiliar, HackNC isn’t just another hackathon. It’s a weekend where students, irrespective of their expertise, come together to expand their horizons, challenge their limits, and immerse themselves in the thrilling world of computer science and technology. As the largest hackathon in the southeastern United States, it promises not just learning but a whirlwind of tech workshops, networking, talks, and of course, an abundance of freebies and swag. Dive with me into this exhilarating experience, as I recount our journey, the challenges, the triumphs, and the sheer magic of HackNC2023.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GCAgkLB8h84qKlJ7TTaw2A.png" /></figure><h3><strong><em>Ideas to Vision: Addressing the Road Safety</em></strong></h3><p>Our brainstorming session was a whirlwind of ideas, each echoing the passion and drive we shared. As we navigated through potential problem statements, aiming for something both meaningful and timely, a chilling statistic stopped us in our tracks: between 2018 and 2020, over 5,184 lives were lost in India due to treacherous road conditions. This wasn’t merely data; it was a stark testament to a widespread issue with global ramifications.</p><p>As we delved deeper, the glaring gaps in the current road reporting systems became evident. While helplines and other conventional avenues existed, they often fell short in terms of speed and effectiveness. A vision crystallized in our minds: a cutting-edge, tech-enabled solution that would bridge the chasm between communities and local authorities, fostering safer roads and, ultimately, preserving lives.</p><p><strong><em>Glimpse of our Solution Design</em></strong></p><p>Our application revolutionizes the way road issues are reported. With just one tap, users can capture an image of a road defect, be it a pothole or any other damage, and the app instantly pinpoints and records its location. For officials, a dynamic real-time dashboard showcases these reports, enabling swift action. Once an issue is addressed, it’s a simple click to label it as ‘resolved’ in the system. What sets our app apart is its innovative features: it intelligently eliminates duplicate reports and even those within a proximity of 10m-100m, working on the premise that addressing one concern likely addresses neighboring ones. Furthermore, our integration of a machine learning model ensures the system’s integrity by screening out unrelated or inappropriate images, ensuring only genuine reports make the cut. This is our application’s blueprint, designed for efficiency and impact.</p><h3><strong><em>Crafting our Solution: Deep Dive into Technical Landscape</em></strong></h3><p><strong><em>The User’s Perspective: Simplicity Meets Efficiency</em></strong></p><p>Imagine walking down a street and encountering a dangerous pothole. In most scenarios, you’d probably hope that someone would report it and move on. But what if reporting it was as simple as clicking a photograph?</p><p>Our mobile application is designed with this very simplicity in mind. With a single click, users can capture an image of the road issue. The app then automatically fetches the location, eliminating the need for manual input. But we didn’t stop there. To enhance the user experience, we integrated Google Maps, allowing users to visualize the reported issues on an actual map. This not only provides a visual confirmation of the report but also aids in understanding the concentration of road issues in specific areas.</p><p>Upon a successful report, an entry is created in our system with attributes like longitude, latitude, name, and the image URL (stored securely in Firebase Storage). This seamless process ensures that within moments, a potential road hazard is logged and ready for administrative action.</p><p><strong><em>The Backend Magic: Automation and Intelligence</em></strong></p><p>Every user report triggers an event-driven Firebase Cloud Function, acting as the backbone of our system. This is where the magic happens. Embedded within this function is the Mobilenet ML model. It parses the image URL, retrieves the image name, and then cross-references the image stored in Firebase Storage. The goal? To validate if the image indeed represents a road issue.</p><p>Our commitment to maintaining the system’s integrity is unwavering. If the model determines that the image isn’t related to a road issue, both the image and its corresponding database record are promptly deleted. This automated filtration ensures that officials receive only genuine, relevant reports.</p><p><strong><em>Empowering Officials: Real-time Monitoring and Action</em></strong></p><p>For the administrative side, we crafted a web application with a user-friendly and engaging interface. As reports flow in from the mobile application, officials can witness them being updated live, thanks to the Firebase Real-time Database. This real-time monitoring is crucial for timely interventions.</p><p>Once officials address an issue offline, they can easily update the system through our intuitive UI. A simple click on the “fix this issue” button not only removes the record from our database but also intelligently deletes duplicates and any related reports within a 10–100m range. This ensures that the system remains updated and clutter-free.</p><h3>Technical Choices: The Rationale Behind Our Decisions</h3><p>When we set out to build our road reporting application, we knew it had to be robust, user-friendly, and efficient. The technical choices we made were driven by these imperatives.</p><p><strong>Java and the Android SDK:</strong> At the heart of our mobile application is Java, a language known for its versatility and robustness. We chose the Android SDK because of its widespread adoption, ensuring our app could reach a vast audience.</p><p><strong>React.js &amp; Bootstrap:</strong>React.js was our choice for the front end because of its capability to create dynamic user experiences. Its component-based architecture allows for efficient data rendering, which is crucial for real-time updates. Bootstrap complemented React.js by ensuring our dashboard was responsive, adjusting seamlessly to different devices.</p><p><strong>Firebase Cloud Functions &amp; Real-time Database: </strong>The backend’s heartbeat was Firebase Cloud Functions. We needed a system that could handle real-time data processing tasks, and Firebase’s serverless architecture was the perfect fit. Our choice of Firebase’s Real-time Database was driven by the need for instantaneous data storage and retrieval.</p><p><strong>TensorFlow’s Mobilenet:</strong> The integration of machine learning was pivotal in ensuring the relevance of reports. Mobilenet, a pre-trained TensorFlow model, was deployed to classify images. Its lightweight architecture and flexibility to integrate this with our backend functions given our stringent timelines made it an ideal choice. however, custom-trained models or more efficient models like ResNet would have performed better</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_k9m7BnYx-M%3Fstart%3D1%26feature%3Doembed%26start%3D1&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_k9m7BnYx-M&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_k9m7BnYx-M%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/77793a22a67cb2f28a740b4c85020b1c/href">https://medium.com/media/77793a22a67cb2f28a740b4c85020b1c/href</a></iframe><h3>Moments of Pride :</h3><p>With immense pride, we’re thrilled to share that our innovative solution clinched the “Most Innovative Hack” award from Cisco 🌟. But the accolades didn’t stop there; we also secured a commendable 2nd place overall 🥈. To see our brainchild receive such recognition amidst a sea of brilliant minds was truly humbling. Competing with such a talented and driven crowd was not just a challenge, but a remarkable journey that we’ll cherish. The accolades are a testament to our hard work, but the experience and memories forged are the real treasures. 🎉🙌</p><figure><img alt="After Winning Cisco’s Innovative Hack Award with Eli Gelber (System Architect at Cisco)" src="https://cdn-images-1.medium.com/max/684/1*xTD5c0ybGUjFq5aDjxXfLg.png" /></figure><h3>Conclusion :</h3><p>In our journey as enthusiastic engineers, we’re constantly fueled by an insatiable thirst for knowledge and the desire to learn from the broader community. HackNC2023 provided us with a golden opportunity to not only showcase our innovation but also to engage with industry stalwarts. Interacting and presenting our work to esteemed leaders from Cisco, Bandwidth, and numerous other renowned companies was an experience beyond comparison. It wasn’t just about the accolades or recognition; it was about the invaluable insights, feedback, and connections we forged. These moments, rich in learning and collaboration, are what truly shape our journey forward.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d46f20a6bd0c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to Apache Kafka with Microservices in SpringBoot]]></title>
            <link>https://medium.com/@billa.anudeep143/intro-to-apache-kafka-with-microservices-in-springboot-42f406f7abdb?source=rss-4ee4a11da5de------2</link>
            <guid isPermaLink="false">https://medium.com/p/42f406f7abdb</guid>
            <dc:creator><![CDATA[anudeep billa]]></dc:creator>
            <pubDate>Fri, 27 Oct 2023 00:12:44 GMT</pubDate>
            <atom:updated>2023-10-27T05:29:29.682Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Genesis of Kafka</h3><p><a href="https://kafka.apache.org/">Apache Kafka </a>embarked on its journey at LinkedIn, a platform bustling with billions of real-time events. The conventional systems faltered under the sheer volume of data, paving the way for Kafka’s inception. Envisioned as a robust event streaming platform, Kafka was adept at handling vast amounts of real-time data. Recognizing its potential, LinkedIn open-sourced Kafka in 2011, and it was later embraced by the Apache Software Foundation. Today, it stands as a testament to resilient data streaming, widely adopted across industries.</p><h3>Deciphering Kafka’s Core Concepts</h3><p>Apache Kafka, at its essence, is a distributed event streaming platform. To truly harness its capabilities, one must understand its foundational building blocks. These core components not only define Kafka’s architecture but also its operational dynamics.</p><h4>1. Topics &amp; Partitions</h4><ul><li>Topics: At a high level, a topic is a category or a name stream to which records (or messages) are sent by producers. Topics in Kafka are always multi-subscriber, meaning multiple consumers can subscribe to a topic and consume the data.</li><li>Partitions: Each topic can be split into partitions, which are the fundamental unit of parallelism in Kafka. Partitions allow topics to handle an arbitrary amount of data by distributing it. Each record within a partition gets an incremental id, called an offset.</li></ul><h4>2. Brokers</h4><p>In the Kafka ecosystem, a broker is essentially a server that stores data and caters to client requests. A Kafka cluster is made up of multiple brokers, and each broker can handle terabytes of messages.</p><h4>3. Producers</h4><p>Producers are entities or applications that send messages (or produce records) to Kafka topics. They push data to topics. Here’s what’s fascinating about Kafka producers:</p><ul><li>Acknowledgments: Producers can receive acknowledgments when messages are saved. This ensures data reliability.</li><li>Load Balancing: Producers automatically balance the load, distributing records among different partitions within a topic.</li></ul><h4>4. Consumers &amp; Consumer Groups</h4><p>Consumers read messages from Kafka topics. Unlike traditional message queues where messages are consumed and then removed, Kafka messages remain on the topic for a set duration, allowing multiple consumers to read them.</p><ul><li>Consumer Groups: To facilitate scalability, consumers can be grouped together to form a consumer group. Within a group, each consumer reads from exclusive partitions, ensuring efficient data processing. If a consumer fails, others in the group can take over, ensuring data resiliency.</li><li>Offsets: Kafka retains the record of which messages have been consumed using a mechanism called offset. Consumers can control their position (or offset) in the stream. This feature ensures that consumers can start processing from where they left off, even if they go down for some time.</li></ul><h4>5. Zookeeper</h4><p>While not strictly a part of Kafka’s internal functioning, Zookeeper plays a crucial role in its operational ecosystem. Kafka uses Zookeeper to manage distributed brokers. It helps in leader election for partitions and keeps track of broker metadata, ensuring the smooth functioning of the Kafka cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p5jvmAQVgyluKsirNSP-Sg.png" /></figure><h3>Preparing for Integration: Prerequisites and Dependencies</h3><h3>Prerequisites:</h3><ol><li>JDK 8 or Later: The foundation for running any Java-based application.</li><li>Spring Boot 2. x: This provides the necessary framework for building microservices.</li><li>Apache Kafka: An installation of Kafka running either locally or in a cluster setup.</li></ol><h3>Maven Dependencies:</h3><p>To weave Kafka into a Spring Boot application, specific dependencies need to be added to the project’s pom.xml file. The primary dependency is spring-kafka, which brings in all the required Kafka-related functionalities.</p><pre>&lt;dependency&gt;<br>    &lt;groupId&gt;org.springframework.kafka&lt;/groupId&gt;<br>    &lt;artifactId&gt;spring-kafka&lt;/artifactId&gt;<br>&lt;/dependency&gt;</pre><h3>Configuring Kafka in Spring Boot</h3><p>Before diving deep, you must define certain Kafka-specific properties in your application.properties file. These properties are pivotal in ensuring smooth communication between your Spring Boot application and the Kafka broker.</p><p>Properties to add:</p><pre>spring.kafka.bootstrap-servers=localhost:9092<br>spring.kafka.consumer.group-id=my-group-id</pre><p>Here, spring.kafka.bootstrap-servers points to the Kafka broker&#39;s address, while spring.kafka.consumer.group-id designates the ID for your application&#39;s consumer group.</p><h3>Crafting a Kafka Producer: Your Message Sender</h3><p>A producer is the entity responsible for sending messages to Kafka topics. Let’s construct a Kafka producer tailored for Spring Boot.</p><h4>KafkaProducerConfig: Setting up the Basics</h4><p>This configuration class sets the stage for producing messages.</p><p>Key components:</p><ul><li>ProducerFactory: It’s the linchpin, ensuring Kafka’s compatibility with Spring. It necessitates certain properties, such as the Kafka broker’s address and the serialization classes.</li><li>KafkaTemplate: Spring’s high-level abstraction over a Kafka producer, simplifying message-sending mechanics.</li></ul><pre>package com.example.kafka.producer;<br><br>import org.apache.kafka.clients.producer.ProducerConfig;<br>import org.apache.kafka.common.serialization.StringSerializer;<br>import org.springframework.context.annotation.Bean;<br>import org.springframework.context.annotation.Configuration;<br>import org.springframework.kafka.core.DefaultKafkaProducerFactory;<br>import org.springframework.kafka.core.KafkaTemplate;<br>import org.springframework.kafka.core.ProducerFactory;<br><br>import java.util.HashMap;<br>import java.util.Map;<br><br>@Configuration<br>public class KafkaProducerConfig {<br><br>    @Bean<br>    public ProducerFactory&lt;String, String&gt; producerFactory() {<br>        Map&lt;String, Object&gt; configProps = new HashMap&lt;&gt;();<br>        configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, &quot;localhost:9092&quot;);<br>        configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);<br>        configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);<br>        return new DefaultKafkaProducerFactory&lt;&gt;(configProps);<br>    }<br><br>    @Bean<br>    public KafkaTemplate&lt;String, String&gt; kafkaTemplate() {<br>        return new KafkaTemplate&lt;&gt;(producerFactory());<br>    }<br>}</pre><h4>MessageProducer: The Message Sending Mechanism</h4><p>This simple component uses KafkaTemplate to dispatch messages to a specified Kafka topic.</p><pre>package com.example.kafka.producer;<br><br>import org.springframework.beans.factory.annotation.Autowired;<br>import org.springframework.kafka.core.KafkaTemplate;<br>import org.springframework.stereotype.Component;<br><br>@Component<br>public class MessageProducer {<br><br>    @Autowired<br>    private KafkaTemplate&lt;String, String&gt; kafkaTemplate;<br><br>    public void sendMessage(String topic, String message) {<br>        kafkaTemplate.send(topic, message);<br>    }<br>}</pre><h3>Building a Kafka Consumer: Your Message Receiver</h3><p>A consumer listens to and processes messages from Kafka topics. Let’s build a Kafka consumer aligned with Spring Boot.</p><h4>KafkaConsumerConfig: The Underlying Mechanics</h4><p>This configuration class is pivotal for consuming messages.</p><p>Key components:</p><ul><li>ConsumerFactory: It sets the stage for Kafka’s compatibility with Spring and mandates certain properties such as the Kafka broker’s address, the consumer group ID, and the deserialization classes.</li><li>ConcurrentKafkaListenerContainerFactory: This factory aids in creating containers for methods annotated with @KafkaListener.</li></ul><pre>package com.example.kafka.consumer;<br><br>import org.apache.kafka.clients.consumer.ConsumerConfig;<br>import org.apache.kafka.common.serialization.StringDeserializer;<br>import org.springframework.context.annotation.Bean;<br>import org.springframework.context.annotation.Configuration;<br>import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;<br>import org.springframework.kafka.core.ConsumerFactory;<br>import org.springframework.kafka.core.DefaultKafkaConsumerFactory;<br><br>import java.util.HashMap;<br>import java.util.Map;<br><br>@Configuration<br>public class KafkaConsumerConfig {<br><br>    @Bean<br>    public ConsumerFactory&lt;String, String&gt; consumerFactory() {<br>        Map&lt;String, Object&gt; configProps = new HashMap&lt;&gt;();<br>        configProps.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, &quot;localhost:9092&quot;);<br>        configProps.put(ConsumerConfig.GROUP_ID_CONFIG, &quot;my-group-id&quot;);<br>        configProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);<br>        configProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);<br>        return new DefaultKafkaConsumerFactory&lt;&gt;(configProps);<br>    }<br><br>    @Bean<br>    public ConcurrentKafkaListenerContainerFactory&lt;String, String&gt; kafkaListenerContainerFactory() {<br>        ConcurrentKafkaListenerContainerFactory&lt;String, String&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();<br>        factory.setConsumerFactory(consumerFactory());<br>        return factory;<br>    }<br>}</pre><h4>MessageConsumer: Listening to Kafka Topics</h4><p>This component actively listens for messages on a specified Kafka topic</p><pre>package com.example.kafka.consumer;<br><br>import org.springframework.kafka.annotation.KafkaListener;<br>import org.springframework.stereotype.Component;<br><br>@Component<br>public class MessageConsumer {<br><br>    @KafkaListener(topics = &quot;my-topic&quot;, groupId = &quot;my-group-id&quot;)<br>    public void listen(String message) {<br>        System.out.println(&quot;Received message: &quot; + message);<br>    }<br>}</pre><h3>Testing the Integration: Seeing Kafka in Action</h3><p>To see Kafka in action, craft a REST controller. This will let you send messages via an HTTP POST request.</p><pre>package com.example.kafka.controller;<br><br>import com.example.kafka.producer.MessageProducer;<br>import org.springframework.beans.factory.annotation.Autowired;<br>import org.springframework.web.bind.annotation.PostMapping;<br>import org.springframework.web.bind.annotation.RequestParam;<br>import org.springframework.web.bind.annotation.RestController;<br><br>@RestController<br>public class KafkaController {<br><br>    @Autowired<br>    private MessageProducer messageProducer;<br><br>    @PostMapping(&quot;/send&quot;)<br>    public String sendMessage(@RequestParam(&quot;message&quot;) String message) {<br>        messageProducer.sendMessage(&quot;my-topic&quot;, message);<br>        return &quot;Message sent: &quot; + message;<br>    }<br>}</pre><p>To test, run your Spring Boot application. Utilize a tool like Postman to send a POST request to http://localhost:8080/send?message=Hello_Kafka. The dispatched message will be relayed to the Kafka topic, and the consumer will echo it to the console.</p><h3>Wrapping Up</h3><p>Throughout this guide, we’ve delved deep into the integration of Apache Kafka with Spring Boot. Armed with clear steps and code insights, you’re now better prepared to tap into the potential of Kafka within your Spring Boot endeavors. For those navigating the realms of event-driven designs or real-time data tasks, the marriage of Kafka and Spring Boot is truly invaluable. Here’s to building more efficient and robust applications! Cheers! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42f406f7abdb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PLM In Data Analytics Perspective.]]></title>
            <link>https://medium.com/@billa.anudeep143/plm-in-data-analytics-perspective-afd504f8a764?source=rss-4ee4a11da5de------2</link>
            <guid isPermaLink="false">https://medium.com/p/afd504f8a764</guid>
            <dc:creator><![CDATA[anudeep billa]]></dc:creator>
            <pubDate>Thu, 28 Oct 2021 10:47:01 GMT</pubDate>
            <atom:updated>2021-10-28T10:47:01.724Z</atom:updated>
            <content:encoded><![CDATA[<p>I<em>n the era of Industry 4.0, product lifecycle management is evolving into a new paradigm where it can connect all the digital components of a product life cycle, and act as a single source of truth. PLM capabilities are no more limited to version control, life cycle management, change management, relationships between the data points, and workflow process implementations, well all of these can still serve as the baseline to address the operational challenges .it is no longer a hypothesis that big and medium manufacturing players are enticed about the idea of enhancing PLM techniques to help them take quick business decisions and draw vivid and meaningful insights with the help of advanced analytics.</em></p><p><em>Data is stored in the PLM system comply well with the concepts of volume, variety, and velocity in Bigdata analytics. as the PLM system holds long years of structured data, feeding this data to advanced analytical functionalities and machine learning algorithms can leverage the process of product development for discrete manufacturers with data-driven insights. Cross-Industry Process for Data Mining (CRISP-DM), Predictive Model Markup Language (PMML), and other standard analytical models can be used to fully manage the product metadata. descriptive analytics uses data to explore the trends and performance after they occur, though PLM supports it to some extent. diagnostic analytics and predictive analytics can be the areas of focus. advances from descriptive analytics to predictive analytics can maximize the value and the potential for result-driven insights mainly when huge investments and efforts are considered can be plummeted sharply. the variety of data and its presence across different manufacturing information systems like PLM, ERP, and MES can be a major challenge for conducting data analytics projects in a manufacturing firm. Feedback can be managed well if data from different sources is easily accessed by a standard interface (API). This is achieved through Open Services for Lifecycle Collaboration (OSLC).</em></p><p><em>Let us discuss a critical section of the product management and development process and how analytics can bring great value with the product metadata available in the PLM system. Change Management is one of the vital components in implementing changes to products in the market and product improvement. PTC&#39;s partnership with Kalypso is changing the whole idea of a typical change management system. Product lifecycle intelligence can take the variability and guesswork out of the implementation timeline based on the data PLM systems have collected, Change managers can now receive real-time feedback on the Implementation task along with some smart predictions on which team to choose, the cycle time of change, and its impact.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DyZGY3lam-pcMMpWyRVG5g.png" /><figcaption><em>Data insights showed on CN with the help of PLI ( Source: Kalypso website )</em></figcaption></figure><p><em>The PLI engine can propose Implementation plans before even the change manager adds them, based on the historical references present in the system PLI engine can provide advanced and vivid insights to assess the overall change plan. features like Time prediction, the margin of error, and confidence level will help the change managers before making any decisions or conclusions as part of change implementation.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yl6-H10KHgPtxLmEyx8bJA.png" /><figcaption><em>Timeline and CCB approval predictions (Source: Kalypso website )</em></figcaption></figure><p><em>Based on historical data and resource availability, the PLI engine also predicts the overall timeline for end-to-end implementation of the change process. The decisive features that are employed in producing the forecasts can also be displayed to the end-user while the machine learning system predicts the timings. Features that are provided to the ML algorithm, such as Sum of change tasks time, complexity, Assigned workflow template, and so on, will calculate the values along with the difference to mean percent, as shown in the above fig. Adding a new task can dynamically change the reports with new predictions along with explanations.</em></p><p><em>Questions like ‘How can I decrease my change cycle times while ensuring quality and compliance can be answered now easily with the help of Product life cycle intelligence by providing specific recommendations, matching tasks, and meaningful insights. advanced analytics can transform the manufacturing and service process immensely. beyond the shadow of a doubt data analytics in the future scope in product lifecycle management.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afd504f8a764" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>