<?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 W Rashmika Lakshan on Medium]]></title>
        <description><![CDATA[Stories by W Rashmika Lakshan on Medium]]></description>
        <link>https://medium.com/@wrlakshan?source=rss-2c6c4b61d316------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jYNXVLXBOiiPtIkhsCwuUA.jpeg</url>
            <title>Stories by W Rashmika Lakshan on Medium</title>
            <link>https://medium.com/@wrlakshan?source=rss-2c6c4b61d316------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 01:01:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wrlakshan/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[AWS Amplify Gen 1 vs. Amplify Gen 2]]></title>
            <link>https://wrlakshan.medium.com/aws-amplify-gen-1-vs-amplify-gen-2-6ca9fbd7b496?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ca9fbd7b496</guid>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Tue, 30 Jul 2024 06:35:31 GMT</pubDate>
            <atom:updated>2024-07-30T06:35:31.896Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ShLJ3z9_y-hw7M4AEEg0g.png" /></figure><p><strong>AWS Amplify </strong>has been a game-changer for developers, simplifying the process of building and deploying full-stack applications. With the introduction of AWS <strong>Amplify Gen 2</strong>, there are significant enhancements and shifts from Gen 1 that developers need to consider. This article will delve into the differences between AWS Amplify Gen 1 and Gen 2, highlighting the key upgrades and migration considerations.</p><h3>Introduction to AWS Amplify Gen 1 🚀</h3><p>AWS Amplify Gen 1 offered a powerful suite of tools that made it easier for developers to connect their front-end applications to AWS cloud services. It included libraries, a CLI, and a console to manage backend services, simplifying the implementation of authentication, API, storage, and serverless functions.</p><h3>Key Features of Gen 1:</h3><ul><li><strong>Auth</strong>: Simplified setup for authentication, including social provider integration.</li><li><strong>API</strong>: GraphQL and REST API integration with real-time capabilities.</li><li><strong>DataStore</strong>: Offline data access and synchronization.</li><li><strong>Storage</strong>: File storage with advanced operations and access control.</li><li><strong>Functions</strong>: Serverless functions with flexible runtime support and local testing.</li></ul><h3>AWS Amplify Gen 2: The Next Evolution 🌟</h3><p>AWS Amplify Gen 2 builds on the feedback from Gen 1 users and introduces a <strong>code-first</strong> development experience. It leverages the AWS <em>Cloud Development Kit (CDK)</em> for backend provisioning and embraces a TypeScript-first approach, eliminating the need for a separate CLI.</p><h3>Key Upgrades in Gen 2:</h3><ul><li><strong>Code-first Developer Experience</strong>: Fullstack TypeScript development with end-to-end types and schema validation.</li><li><strong>Enhanced CI/CD</strong>: Improved automation for deployment processes.</li><li><strong>Sleeker UI</strong>: Intuitive setup and configuration interface.</li><li><strong>DataStore Enhancements</strong>: Better offline support, conflict resolution, and real-time synchronization.</li></ul><h3>When to Use Gen 1 vs. Gen 2 🔄</h3><h3>Use Gen 1 When:</h3><ul><li><strong>Existing Projects</strong>: If you have ongoing projects in Gen 1, it is practical to continue with it until migration tools are fully developed​ .</li><li><strong>Familiarity</strong>: Teams already familiar with Gen 1’s CLI and workflows may prefer to stick with what they know for efficiency.</li><li><strong>Immediate Needs</strong>: If your project requires immediate deployment and the migration process could introduce delays, Gen 1 remains a reliable option.</li></ul><h3>Use Gen 2 When:</h3><ul><li><strong>New Projects</strong>: For new projects, Gen 2 is recommended due to its enhanced capabilities and modern development experience​ ​.</li><li><strong>TypeScript Preference</strong>: If your team prefers or already works extensively with TypeScript, Gen 2’s TypeScript-first approach will be highly beneficial​ .</li><li><strong>Scalability and Future-proofing</strong>: Gen 2 is designed with future scalability in mind, making it a better choice for long-term projects that will grow and evolve over time​.</li><li><strong>Enhanced CI/CD Needs</strong>: Projects that benefit from streamlined CI/CD processes and faster iteration cycles will find Gen 2’s capabilities advantageous​.</li></ul><h3>Comparing AWS Amplify Gen 1 and Gen 2 📊</h3><p>When comparing the two generations, several factors stand out:</p><h3>Architecture:</h3><ul><li><strong>Gen 1</strong>: Relied on the CLI and Studio console for infrastructure setup.</li><li><strong>Gen 2</strong>: Uses a file-based convention for infrastructure as code, enhancing transparency and predictability for developers.</li></ul><h3>Language Support:</h3><ul><li><strong>Gen 1</strong>: Supported multiple programming languages but was more CLI-centric.</li><li><strong>Gen 2</strong>: Expanded client-side language support and exclusively uses TypeScript for backend development​​.</li></ul><h3>Migration:</h3><ul><li><strong>Gen 2</strong>: Requires the use of migration tooling to transition projects from Gen 1 due to significant architectural changes. AWS is actively developing these tools to facilitate the migration process​​.</li></ul><h3>Feature Support:</h3><ul><li><strong>Gen 1</strong>: Provided core features like Auth, DataStore, Storage, and Functions.</li><li><strong>Gen 2</strong>: Continues to support these core features with additional capabilities accessible through the AWS CDK, such as improved modeling of relationships, enhanced auth options, and integration with AI/ML services​​.</li></ul><h3>Migration Considerations 🛠️</h3><p>For developers considering migration from Gen 1 to Gen 2, here are key points to keep in mind:</p><ul><li><strong>Tooling Availability</strong>: AWS is developing migration tools to assist in the transition. Until these tools are fully available, it’s recommended to continue with Gen 1 for existing projects.​</li><li><strong>New Projects</strong>: For new projects, Gen 2 is the recommended choice due to its enhanced capabilities and future-proof architecture.</li></ul><h3>Reference Documents 📚</h3><p>For further reading and detailed documentation, the following resources are invaluable:</p><ul><li><a href="https://docs.amplify.aws/gen1/">AWS Amplify Gen 1 Documentation</a>.</li><li><a href="https://docs.amplify.aws/">AWS Amplify Gen 2 Documentation</a>.</li></ul><h3>Conclusion 🎯</h3><p>Choosing between AWS Amplify Gen 1 and Gen 2 depends on the specific needs of your project and your readiness to adopt a TypeScript-first approach. Gen 2 represents a significant leap forward in terms of developer experience and scalability. Staying informed and adaptable will be key to leveraging the full potential of these powerful tools.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ca9fbd7b496" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simplifying AWS Amplify CI/CD with Automated CodeBuild and CodePipeline Setup]]></title>
            <link>https://wrlakshan.medium.com/simplifying-aws-amplify-ci-cd-with-automated-codebuild-and-codepipeline-setup-26f58944ae4e?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/26f58944ae4e</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[codebuild]]></category>
            <category><![CDATA[amplify]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[codepipeline]]></category>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 04:40:45 GMT</pubDate>
            <atom:updated>2024-03-01T04:40:45.998Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qzvTahIP1tR-iLoU_kzj4g.png" /></figure><h3>Introduction</h3><p>In the rapidly evolving landscape of web development, efficiency and automation in the deployment process are key. AWS Amplify has emerged as a powerful tool for building scalable applications. However, setting up continuous integration and continuous deployment (CI/CD) pipelines manually for each project can be tedious and error-prone. To address this challenge, I’ve developed a solution that leverages AWS CloudFormation to automate the setup of AWS CodeBuild and CodePipeline, streamlining the deployment process for multiple AWS Amplify projects.</p><h3>The Challenge of Manual CI/CD Setup</h3><p>Initially, the process of creating CI/CD pipelines and CodeBuild stages for AWS Amplify projects was performed manually. This approach was not only time-consuming but also increased the risk of human error, leading to inconsistencies across environments and projects.</p><h3>The Automated Solution</h3><p>To overcome these challenges, I devised a method that utilizes CloudFormation templates and shell scripts to automate the creation of CI/CD pipelines and CodeBuild projects. This solution ensures consistency, reduces manual effort, and speeds up the setup process for new and existing projects.</p><h4>Key Components</h4><ul><li>CloudFormation Templates: Defines the infrastructure as code, ensuring that the creation of CodeBuild projects and CodePipeline pipelines is repeatable and consistent.</li><li>Shell Scripts: Facilitates the execution of CloudFormation templates, further automating the setup process.</li></ul><h3>Step-by-Step Guide</h3><ol><li>Preparing CloudFormation Templates: The first step involves creating two CloudFormation templates — one for CodeBuild (codeBuild.json) and another for CodePipeline (codePipeline.json). These templates define the resources and configurations required for building and deploying AWS Amplify projects.</li><li>Executing Shell Scripts: With the templates in place, the next step is to run the shell scripts (codeBuild.sh and codePipeline.sh). These scripts utilize the AWS CLI to deploy the CloudFormation stacks, creating the necessary CodeBuild and CodePipeline resources.</li><li>Automating Multiple Projects: The solution is designed to support multiple repositories and branches, making it scalable for projects of any size. By iterating over a list of repositories and branches, the scripts automatically create a CI/CD pipeline for each combination, significantly reducing the manual effort involved in the setup process.</li></ol><h3>Advantages of the Automated Approach</h3><ul><li>Efficiency: Automates the repetitive tasks involved in setting up CI/CD pipelines, saving valuable time.</li><li>Consistency: Ensures that all projects follow the same setup, reducing the chances of errors.</li><li>Scalability: Easily scales to accommodate more projects or repositories with minimal additional effort.</li></ul><h3>Conclusion</h3><p>The transition from manual to automated setup of CI/CD pipelines for AWS Amplify projects represents a significant leap in operational efficiency. By leveraging AWS CloudFormation and custom shell scripts, developers can now focus more on building great applications rather than being bogged down by the intricacies of pipeline setup.</p><h3>Further Reading</h3><p>For those interested in implementing this solution, visit the GitHub repository at https://github.com/wrlakshan/AWS_Codepeline where you can find the CloudFormation templates and shell scripts used in this approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26f58944ae4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS SQS, SNS, and EventBridge: A Comparative Study]]></title>
            <link>https://wrlakshan.medium.com/aws-sqs-sns-and-eventbridge-a-comparative-study-c48d8dfd1126?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/c48d8dfd1126</guid>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 02:59:11 GMT</pubDate>
            <atom:updated>2024-01-15T05:22:36.133Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rCrR9UNOuuiPfD9YmoeYlg.png" /></figure><p>Amazon Web Services (AWS) offers a variety of message orchestration services, each with its unique features and advantages. Three such services are <strong>Simple Queue Service (SQS)</strong>,<strong> Simple Notification Service (SNS)</strong>, and <strong>EventBridge</strong>. Although they have somewhat similar names, they provide very different functionalities. Let’s delve into each of these services to understand their differences and use cases.</p><h3>AWS Simple Queue Service (SQS)</h3><p>SQS is one of the oldest services developed and launched by AWS. It facilitates the decoupling of applications and enables asynchronous communication between services. Developers can publish messages to a queue, which the consuming application can process either immediately or at a later time.</p><ul><li><strong>Queues:</strong> These are the destinations where messages are published.</li><li><strong>Messages:</strong> These are the content or payload that gets sent to the queue.</li><li><strong>Producers:</strong> These are the applications that send messages to SQS queues.</li><li><strong>Consumers:</strong> These are the applications that read and process messages from SQS queues.</li><li><strong>Visibility Timeout:</strong> This is the period during which a message is invisible to other consumers after it has been read and processed by a consumer.</li><li><strong>Long Polling:</strong> This technique is used to reduce the cost associated with polling SQS queues by requesting messages only when new messages arrive in the queue.</li></ul><h3>AWS Simple Notification Service (SNS)</h3><p>SNS is a fully managed pub/sub messaging service that allows you to <em>fan out </em>push messages from publishers to subscribers. It provides topics for high-throughput, push-based, many-to-many messaging. Using SNS topics, your publisher systems can distribute messages to a large number of subscriber systems including Amazon SQS queues, AWS Lambda functions, and HTTP/S webhooks for parallel processing, and you can even<em> fan out</em> delivery to push endpoints such as mobile devices for direct message delivery.</p><ul><li><strong>Topics:</strong> These are the logical access points and communication channels. Publishers communicate asynchronously with subscribers by sending messages to a topic.</li><li><strong>Messages:</strong> These are the data or payload that gets sent to the topic.</li><li><strong>Publishers:</strong> These are the applications or users that send messages to SNS topics.</li><li><strong>Subscribers:</strong> These are the applications or users that read and process messages from SNS topics.</li><li><strong>Supported Services:</strong> Amazon SNS supports multiple protocols including Amazon SQS, HTTP/S, email, SMS, and AWS Lambda.</li><li><strong>Message Delivery:</strong> Amazon SNS provides message delivery from publishers to subscribers (also known as producers and consumers). Clients can subscribe to the SNS topic and receive published messages using a supported endpoint type.</li></ul><h3>AWS EventBridge</h3><p>EventBridge is a serverless event bus service that makes it easy to connect applications using data from your applications, Software-as-a-Service(SaaS) applications, and AWS services. EventBridge delivers a stream of real-time data from event sources and routes that data to targets like AWS Lambda. You can set up routing rules to determine where to send your data to build application architectures that react in real-time to all of your data sources.</p><ul><li><strong>Event Buses:</strong> These are routers that receive events and deliver them to zero or more destinations, or targets. They are used to route events from many sources to many targets, with optional transformation of events before delivery to a target.</li><li><strong>Events:</strong> In the context of event-driven architecture (EDA), an EventBridge event is a JSON object sent to an event bus or pipe. An event often represents an indicator of a change in a resource or environment.</li><li><strong>Event Sources:</strong> EventBridge can receive events from event sources including AWS services, custom applications, and Software as a Service (SaaS) partners.</li><li><strong>Rules:</strong> A rule receives incoming events and sends them as appropriate to targets for processing. You can specify how each rule invokes its targets based on either an event pattern, which contains one or more filters to match events, or a schedule to invoke the targets at regular intervals.</li><li><strong>EventBridge Scheduler:</strong> This is a serverless scheduler that allows you to create, run, and manage tasks from one central, managed service.</li></ul><h3>When To Use What?</h3><ul><li><strong>SQS</strong> is best suited for asynchronous messaging and decoupling systems.</li><li><strong>SNS</strong> is best suited for real-time messaging and notifications.</li><li><strong>EventBridge</strong> is best suited for real-time event-driven architectures and connecting different services.</li></ul><p>In conclusion, SQS, SNS, and EventBridge are powerful tools provided by AWS. The choice between them depends on your specific use case and requirements. Understanding their differences can help you make an informed decision about which service to use in your application architecture.</p><h3>References</h3><ul><li><a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html">What is Amazon Simple Queue Service?</a></li><li><a href="https://docs.aws.amazon.com/sns/latest/dg/welcome.html">What is Amazon SNS?</a></li><li><a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html">What Is Amazon EventBridge?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c48d8dfd1126" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding AWS Service Limitations: A Comparative Analysis]]></title>
            <link>https://wrlakshan.medium.com/understanding-aws-service-limitations-a-comparative-analysis-3f4184ad7ee0?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f4184ad7ee0</guid>
            <category><![CDATA[eventbridge]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[appsync]]></category>
            <category><![CDATA[api-gateway]]></category>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Tue, 26 Sep 2023 03:44:33 GMT</pubDate>
            <atom:updated>2023-10-16T03:56:56.112Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8eVw-UJ0Jidd5nXJ_I072g.png" /></figure><p>When designing and implementing solutions on Amazon Web Services (AWS), it’s crucial to understand the limitations of various services. This article provides a comparative analysis of the limitations of four AWS services: Lambda, AppSync, API Gateway, and EventBridge.</p><h3>AWS Lambda</h3><p>AWS Lambda is a serverless compute service that lets you run your code without provisioning or managing servers. Here are some key limitations:</p><ul><li><strong>Timeout</strong>: The maximum execution duration per request is 900 seconds (15 minutes).</li><li><strong>Memory Allocation</strong>: You can allocate between 128 MB to 10,240 MB memory to your Lambda function in 1-MB increments. ( Lambda allocates CPU power in proportion to the amount of memory configured)</li><li><strong>Payload Size</strong>: For synchronous invocations, both request and response payloads can be up to 6 MB. 20 MB for each streamed response <em>(Synchronous. The payload size for streamed responses can be increased from default values.)</em> For asynchronous invocations, the payload size is limited to 256 KB.</li><li><strong>Deployment Package Size</strong>: The deployment package size limit is 50 MB for direct upload (zipped) and 250 MB for unzipped files.</li></ul><h3>AWS AppSync</h3><p>AWS AppSync is a managed service that is used to make it easy for applications to get exactly the data they need. Here are its limitations:</p><ul><li><strong>Timeout</strong>: The maximum GraphQL query execution timeout is 30 seconds.</li><li><strong>Payload Size</strong>: The maximum schema document size is 1MB.</li></ul><h3>AWS API Gateway</h3><p>AWS API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. Here are its key limitations:</p><ul><li><strong>Timeout</strong>: For HTTP APIs, the maximum duration for integration timeout is set at 30 seconds. However, for all other types of integrations, which include Lambda, Lambda proxy, HTTP, HTTP proxy, and AWS integrations, the timeout duration can range from as low as 50 milliseconds to as high as 29 seconds when using REST APIs.</li><li><strong>Payload Size</strong>: For REST and HTTP APIs, both request and response payloads can be up to 10MB. For WebSocket APIs, messages sent from the client can be up to 128KB. There’s no limit to messages sent to the client.</li></ul><h3>AWS EventBridge</h3><p>AWS EventBridge is a serverless event bus service that makes it easy to connect applications together using data from your applications, integrated Software-as-a-Service (SaaS) applications, and AWS services. Here are its limitations:</p><ul><li><strong>Timeout</strong>: EventBridge API requests have a 5-second timeout. If the endpoint response exceeds this, EventBridge retries the request based on your retry policy, up to 24 hours and 185 times by default. If all retries fail, the event is sent to a dead-letter queue if available, or dropped.</li><li><strong>Payload Size</strong>: The maximum payload size is 256KB.</li></ul><h3>Conclusion</h3><p>In conclusion, understanding these limitations is crucial when designing solutions on AWS. It helps ensure that your applications are scalable, reliable, and efficient. Remember that some of these limits are soft limits and can be increased by contacting AWS support.</p><h3>References</h3><ul><li><a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html">What is AWS Lambda?</a></li><li><a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html">What is Amazon API Gateway?</a></li><li><a href="https://docs.aws.amazon.com/appsync/latest/devguide/what-is-appsync.html">What is AWS AppSync?</a></li><li><a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html">What Is Amazon EventBridge?</a></li><li><a href="https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-api-destinations.html">API destinations</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f4184ad7ee0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Serverless Computing with AWS Lambda]]></title>
            <link>https://wrlakshan.medium.com/introduction-to-serverless-computing-with-aws-lambda-f8684dbc42c0?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8684dbc42c0</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 04:20:49 GMT</pubDate>
            <atom:updated>2023-09-13T04:20:49.058Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QaBN2eiF_KzV4yDnqhmAmw.png" /></figure><p>Welcome to the first article in our series on AWS Lambda and serverless computing! In this article, we will dive into the fundamental concepts of AWS Lambda, explore the benefits of serverless computing, and understand the core features that make AWS Lambda a powerful tool for building scalable and efficient applications.</p><h3><strong>What is AWS Lambda?</strong></h3><p>AWS Lambda is a groundbreaking compute service offered by Amazon Web Services (AWS) that allows you to run code without the need to provision or manage servers. In a traditional computing environment, developers often spend a significant amount of time managing servers, configuring the operating system, and maintaining infrastructure. However, with AWS Lambda, all of these operational tasks are abstracted away, allowing developers to focus solely on writing code.</p><p>Lambda operates on a high-availability compute infrastructure managed by AWS. It takes care of server and operating system maintenance, capacity provisioning, automatic scaling, code monitoring, and logging. This means you can run your code for various types of applications or backend services without the overhead of managing servers.</p><h3><strong>Benefits of Using AWS Lambda</strong></h3><p>Here are some key benefits of using AWS Lambda:</p><p><em>1. Serverless Execution:</em> Lambda enables you to run your code without the need to provision or manage servers. This reduces operational complexity and allows you to focus on writing code that adds value to your application.</p><p><em>2. Event-Driven Architecture:</em> Lambda is designed around an event-driven architecture. It can automatically execute functions in response to events, such as changes in state, user requests, or updates. This enables real-time processing and responsiveness in your applications.</p><p><em>3. Automatic Scaling:</em> As the number of incoming events increases, Lambda automatically scales to handle the load. This eliminates the need to manually configure scaling settings and ensures optimal performance.</p><p><em>4. Built-in Monitoring and Logging:</em> Lambda integrates seamlessly with Amazon CloudWatch, providing built-in monitoring and logging capabilities. You can easily track the performance of your functions and troubleshoot any issues.</p><h3><strong>Core Features of AWS Lambda</strong></h3><p>Let’s explore the key features that make AWS Lambda an essential tool for serverless computing:</p><ul><li><em>Event-Driven Architectures:</em> In event-driven architectures, events trigger actions and communication between different services. Lambda functions are executed in response to events generated by various AWS services, allowing you to build dynamic and responsive applications.</li><li><em>Lambda Functions:</em> A Lambda function is the code you write and deploy to AWS Lambda. Each function is a self-contained application that can be triggered by events. Functions are designed to be stateless and can be rapidly launched to scale according to incoming event rates.</li><li><em>Event Sources:</em> Lambda can be triggered by a variety of event sources, including Amazon S3 events, DynamoDB streams, Kinesis streams, and Amazon SNS notifications. When an event occurs, Lambda automatically invokes the corresponding function.</li><li><em>Managed Compute Infrastructure:</em> AWS Lambda manages the underlying compute infrastructure, including server maintenance, capacity provisioning, and scaling. This allows you to focus solely on writing code and building features.</li></ul><h3>Conclusion</h3><p>In this introductory article, we’ve explored the core concepts of AWS Lambda and serverless computing. We’ve learned how Lambda abstracts away the complexities of server management, allowing developers to focus on writing code that drives innovation. With its event-driven architecture, automatic scaling, and built-in monitoring, AWS Lambda is a powerful tool for building efficient and responsive applications.</p><p>In the upcoming articles in this series, we will delve deeper into various aspects of AWS Lambda, including how to create and deploy Lambda functions, best practices for writing efficient code, configuring event sources, and monitoring and troubleshooting your serverless applications.</p><p>Stay tuned for the next article, where we will guide you through the process of creating your first Lambda function and triggering it with an event source. Get ready to unlock the full potential of serverless computing with AWS Lambda!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8684dbc42c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling Caching in React Applications]]></title>
            <link>https://wrlakshan.medium.com/handling-caching-in-react-applications-ad807d5d5b16?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad807d5d5b16</guid>
            <category><![CDATA[caching]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 04:16:09 GMT</pubDate>
            <atom:updated>2023-09-13T04:16:09.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3uz7wF3qzP5mHgm73X8GVg.png" /></figure><h3>Introduction</h3><p>Caching is a crucial aspect of web applications, ensuring that users always get the latest version of your app. In this article, we’ll walk you through a step-by-step process for handling caching in a React application.</p><p><strong>Step 1:</strong> Create meta.json and Update package.json</p><ul><li>Create a meta.json file in your public directory. This file will store the build timestamp.</li></ul><pre>{&quot;buildDate&quot;:1693309868000}</pre><ul><li>Create an update-build.js script to update the build timestamp in your package.json and meta.json files. This script will be executed before each build.</li></ul><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;build&quot;: &quot;node ./update-build.js &amp;&amp; GENERATE_SOURCEMAP=false react-scripts build&quot;,<br>  },<br>  &quot;buildDate&quot;: 1693309868000<br>}</pre><p><strong>Step 2:</strong> update-build.js</p><pre>const fs = require(&quot;fs&quot;);<br>const filePath = &quot;./package.json&quot;;<br><br>const packageJson = JSON.parse(fs.readFileSync(filePath).toString());<br>packageJson.buildDate = new Date().getTime();<br><br>fs.writeFileSync(filePath, JSON.stringify(packageJson, null, 2));<br><br>const jsonData = {<br>  buildDate: packageJson.buildDate,<br>};<br><br>const jsonContent = JSON.stringify(jsonData);<br><br>fs.writeFile(&quot;./public/meta.json&quot;, jsonContent, &quot;utf8&quot;, function (error) {<br>  if (error) {<br>    console.log(&quot;An error while saving build date and time to meta.json&quot;);<br>    return console.log(error);<br>  }<br><br>  console.log(&quot;Latest build date and time updated in meta.json file&quot;);<br>});</pre><p><strong>Step 3:</strong> Cache Checker Function</p><ul><li>Create a <em>cacheChecker.js</em> module to handle cache checking. This function will compare the build timestamps from <em>meta.json</em> and package.json and determine if a cache refresh is needed.</li></ul><pre>import packageJson from &quot;../../package.json&quot;;<br><br>const { DateTime } = require(&quot;luxon&quot;);<br><br>export function cacheChecker() {<br>  fetch(&quot;/meta.json&quot;)<br>    .then((response) =&gt; response.json())<br>    .then((meta) =&gt; {<br>      const latestVersionDate = meta.buildDate;<br>      const currentVersionDate = packageJson.buildDate;<br><br>      const shouldForceRefresh = latestGreaterThanCurrent(latestVersionDate, currentVersionDate);<br><br>      console.log(`Current Build ${getBuildDate(currentVersionDate)}`, null);<br>      console.log(`Latest Build ${getBuildDate(latestVersionDate)}`, null);<br><br>      if (shouldForceRefresh) {<br>        refreshCacheAndReload();<br>      }<br>    });<br>}<br><br>const refreshCacheAndReload = () =&gt; {<br>  if (caches) {<br>    // Service worker cache should be cleared with caches.delete()<br>    caches.keys().then((names) =&gt; {<br>      for (const name of names) {<br>        caches.delete(name);<br>      }<br>    });<br>  }<br>  window.location.reload(true);<br>};<br><br>const latestGreaterThanCurrent = (latestDate, currentDate) =&gt; {<br>  const latestBuildDateTime = DateTime.fromMillis(latestDate);<br>  const currentBuildDateTime = DateTime.fromMillis(currentDate);<br><br>  return latestBuildDateTime &gt; currentBuildDateTime;<br>};<br><br>const getBuildDate = (epoch) =&gt; {<br>  const buildDate = DateTime.fromMillis(epoch).toLocaleString(DateTime.DATETIME_MED);<br>  return buildDate;<br>};</pre><p><strong>Step 4:</strong> Use <em>useEffect </em>in app.js</p><ul><li>In your main app.js file, import and use the <em>cacheChecker </em>function within a <em>useEffect </em>hook to check the cache when the component mounts.</li></ul><pre>import React, { useEffect } from &quot;react&quot;;<br>import { cacheChecker } from &quot;./path-to-cacheChecker&quot;;<br>function App() {<br> useEffect(() =&gt; {<br> cacheChecker();<br> return () =&gt; {};<br> }, []);<br>// Your React component code here<br>return (<br> &lt;div&gt;<br> {/* Your app content */}<br> &lt;/div&gt;<br> );<br>}<br>export default App;</pre><p>Conclusion:<br>By following these steps, you can effectively handle caching in your React application. The meta.json and update-build.js approach ensures that users receive the latest version of your app whenever you make updates, improving the overall user experience.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad807d5d5b16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embracing the Future: Mastering the Serverless Mindset]]></title>
            <link>https://wrlakshan.medium.com/embracing-the-future-mastering-the-serverless-mindset-dfd128d9417c?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfd128d9417c</guid>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 05:24:35 GMT</pubDate>
            <atom:updated>2023-09-01T05:24:35.737Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h0IJM__0O7FtnWM1KoEBPw.png" /></figure><p>In the world of modern software architecture, the term “<em>serverless”</em> has gained significant traction. But what does it really mean to adopt a serverless mindset? How does it change the way we approach building, deploying, and managing applications? This article delves into the core concepts of serverless architecture, explores its benefits, and guides you through the transition to this transformative approach.</p><h3>Understanding the Evolution of Architectures</h3><p>Traditionally, building web applications meant managing servers, configuring infrastructure, and dealing with scalability challenges. However, the advent of serverless architecture has shifted this paradigm, allowing developers to focus more on their application’s unique logic and less on infrastructure management.</p><h3>The Building Blocks of Serverless</h3><p>Imagine a web service where clients interact with your application over HTTP. This is the starting point for our exploration. Initially, you might deploy a web application on a single server, but as traffic grows, you’ll need to scale horizontally using load balancers to handle the load effectively.</p><p>This is where serverless enters the picture. Instead of worrying about provisioning, managing, and scaling servers, you can leverage cloud services like AWS Lambda. Lambda abstracts away the underlying infrastructure, allowing you to focus solely on code execution. Events, such as HTTP requests or database changes, trigger Lambda functions, executing your business logic.</p><h3><strong>Benefits of a Serverless Approach</strong></h3><p>The serverless mindset offers four key benefits:</p><ol><li><strong><em>No Server Management:</em></strong> With serverless, you don’t need to manage servers, operating systems, or patches. Cloud providers handle these concerns, freeing you to focus on code.</li><li><strong><em>Flexible Scaling:</em></strong> Serverless services automatically scale based on demand, and you only pay for what you use. This contrasts with traditional scaling models that require over-provisioning.</li><li><strong><em>Automated High Availability:</em></strong><em> </em>Serverless architectures inherently distribute across multiple availability zones, ensuring high availability and fault tolerance without manual intervention.</li><li><strong><em>Cost Efficiency:</em></strong> Pay only for the compute resources consumed during execution. No more idle servers and no capacity planning headaches.</li></ol><h3>Transitioning to the Serverless Mindset</h3><p>To truly embrace serverless, shift your perspective from managing infrastructure to handling events. Think about your application as a collection of event-driven components that interact seamlessly.</p><ul><li><strong><em>Leverage Managed Services:</em></strong> Embrace managed services for different parts of your application, such as Amazon API Gateway for RESTful APIs, DynamoDB for data storage, and AWS Step Functions for orchestration.</li><li><strong><em>Parallelization for Performance:</em></strong> Serverless makes parallelization easier and more cost-effective. Break down tasks into smaller units and execute them in parallel using services like AWS Lambda.</li><li><strong><em>Provision Environments Efficiently:</em></strong> Automate the provisioning of environments, making it easier to create replicas of your application for development, testing, and staging. Use tools like AWS SAM for streamlined deployment.</li></ul><h3>Realizing the Serverless Vision</h3><p>Transitioning to a serverless mindset offers substantial advantages. By offloading infrastructure management and focusing on event-driven development, you unlock greater agility, reduced costs, and accelerated time-to-market. Embrace serverless tools like AWS Lambda and managed services, and use parallelization to improve performance. Automate deployments for consistent and efficient environment provisioning. This shift empowers developers to concentrate on building features that directly impact the business, rather than wrestling with infrastructure intricacies.</p><blockquote>Serverless Mindset -</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DAXlFVl4MZY9pvFiVkDmAg.png" /><figcaption><a href="https://docs.aws.amazon.com/images/serverless/latest/devguide/images/traditional-webdev-complex.png">https://docs.aws.amazon.com/images/serverless/latest/devguide/images/traditional-webdev-complex.png</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U6EXYbV6U9KGQojUtMK-vA.png" /><figcaption><a href="https://docs.aws.amazon.com/images/serverless/latest/devguide/images/serverless-conceptual.png">https://docs.aws.amazon.com/images/serverless/latest/devguide/images/serverless-conceptual.png</a></figcaption></figure><p>An image depicting the transition from traditional architecture to the serverless mindset.</p><h3>Conclusion</h3><p>Serverless architecture isn’t just about a technology shift; it’s about transforming how we think about building applications. By adopting a serverless mindset, developers can focus on delivering value to users while leaving infrastructure concerns to cloud providers. The serverless approach amplifies the benefits of cloud computing, enabling flexible scaling, reducing operational complexity, and accelerating time-to-market. Embrace the event-driven nature of serverless, leverage managed services, and explore parallelization to maximize the potential of this revolutionary architecture.</p><h3>References</h3><ul><li><a href="https://docs.aws.amazon.com/serverless/latest/devguide/serverless-shift-mindset.html">Shifting to serverless</a></li><li><a href="https://docs.aws.amazon.com/serverless/latest/devguide/serverless-transition.html">Transitioning to event-driven architecture</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfd128d9417c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing AWS Lambda Memory Allocation: A Comprehensive Guide]]></title>
            <link>https://wrlakshan.medium.com/optimizing-aws-lambda-memory-allocation-a-comprehensive-guide-8e61ed71e000?source=rss-2c6c4b61d316------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e61ed71e000</guid>
            <dc:creator><![CDATA[W Rashmika Lakshan]]></dc:creator>
            <pubDate>Fri, 31 Mar 2023 16:48:42 GMT</pubDate>
            <atom:updated>2023-04-06T03:58:46.381Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*223lBHCWovU0_vTN" /><figcaption>Photo by <a href="https://unsplash.com/pt-br/@chrisliverani?utm_source=medium&amp;utm_medium=referral">Chris Liverani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>AWS Lambda is a popular serverless computing service that allows you to run code without the need to provision or manage servers. One of the key benefits of using Lambda is its ability to automatically scale resources based on workload. However, to achieve optimal performance and cost-effectiveness, it is important to optimize the memory allocation of your Lambda functions. In this guide, we will explore various methods for optimizing AWS Lambda memory allocation.</p><h3><strong>Why Optimize AWS Lambda Memory Allocation?</strong></h3><p>Memory allocation plays a crucial role in the performance and cost of AWS Lambda functions. Memory is one of the primary resources allocated to a Lambda function, along with CPU time and network resources. The amount of memory allocated to a function determines the amount of CPU and network resources allocated as well.</p><p>By optimizing memory allocation, you can achieve the following benefits:</p><ul><li>Improved performance: Allocating the right amount of memory can improve the performance of your Lambda functions by allowing them to process more data in less time.</li><li>Lower costs: By allocating only the necessary amount of memory, you can reduce the cost of running your Lambda functions.</li></ul><h3><strong><em>Method 1: AWS Compute Optimizer</em></strong></h3><p>AWS Compute Optimizer is a service that provides recommendations for optimising the configuration of your AWS resources, including Lambda functions. Compute Optimizer uses machine learning algorithms to analyze the performance metrics of your resources and provides recommendations for the optimal configuration.</p><p>To use Compute Optimizer for optimizing Lambda memory allocation, follow these steps:</p><ol><li>Enable Compute Optimizer for your AWS account.</li><li>Configure Compute Optimizer to analyze the performance metrics of your Lambda functions.</li><li>Review the recommendations provided by Compute Optimizer and adjust the memory allocation of your Lambda functions accordingly.</li></ol><p>Compute Optimizer can provide recommendations for the optimal memory allocation based on the workload of your Lambda functions. This method can be effective for optimizing memory allocation, as it uses machine learning algorithms to provide intelligent recommendations based on the actual workload of your functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l39xlM68BAj1zLOxJRt5kA.png" /><figcaption>Figure 1.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uq6Nig7b_eZHi0yxyRpOAg.png" /><figcaption>Figure 1.2</figcaption></figure><h3><strong><em>Method 2: AWS Lambda Power Tuning State Machine</em></strong></h3><p>AWS Lambda Power Tuning is a state machine that is available in the AWS Serverless Application Repository. The state machine uses AWS Step Functions to automate the process of optimizing Lambda memory allocation.</p><p>To use Lambda Power Tuning for optimizing Lambda memory allocation, follow these steps:</p><ol><li>Deploy the Lambda Power Tuning state machine from the AWS Serverless Application Repository.</li><li>Configure the state machine to analyze the performance metrics of your Lambda functions.</li><li>Run the state machine to optimize the memory allocation of your Lambda functions.</li></ol><p>Lambda Power Tuning uses a variety of memory allocations to test your Lambda function’s performance and provide recommendations for the optimal configuration. This method can be effective for optimizing memory allocation, as it automates the process of testing and optimizing the configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L4Pf-EDB6OCgw10V68ZLfw.png" /><figcaption>Figure 2.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h26Q3G-BuV3HUgD9HIrKFw.png" /><figcaption>Figure 2.2</figcaption></figure><h3><strong><em>Method 3: Manual Testing and Optimization</em></strong></h3><p>Another method for optimizing AWS Lambda memory allocation is to perform manual testing and optimization. This involves analyzing the performance metrics of your Lambda functions and adjusting the memory allocation manually based on the workload.</p><p>To use manual testing and optimization for optimizing Lambda memory allocation, follow these steps:</p><ol><li>Monitor the performance metrics of your Lambda functions, such as the duration and memory usage.</li><li>Gradually increase or decrease the memory allocation and monitor the performance metrics to determine the optimal configuration.</li><li>Adjust the memory allocation as needed based on changes in the workload.</li></ol><p>Manual testing and optimization can be effective for optimizing memory allocation, but it can also be time-consuming and may require significant trial and error to find the optimal configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXBsrB3tQdKZ3Qx-iDROHQ.png" /><figcaption>Figure 3.1</figcaption></figure><h3><strong><em>Method 4: Third-Party Optimization Tools</em></strong></h3><p>There are several third-party optimization tools available for AWS Lambda that can help to optimize memory allocation. These tools use machine learning algorithms and performance metrics to provide recommendations for the optimal memory allocation of your Lambda functions.</p><p>Some popular third-party optimization tools for AWS Lambda include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*SkOxO72C-SmAsgI9kutmzQ.png" /></figure><blockquote><a href="https://aws.amazon.com/marketplace/pp/prodview-eth4xzn4llfiu">Lumigo<em>:</em></a> Lumigo is a cloud monitoring and observability platform that provides insights into the performance of your AWS resources, including Lambda functions. Lumigo can provide recommendations for optimizing memory allocation based on the performance metrics of your functions.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*gYWvLkNMFikyNV77AZvjNg.png" /></figure><blockquote><a href="https://aws.amazon.com/solutionspace/solutions/thundra/">Thundra:</a> Thundra is an application performance monitoring platform for serverless applications. Thundra can provide insights into the performance of your Lambda functions and can recommend optimal memory allocation based on the performance metrics.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*oExGjioRKCdXJiB2D1RaOw.png" /></figure><blockquote><a href="https://aws.amazon.com/retail/partner-solutions/epsagon/">Epsagon</a>: Epsagon is a distributed tracing and monitoring platform for serverless applications. Epsagon can provide insights into the performance of your Lambda functions and can recommend optimal memory allocation based on the performance metrics.</blockquote><p>Third-party optimization tools can be effective for optimizing memory allocation, as they use machine learning algorithms and performance metrics to provide intelligent recommendations. However, these tools may come with additional costs and may require integration with your AWS account.</p><h3>Conclusion</h3><p>Optimizing memory allocation is an important aspect of achieving optimal performance and cost-effectiveness for your AWS Lambda functions. By using AWS Compute Optimizer, Lambda Power Tuning state machine, manual testing and optimization, or third-party optimization tools, you can achieve the optimal memory allocation for your Lambda functions. Each method has its own advantages and disadvantages, so it is important to choose the method that best suits your needs and requirements.</p><h3>References</h3><ul><li><a href="https://github.com/alexcasalboni/aws-lambda-power-tuning">GitHub - alexcasalboni/aws-lambda-power-tuning: AWS Lambda Power Tuning is an open-source tool that can help you visualize and fine-tune the memory/power configuration of Lambda functions. It runs in your own AWS account - powered by AWS Step Functions - and it supports three optimization strategies: cost, speed, and balanced.</a></li><li><a href="https://serverlessrepo.aws.amazon.com/applications/us-east-1/451282441545/aws-lambda-power-tuning">Application Search - AWS Serverless Application Repository</a></li><li><a href="https://docs.aws.amazon.com/lambda/latest/operatorguide/profile-functions.html">Profiling functions with AWS Lambda Power Tuning</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e61ed71e000" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>