<?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 Dilhan Theekshana Weerakoon on Medium]]></title>
        <description><![CDATA[Stories by Dilhan Theekshana Weerakoon on Medium]]></description>
        <link>https://medium.com/@weerakoondilshan.dw?source=rss-4bbae14771e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*U7XCcspD2jVo9cA_</url>
            <title>Stories by Dilhan Theekshana Weerakoon on Medium</title>
            <link>https://medium.com/@weerakoondilshan.dw?source=rss-4bbae14771e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:06:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@weerakoondilshan.dw/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[Microservices 7]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/microservices-7-df9c8087da3c?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/df9c8087da3c</guid>
            <category><![CDATA[proxy-pattern]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 17:24:27 GMT</pubDate>
            <atom:updated>2022-07-24T17:24:27.395Z</atom:updated>
            <content:encoded><![CDATA[<h3>Proxy Pattern</h3><p>It is preferable to deploy the initial service with a proxy service if you have often updated services. This allows you to independently launch your service without upsetting your customers.</p><p>Versioning semantically is crucial. Major, minor, and patch are present. When you upgrade from a previous version, you do so with a major version. Minor changes to existing functionality will not affect how it currently functions. You can implement the patch version however you’d like.</p><p>Using an outside source to find the service for you during service discovery is preferable. All of its components can change when the infrastructure does.</p><p>We may leverage the WSO2 governance registry for service discovery.</p><p>It’s important to monitor thread pools while implementing proxy patterns. Using numerous thread pools or a thread handover mechanism can fix this.</p><h3>Reference</h3><p>[1] Krish Dinesh.”Design patterns for microservices — 03” Available: <a href="https://www.youtube.com/watch?v=7mBvb7nKONg&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=7&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=7mBvb7nKONg&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=7&amp;ab_channel=KrishDinesh</a> [Accessed: July 14,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df9c8087da3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices 6]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/microservices-6-7d95ea594cc2?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d95ea594cc2</guid>
            <category><![CDATA[circuit-breaker-pattern]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 17:18:23 GMT</pubDate>
            <atom:updated>2022-07-24T17:18:23.411Z</atom:updated>
            <content:encoded><![CDATA[<h3>Circuit Breaker Pattern</h3><p>Each service must continue to exist in order for the microservice to be successful.</p><p>A service goes offline when it encounters a problem. It will not be possible to hit a failing service and have it fail back to the customer. Having more than a threshold lets you spot this flaw.</p><p>When a service fails, a ping is sent to that specific service. This circuit will switch on once more if the communication has returned to the normal threshold.</p><p>There is no queue because when a request fails, we return the error message rather than placing it in a queue. Once this service is operational, it will handle the remaining requests.</p><h3>Reference</h3><p>[1] Krish Dinesh.”Design pattern 02 — Protect your services with Circuit Breaker pattern” Available: <a href="https://www.youtube.com/watch?v=mw8W-RpvCu0&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=6&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=mw8W-RpvCu0&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=6&amp;ab_channel=KrishDinesh</a> [Accessed: July 14,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d95ea594cc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices 5]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/microservices-5-8bc72c6e9840?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bc72c6e9840</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 16:57:17 GMT</pubDate>
            <atom:updated>2022-07-24T16:57:17.871Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Design Patterns</strong></p><p>The parallel pattern, chain pattern, and branch pattern are the three components of the aggregator pattern. If a domain-driven approach can be used to implement a microservice system. Services including personnel details, leave information, pressure information, and service number for allocation information are available in the system. Customers of this technology include project management systems and attendance management systems. If they have a monolithic system, they should use a microservice system in addition to everything else.</p><p>These services can be archived in a variety of ways. The first step is to develop a single microservice for the system, followed by additional microservices for project management and claim management. However, a single service counts as a single microservice in the domain driven method.</p><p>Take personal information as an example, followed by leave information, pressure information, and allocation information as the next three services. Therefore, there is no longer a service to send employee and leave information to the attendance system. There is no mechanism in place to transfer personal data and allocation data to a project management system. With four service microservice, this is acceptable.</p><p>Create one service that uses those two services and then responds to the user. The service will accept the consumer’s request, invoke personal information, leave personal information, and integrate the response before sending it back to the consumer. When creating an ESB-based system, the terms “intelligent pipe” and “dumb back” are used. Microservices also use these terms. When the attendance service is invoked, it can send parallel courses to individuals and collect personal data while returning a single response to the user. This process is known as parallel aggregation. If the consumer is unaware of how to obtain information from the ID and there is a dependency on personal information, such as taking it from an employee ID. The employee code can then be obtained from the personal information service, which can then be used to access leave information and receive a response. The parallel pattern delivers a response in 10 milliseconds if personal information and leave information require 10 milliseconds to process, but the service training technique visits each person one at a time, thus it will take 20 milliseconds. When moving from a monolithic to a microservice platform, the backend may still be using legacy platforms; in such case, the service chaining technique must be used. In a different example, an encoding service receives a response, pushes the information to another encoding service, and both require the service chaining pattern. The branching pattern is applied when a service and user transmit an emp ID and branch code, respectively, before calling a personal information service if the branch code instructs the user to call another service. Make a selection based on a few factors, then branch out.</p><p>When implementing the four microservices, another agitation service was developed for the attendance service, and additional aggregation was implemented for the project management. One use case is when the project management service decides to examine employee leave information and business logic before allocating new projects. Two new services are consumed by the project management system. There should be another aggregate service because the microservice does not alter the existing services. Consumers can use upgraded services after both services have been deployed into production. Customers can switch to the new service if the agile technique keeps to the schedule.The implementation of the project management system as a java object while integrating additional services may not be a smart idea. Currently transmitting a response payload with personal data and allocation details. It divides the adjacent to a Java object after taking the response. The service must stop if more information is sent, but you can prevent this by adding annotations or keeping space for some extra data. When a third service that has allocation information is deployed, if the service breaks, the consumer will also break. Microservices must be autonomous; if they are strongly tied due to a dependency on one another, they are not microservices.</p><h3>Reference</h3><p>[1] Krish Dinesh.”Design patterns for Microservices — so you won’t Abuse it :)” Available: <a href="https://www.youtube.com/watch?v=DZeXqbFvYNA&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=5&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=DZeXqbFvYNA&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=5&amp;ab_channel=KrishDinesh</a> [Accessed: July 14,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bc72c6e9840" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices 4]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/microservices-4-5fcf322b541?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fcf322b541</guid>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 16:50:03 GMT</pubDate>
            <atom:updated>2022-07-24T16:50:03.441Z</atom:updated>
            <content:encoded><![CDATA[<h3>Best Practices in Microservice.</h3><p>When creating microservices, there are numerous excellent practices to follow. Customer service and restructuring services are available, and customers can express themselves differently in the registration service depending on the aspect. When creating a microservice, be careful to have a unique, domain-driven design. When assembling a system with multiple components, a single service cannot be produced. Depends on the available funds. It is preferable to start from scratch and construct the service as freshly as feasible. Anything that does not belong in the service should be isolated and separated as much as feasible.</p><p>Other than the business logic, several configuration parameters also have hardcoded values. When one service A calls another service B, service B’s address should be provided, and the majority of developers hardcode that value. It can be the service’s hostname or IP address. Having hard coded values causes problems if the network address changes for some reason. because additional deployments are required to alter the code. Having sufficient service discovery tools, registries, or methods is the best way to provide the address.It is preferable to use a service breaker pattern. When service B is unavailable, call for service C. As a result, the discovery tool can host a flag to indicate that service C is not available. Service B can then see that Service C is not available before calling it. The advantage can have any mechanism, such as a proxy, but it has a drawback if the proxy is not used effectively and other services cannot be inherited. Consequently, service discovery should be used rather than hardcoding international service addresses.</p><p>Developers then struggle with the logging service because either it has no logs or it has too many logs, both of which are unacceptable. If a service to validate customers exists, it will call several services. If an exception occurs in the service layer and the logging is done there, everything is great. However, if the exception occurs in the service layer and the service is called, the service layer sees the exception and the service layer logs it. identical mistake twice logged. Failed fast log later is the ideal procedure. If an exception occurs, quickly return and log it later. Thus, logging begins in the final layer.Since microservices might not be maintained, this is not directly applicable to them. It is preferable to have minimal logging and log in-placement. If service A receives a request, passes it via numerous service A layers, calls B, and then contacts C. The other participant cannot notice what is failing in the middle of the traffic flow. Therefore, it is a good idea to generate a unique ID when the service is first launched. Before reaching the service layer, it could be created on the web server. When a request is made, X and Y can ask the web server to generate an ID at the very beginning by implementing a script or proxy.As a result, you may utilize log dependent to write those correlation IDs when the logging service is initiated and you try to log a statement. Therefore, there is a log statement and a log file. Otherwise, you can utilize a logging framework and ensure that it has a way for creating logs so you can search them. Therefore, it is crucial to keep good logging, and warning, debugging, errors, and information should all be recorded separately.</p><p>Versioning is crucial for a service to have, and it should be known what version will be used for the subsequent deployment. Version numbering is an excellent governance approach that uses semantic versioning. It explains which digit should increment in the event of a bug. It specifies which digit needs to change and is backward compatible. Because the version number accurately identifies the version that is now being called, semantic versioning is a smart practice to follow. The phrase “force operate” refers to a concept where service A calls service B and has to update service B in a service tree. The database structure and service requests would change during the update change. Service A will break as soon as service B pushes a new version. In order to deploy this as a distinct service, one can increment the major version number. Traffic still uses Service B version 1.0 even though Service A version 2.0 is different. However, it can be difficult for the consumer if this capability doesn’t get updated before the deadline. Give the service some time to be updated if there are numerous customers. When every user has switched to version 2.0, version 1.0 communication can be stopped.</p><p>Developers believe they should control everything manually when the deployment occurs. There are sufficient tools for deployment, allowing for the deployment of several services on a single host. In a physical box, or operational environment, only one service can host. Docker creates an isolated operating environment for the service, which makes microservice deployment simple. When a service requires more instances, more Docker containers can be created, and fewer instances can be destroyed.</p><p>Then, the authentication and authorization method would require more instances if each service attempted to validate the user. Try to verify the token when accessing whether there is an oath code to validate the user for each service. One possible approach is to establish a separate identification service that, upon receiving a request, can instantly identify the user and direct them to the appropriate service. This method avoids latency and is a good practice because, over time, the algorithm may change for authentication, authorization, or validation.</p><p>The next tip is to prevent service dependencies because it is problematic if services B and C fail to deploy simultaneously while trying to deploy them. Dependencies are OK, but they should allow for independent deployment without affecting other services.</p><p>The need of creating executable contracts comes from the fact that conventional applications should take into account the user experience, but services have users and should be user-friendly and permissive of usage without disrupting the services. Consumers may have a contract or API specification, and they should ensure that the contract is upheld. For this, it is possible to transform this contract into an executable one by creating test cases, test scripts, or requests. These tests run automatically whenever a service is built.</p><p>Since there are numerous services and multiple failures are possible, fault tolerance is crucial. Thus, they ought to handle correctly. Strong fault tolerance or an improvement mechanism is required.</p><p>Documentation of additional points is crucial because others need to comprehend the offerings. Swagger can be used to write documents in a technical style that is easily converted to documentation. Swager console allows for the writing of technical phrases, which are then translated into documentation and UI.</p><h3>Reference</h3><p>[1] Krish Dinesh.”Best practices for Microservices / Web Application Developers” Available: <a href="https://www.youtube.com/watch?v=Alj5sqsv0QU&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=4&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=Alj5sqsv0QU&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=4&amp;ab_channel=KrishDinesh</a>[Accessed: July 14,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fcf322b541" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices 3]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/microservices-3-9eb5ac9016c?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9eb5ac9016c</guid>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 16:27:12 GMT</pubDate>
            <atom:updated>2022-07-24T16:27:12.858Z</atom:updated>
            <content:encoded><![CDATA[<h3>Web Application to Microservices.</h3><p>Applications that we have use today is call as Monolithic application. Because it has single executable file for the entire application. So that in here, if need to change a small change like a color of a button need to change from purple into green we can change that small change. But we need to zip the whole application again with containing that small change. So that we need to test the entire application again, we need to put the working application down and replace with the new tested application.</p><p>Second drawback of the Monolithic application is need to manage a huge number of code base. So that it need to maybe 50 to 100 of software engineers to handle a single application. If there is an error in some part there is no one to handle it. Because there is no a single engineer that knows the entire applications’ codes. So we need to get a support for various parties.</p><p>Not only these drawbacks but also have some advantages like easy to test. Because we need to write a one single test code. And also it is easy to monitor.</p><p><strong>What is Microservices?</strong></p><p>Microservice is a service oriented architecture that carrying some useful features. This not the exactly definition. Because there is no any exactly definition for Microservice.</p><p><strong>Characteristics of Microservices.</strong></p><ul><li>Microservice has a dedicated purpose of living. In other words domain driven development. It has to have exactly defined scope.</li><li>It should run own processes.</li><li>Communicates through its own light weight mechanism.</li><li>Should be able to scale and deploy as individual services.</li><li>Maintain decentralized way as much as possible.</li><li>When developing a microservice and separating some minor services into independent microservices, we must balance it because communication with other services requires some latency.</li><li>Other services should be able to handle the failure situation when one service fails. We refer to this as fault tolerance. This fault tolerance can be achieved using a circuit breaker pattern, a fail over mechanism, and a proxy.</li></ul><p><strong>Advantages of microservices.</strong></p><ul><li>When a manufacturing problem arises, it is rather simple to identify the source of the issue. simple to debug</li><li>Services may be scaled.</li><li>simple to switch to another language or framework.</li></ul><p><strong>Disadvantages of microservices.</strong></p><ul><li>Hard to monitor the application.</li><li>Testing is challenging since different services can depend on one another.</li><li>Versioning and deployment ought to receive more consideration.</li><li>The application cannot function until all services are active.</li><li>The service must be handled by the team. You created it, so you own it.</li></ul><h3>Reference</h3><p>[1] Krish Dinesh.”Web application to Microservices. GO or NO GO” Available: <a href="https://www.youtube.com/watch?v=FO_qg9ETcT0&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=3&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=bUtIIWbaFKc&amp;t=5s&amp;ab_channel=KrishDinesh</a>. [Accessed: July 14,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9eb5ac9016c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices 2]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/microservices-2-b6d73d06445c?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6d73d06445c</guid>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 16:18:34 GMT</pubDate>
            <atom:updated>2022-07-24T16:18:34.131Z</atom:updated>
            <content:encoded><![CDATA[<h3>Container-less Application with Spring Boot</h3><p>Web server is a server which handle HTTP requests. Also it not capable to handle any kind of java EE application. Web server will run on port 80 and deployed PHP or HTML files and start the server.</p><p>What Web Container do?</p><p>Web Container is capable to handle a part of java EE specification based on servlet. It means web containers are capable to handle the servlet. Application servers are equipped to handle the entirety of the Java EE specification. Web applications that are placed inside containers can handle many applications. If all the apps are in a single container, and one of them experiences a problem and needs to restart, the other apps will also go offline. Restarting every app is a waste if the application is essential for company operations.</p><p>Another issue is that cloud application deployment will result in containers. It is difficult to manage if different configurations are used in various web services. Because different applications need to have same different version is hard to configure.</p><p>The web application inside the container must restart if necessary. However, a container will be started and used by the web server or application when it runs, which is embedded to the web server. This implies that the application creates its own container. Because it is independent and focused, that within can accomplish anything. One benefit of having a container of one’s own is that it can restart whenever it wants and configure itself. Additionally, the main method may be public static void.</p><p>This approach can be developed in numerous ways, much like frameworks. There is a mac service framework if the application is a microservice. The spring boot is a top framework with great performance, a small memory footprint, and efficient process utilization.</p><ul><li>The <a href="http://twitter.com/SpringBootApplicatio">@SpringBootApplicatio</a>n annotation is mentioned in the spring boot application’s main function.</li><li>The greeting controller class is part of the controller package, and the <a href="http://twitter.com/RestController">@RestController</a> annotation designates it as a controller. The way of greeting prints an HTML section. The server does not need to be configured for spring boot. The main method should then execute.</li><li>The consoler starts the servers and prints the spring version. The program is active on port 8080.</li></ul><p>The technique can be seen executing in the browser. Models and services can be implemented in a typical web application. A spring web application can be easily created using Spring MVC. The application can be remotely debugged using the debug standard Java application.</p><h3>Reference</h3><p>[1] Krish Dinesh.” Develop Container-less Application with Spring Boot” Available:<a href="https://www.youtube.com/watch?v=hXLmW7bhA10&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=3&amp;ab_channel=KrishDinesh"> https://www.youtube.com/watch?v=hXLmW7bhA10&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;index=3&amp;ab_channel=KrishDinesh</a> . [Accessed: July 14,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6d73d06445c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Docker and Container based development]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/introduction-to-docker-and-container-based-development-fd76b9ee29ad?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd76b9ee29ad</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 24 Jul 2022 09:59:03 GMT</pubDate>
            <atom:updated>2022-07-24T09:59:03.841Z</atom:updated>
            <content:encoded><![CDATA[<h3>Microservices 1</h3><p>Web server, app server, and database hardware were all utilized separately in the beginning. As a result, it must retain its physical location, network, operating system, and associated costs. Due to the possibility that the observer, web server, or memory may not be fully utilized, as well as the possibility that the database server may not be fully utilizing the database’s 100 available spaces.</p><p>Then, virtual machines and hypervisors are used by the next generation.</p><p>In actual hardware boxes, there are web servers, AB servers, and database services. The issue is that someone is required to maintain the servers. If maintaining this calls for many services, multiple people. When servers stopped consuming hundreds of gifts, the network and available space increased. Then there is a technique known as a hypervisor, which uses a single type of hardware with high processing power and installs numerous virtual machines on top of it.When assume one VM for web server and second to observer. Then one take 20% processing power other one 30%. Altogether there is 50% processing power. Then there are other virtual machines like proxy or mail server or load balancer to use the space to create them. The wastage was minimum. For maximize the investment then install an operating system on top of each virtual machine maybe Linux or any other operating systems. Then on top of the operating systems the application is installing and now it is a virtualized environment. The generation two has no issues, but this generation faces certain challenges since three distinct operating system components must be divided. Although Red Hat Enterprise can use Linux, license is an expense that must be incurred. However, it lessens the amount of effort, updates, and maintenance expenses.</p><p>Another issue necessitates the use of additional web services. Therefore, it is necessary to install a new VM as well as a new web server. Even if the service has been installed, there is still a lot of setting required because some hostnames cannot remain in the same network, and while there are workarounds, they are not yet satisfactory. There are no many operating systems to manage in generation three, which is known as containers. A VM cannot start in the allotted time due to the lengthy startup times of the operating system and the boot-up build process. There is a timing issue with booting because it takes time to spin up a new virtual machine and upkeep is expensive.</p><p>The same hardware box still houses containerized software, which is run on top of a single operating system. then addressing the issue of licensing maintenance and upgrades. Create Docker on top of the operating system to address those issues. These bricks or containers would be contained up. Create the application and layer it over the Docker container. The hypervisor is superior to the docker or container. More compact than the hypervisor is the container. because it has its own operating system or setup, but Docker lacks those.</p><p>They developed this service separately because they already had a cloud platform called dot cloud that they were using internally. By the way, it’s a technology-related project named Docker. Powered by the Apache 2.0 license, Docker is an open source project. That indicates that Docker does not own Docker, despite the fact that they appear to be the main force driving the project.</p><p>Docker is a container, and VM is a hypervisor. Due to the lack of many operating systems and numerous other tasks, the docker makes things simple. The main benefit is that docker runs on an operating system that is already running; there are no additional operating systems to boot. Consequently, the application boots up quickly.</p><p>Docker Engine is something that exists. The Docker project is not it. It makes up a relatively modest portion of the orchestration registry security service that was constructed using the Docker engine. One of the orchestrations is registered. The registry is a location where Docker images can be kept. The customized Docker image can then push those images back to the registry. If there are numerous hosts in the environment and you require the customized image pack, you can log in to the hosts and receive it. can also design private or public repositories.</p><p>The orchestrating process brings all the instances together to work toward a single objective. Distinct services can establish different containers for each other at the micro level. When there are several components, orchestration is the process of bringing them all together and keeping them moving toward an unified objective.</p><p>Another issue is that Docker is not persistent; for example, when it was shut down, everything was lost. Docker is persistent by nature, thus that is incorrect. Even though the docker is persistent, using the data in an external environment is always advised if a database has been constructed.</p><p>Another misconception is that Docker is only for modern apps, which is partially true and partially untrue. It is usually advisable to employ micro level service architecture while utilizing Docker. Only then are independent containers possible. The program develops self-healing abilities as a result. This design is preferable if legacy systems are moving to Docker. Technically, using Docker has no restrictions, but architecture is important.</p><h3>Reference</h3><p>[1] Krish Dinesh.” Introduction to Docker and Container based development” Available: <a href="https://www.youtube.com/watch?v=cUiU8yDdQmw&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=cUiU8yDdQmw&amp;list=PLD-mYtebG3X9HaZ1T39-aF4ghEtWy9-v3&amp;ab_channel=KrishDinesh</a>. [Accessed: July 10,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd76b9ee29ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TCP dump for slow backend]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/tcp-dump-for-slow-backend-6bc26913a84a?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6bc26913a84a</guid>
            <category><![CDATA[tcpdump]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Fri, 22 Jul 2022 18:51:38 GMT</pubDate>
            <atom:updated>2022-07-22T18:51:38.638Z</atom:updated>
            <content:encoded><![CDATA[<p>What is the reason for service getting slow?</p><p>There are several factors slowing down the service. The true causes of an application’s lag are as follows:</p><ul><li>Server is overloaded.</li><li>Database requests are either poorly constructed or executed too slowly.</li><li>Problems with load balancing (overloading one server)</li><li>Difficulty with DNS settings.</li><li>Performance issues with the network</li><li>Slow Web request.</li><li>Slow execution of application code.</li></ul><p>The application listed below was utilized to solve this issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/0*HQ9iwU5GEI_gJb56.png" /></figure><p>First, send a simple test payload. Programs used in this case are Wireshark and Insomnia. The tcp.port==8190 (the port I’m using) should be filtered once the loopback interface has been collected. Launch the server next. As a result, there is no traffic at first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*_n6IFkZeCDzJnJjz.png" /></figure><p>In Wireshark, the traffic may be seen as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*Lm-A0KkdU0zDN-5s.png" /></figure><p>Both the customary opening handshake and a characteristic known as window size are present. The initial request also included the window size. The window size is the largest buffer that can be used simultaneously. In Wireshark, the window update packet is often sent following the window 0 pack. A window update was sent by the server. If there is a sizable file update, the buffer size is inadequate. When a request requires a larger window size, a window scale flag is an option. It scales the window 64 times as necessary. The window scale is only present in handshake packets. Therefore, any evaluation of the system’s latency should concentrate on the first handshake packets.</p><p>Try sending a big file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*Gxm8mw-wWRJXWtDY.png" /></figure><p>The server SIN ACK flag has raised the window scale, and we can see that the window has been updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*Gh6HRdOccgNRRXVC.png" /></figure><p>In this instance, the buffer size is gradually getting smaller. Even when the server reduces the enormous file down to a buffer, you can still access it thanks to an application layer. The entire buffer size, which the program consumes 90% of, may then be used to access the data. 10 percent of the data is still in the buffer. The buffer can then only receive data from the server to fill up 90% of its available space. The continued reduction of this percentage might not be a problem. However, the buffer size is virtually at zero percent because the software consumes so few resources. Despite the server delivering data from the client at a quick rate, the application does not consume data at the same rate as the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/0*H7odhm-8GdteRJYH.png" /></figure><p>Within seconds, there is a response to the handshake. It is a concern if the response took longer than expected. Send a packet to the server, and it takes only seconds for the server to respond. Every handshake takes time, as does every Ack.</p><p>The TCP segment length is kept in the send buffer. By multiplying one number by the next, the value is obtained. The client then communicates an ACK to the server. Up to the server Ack, it will remain in the sent buffer. After receiving 5 bytes from the client, the server will respond with 6 Ack if the sequence is 1. Prior to that, the client cannot clear the send buffer. The Ack is slow if the server takes a while to react. The send buffer must then be kept full of data, and incoming data cannot be added.</p><p>Reduced estimated window size is another factor contributing to the slower speed. When it advertises a window size of zero, a client or server cannot accept any more data since the TCP receive buffer is full. Due to a stopped CPU or being distracted with another work, the TCP can get a buffer to fill.</p><h3>Reference</h3><p>[1] Krish Dinesh.” How to Troubleshoot SLOW backends using TCP dump and Wireshark (Demo)” Available: <a href="https://www.youtube.com/watch?v=Ca9ZRyzeauo&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=bUtIIWbaFKc&amp;t=5s&amp;ab_channel=KrishDinesh</a>. [Accessed: July 20,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6bc26913a84a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HTTP]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/http-88f7b5349317?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/88f7b5349317</guid>
            <category><![CDATA[http-keep-alive]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Wed, 20 Jul 2022 18:50:49 GMT</pubDate>
            <atom:updated>2022-07-20T18:50:49.729Z</atom:updated>
            <content:encoded><![CDATA[<p>HTTP 1.0 is a persistent protocol that consists of two parts: one with tunneling and the other without. HTTP 1.1 defaults to tunneling (send the messages and get the responses after transaction ends either server or client).</p><p>Send a message to the server to “keep alive” this connection.</p><p>When we filter the wireshark data by tcp.port==8191 while running the express app below, nothing happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/0*tYrEfBWaGtMxEX5r.png" /></figure><p>Run this endpoint in the browser at localhost:8191/wait, and then use Wireshark to view the content below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/845/0*hiBLuLpXQa3OkKEG.png" /></figure><p>Starting the connection using SYN, followed by SYN, ACK, and the ACK (26,27,28). The TCP handshake at that point was typical.</p><p>You can see in line 32 it send the request and get the response at line 34.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/0*l_GJwYn2Nyi_EL4R.png" /></figure><p>As you can see at line 44, the server sends the client, ending the connection. At line 45, the client gave the server an ACK but did not terminate the connection.</p><p>SYN, SYN ACK, and ACK signal the beginning of each transaction.</p><p>We can see from the screenshot below that we send the request (line 89), the server acknowledges it (line 90), the server sends the response (line 91), and you acknowledge that (line 92). Every time we refresh the page, this keeps happening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/0*Pm0N7Tfppe4ZQky3.png" /></figure><p>However, since we continue to communicate with the backend and it makes no attempt to break the connection, there is no FIN. This link remains strong. We only send 1 SYN packet to each of these send requests.</p><p>What happens when we reload the website and then dismiss the browser window after receiving a response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*bhTSusY1U4M6IVxt.png" /></figure><p>Line 22 comes after the server sends the client’s response. then at line 23, the client ACKs it to the server. Client sends FIN to server as shown in line 24 when browser is closed before server closes connection. After delivering ACK to the client, the server cuts off the connection at line 26 by sending FIN, and the client responds by sending ACK to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/0*CDqmZcz6APset_g5.png" /></figure><p>The request will now arrive, linger for a minute, and then execute the answer.</p><p>The client is currently anticipating a response. After one minute, the server has responded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/0*V2qOX0_AMEzTU1Xn.png" /></figure><p>As the server was still not responding, it sent a Keep alive header to the server 41 seconds later. The server then responds to maintain life at line 55. after receiving the reply on line 56. Customer sends FIN line 58.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/0*Z3jQzR75w5XHQlyI.png" /></figure><p>This is what happens when we stop the server before it sends a response. Here, the server tries to send a reset packet (20) since the client is attempting to establish a new connection (19). The server’s staff is not present to react.</p><p>When a client fails to deliver a keep-alive header, the server cuts off the connection. If the client didn’t close the connection but the server did. When a client tries to send a message once again, the server returns a RESET packet because the connection has been broken.</p><h3>Reference</h3><p>[1] Krish Dinesh.”Something EVERY Software Engineer must know about HTTP (Demo)” Available: <a href="https://www.youtube.com/watch?v=Yf06faA5-JY&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=bUtIIWbaFKc&amp;t=5s&amp;ab_channel=KrishDinesh</a>. [Accessed: July 20,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88f7b5349317" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Manual Message Acknowledge on Kafka]]></title>
            <link>https://medium.com/@weerakoondilshan.dw/manual-message-acknowledge-on-kafka-cd1abeba23e3?source=rss-4bbae14771e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd1abeba23e3</guid>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Dilhan Theekshana Weerakoon]]></dc:creator>
            <pubDate>Sun, 17 Jul 2022 16:50:30 GMT</pubDate>
            <atom:updated>2022-07-17T16:50:30.479Z</atom:updated>
            <content:encoded><![CDATA[<p>Kafka enables batch processing of messages. Client receives messages in batches and processes them individually. The messages are processed before being committed to Kafka.</p><p>When the messages are delivered and half of them crash, the remaining messages reappear since they weren’t actually sent. Use the auto commit threshold property to avoid this issue. That indicates that it will send the offset back to the server once it has received the specified amount of messages. Every count of messages includes an offset. A different property called auto commit interval is available in the alternative. If it crashed in 150 messages, 500 messages had been received, and the first 100 of those messages had been committed.</p><p>The throughput will be impacted when messages are committed one at a time because Kafka needs to transmit messages and receive commits at the same time. Kafka won’t handle the committing phase automatically if the auto commits equals false.</p><p>It can handle manually when the auto commit is stopped.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/0*R16Z4mqkuv5EVrE1.png" /></figure><p>After receiving the topic, the consumer will split the message by the offset, wrap it, and send it back to the server. The message should be redrew if it crashed while being processed. The promise waits for the designated amount of time.</p><p>If the message crashed in the middle of processing, it will restart from the last successfully processed message while the batch is still being processed. Retry block should be added when the consumer is created to prevent this from happening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*a1YW0h-Q8BZ2Z4lU.png" /></figure><p>The final message to be processed came just before the system crashed. The offset is stopped at 4, yet the offset is sent as 5. The message that is being received next is the one with the most recent offset. Add one to the offset to make it right.</p><p>Another issue is that as you attempt again, new messages will appear on the subject. When a new consumer is added, both attempt to process the most recent message. Because both consumers receive the latest read message. There will be a lag if the previous message is still being processed and new messages are arriving on the subject. Keeping this message in a database is another option. Messages are sent and received based on the most recent message and a property named c.</p><p>There is a procedure that takes five minutes to finish. The session timeout property is present when the consumer creates. It is crucial since the rebalance relies on this. Assume that this lasts 30 seconds. If the heartbeat hasn’t been sent by then, the customer will become estranged from Kafka. The server may not receive a heartbeat if the process takes longer than the session timeout. Increasing the session time out is one solution. However, this causes another issue since if the consumer is dead, the load balancer won’t perform the rebalancing till then. Another is to maintain session length in a consistent range such that the heartbeat can be input from each message. Heartbeat does is communicate the process to the server.</p><p>Make sure not to keep attempting the commit manual and read it till you receive the same warning. The retry can then be ended. If you try again, you must halt until the entire messaging procedure is complete. Make sure the session time out and heartbeat interval are controlled if there are long-running processes.</p><h3>Reference</h3><p>[1] Krish Dinesh.” Guide to Kafka — part 02 (with Demo)| manual ack, heartbeat, batch process” Available: <a href="https://www.youtube.com/watch?v=4HV2N0GKhd8&amp;ab_channel=KrishDinesh">https://www.youtube.com/watch?v=4HV2N0GKhd8&amp;ab_channel=KrishDinesh</a>. [Accessed: June 25,2022].</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd1abeba23e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>