<?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 Fabian Lober on Medium]]></title>
        <description><![CDATA[Stories by Fabian Lober on Medium]]></description>
        <link>https://medium.com/@fabian_lober?source=rss-3b2e680e5103------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Lg7CH_4gEYDaxIBng3AS8A.png</url>
            <title>Stories by Fabian Lober on Medium</title>
            <link>https://medium.com/@fabian_lober?source=rss-3b2e680e5103------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:44:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fabian_lober/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[The Second Half — 10 Years of Lambda and Beyond (2)]]></title>
            <link>https://medium.com/@fabian_lober/the-second-half-10-years-of-lambda-and-beyond-2-d58171dcead6?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/d58171dcead6</guid>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cost-optimization]]></category>
            <category><![CDATA[technology-strategy]]></category>
            <category><![CDATA[serverless-computing]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Mon, 16 Dec 2024 15:45:30 GMT</pubDate>
            <atom:updated>2024-12-16T15:45:30.177Z</atom:updated>
            <content:encoded><![CDATA[<p>A few days ago, I had the privilege of speaking at the <strong>re:Invent Watch Party in Helsinki</strong>, where I presented a talk titled <em>“10 Years of Lambda: The Evolution, Impact, and Future of Serverless.”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9Xy68OOb0i3W0yND4WI7w.png" /><figcaption>Left behind with a cliffhanger</figcaption></figure><p>While the session was filled with stories, insights, and lessons learned over the past decade, I faced a common challenge: <strong>time</strong>. I could only deliver the first half of my planned content, <strong>leaving the rest untold.</strong></p><p>This blog post is my way of sharing the second half with all of you — whether you joined live or just read the first part of this series! A full recording of the talk will also be available soon!</p><p>In Helsinki, I left you with a cliffhanger. I noticed your faces; you didn’t seem too pleased about it. For those who don’t know, it was about how we ended up in my bedroom after discussing the evolution of serverless technology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OjoUiqO1p8VDeeBZ" /><figcaption>Sorted by type not matching outfit</figcaption></figure><p><strong>Imagine this:</strong></p><p>It’s early morning, and I’m staring blankly in front of my closet.</p><p>I’m trying to decide what to wear but can’t figure out what pairs well together.</p><ul><li>Should I wear this jacket with this shirt?</li><li>Which pants go best?</li><li>What coat is appropriate for this outfit and the weather?</li><li>And what about shoes and a belt?</li></ul><p>And on days when coffee hasn’t fully kicked in, it feels even slower — and sometimes, I get it wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XwktVUdo8GvUeOLZnpBUBA.png" /><figcaption>Dressing gone wrong — Luckily not me</figcaption></figure><p>With more items and types in my closet, it takes longer and becomes more complex. Typically, they’re grouped by type: T-shirts, shirts, pants, and jackets.</p><blockquote><strong>Here’s a little secret: </strong>I’ve started using a Notion page with categorized images of combinations to make pairing items easier.</blockquote><p>AWS services are similar. They are organized into categories such as Compute (EC2, Lambda, Fargate) and Databases (RDS, DynamoDB, Aurora).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWnf1EsE9AyrDSeMvJBf6Q.png" /><figcaption>Example AWS Services grouped by category</figcaption></figure><p>However, building something is about more than just understanding these categories.</p><p>It’s about understanding:</p><ul><li>Are certain combinations even possible?</li><li>Are there prerequisites or additional steps required?</li><li>What works well together?</li><li>What are the trade-offs of using this pairing versus another?</li><li>Can this setup be optimized, or is there a better alternative?</li></ul><p>As I was recently reminded while building a foundational workshop for a client, there is much to consider when making these decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RaY5tpnWzi_-2bp1KaIqnw.png" /></figure><p>The complexity doesn’t hit you immediately when using a single service. Still, as your system expands and becomes more distributed, the gaps in understanding will become more pronounced — especially when experimenting with tools like AWS SAM, which provides high-speed access to complex, distributed systems.</p><blockquote>Speed is a double-edged sword.</blockquote><p>While a rapid setup can be a blessing, it also presents challenges. Although it accelerates development, it demands a deeper understanding of how all the components connect.</p><blockquote><strong>Don’t Wear Joggers When a Suit Is Appropriate</strong></blockquote><p>In my talk’s introduction, I boldly proposed changing the practice of introducing speakers by having the audience participate in the introduction instead.</p><p>This idea relates directly to our clothing example: Knowing where you are going and what to expect will help you determine what to wear, whether sports attire, business casual, formal evening wear, or something comfortable for a casual meetup.</p><p>This statement emphasizes the importance of understanding your customers. While this has always been crucial, it is becoming even more essential today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PPIVlKZYrhqnRbrJDr-G3Q.png" /><figcaption>A Overwhelming Amount of Choices can Lead to Wrong Decisions</figcaption></figure><p>With so many choices available, we face increased complexity in many areas. It’s not just about the technical aspects; understanding the business perspective is even more important than the technical details.</p><p>While evaluating technical options immediately is tempting, the first step should not be considering what you can or cannot do. Instead, always begin by asking what needs to be achieved and why.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jfaK7vm2aazRsyDECE3N2w.png" /><figcaption>The Why — Don’t fall Into the Tech Rabit Hole</figcaption></figure><p>For example:</p><ul><li>Are you trying to reduce costs?</li><li>Do you need to improve user experience with faster response times?</li><li>Are you aiming to scale seamlessly to meet unpredictable demands?</li></ul><p>This approach focuses on the business perspective, ensuring that later technical decisions align with the desired outcomes.</p><p>To do this effectively, think top-down, similar to the C4 Model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-SN6lAeF98aa9OP_zhviw.png" /><figcaption>Breaking it down top-down will build a solid foundation</figcaption></figure><p>Start with the big picture:</p><ul><li>What’s the system supposed to achieve?</li><li>How does it fit within your organization’s goals?</li><li>How will it interact with users or other systems?</li><li>Understanding this gives you a clear direction before diving into specifics.</li></ul><p>Once you know the big picture, consider what types of services can help you meet your objectives.</p><ul><li>Will serverless work best for your needs?</li><li>Do you need containers for more control or predictable workloads?</li><li>Is a managed database the right fit? NoSQL or SQL?</li></ul><p>This step narrows down the possible options.</p><p>Next, break things down further to the individual building blocks:</p><ul><li>Should you use Lambda or Fargate?</li><li>How does NoSQL (DynamoDB, OpenSearch, Neptune) compare to relational (RDS, Aurora) for your specific use case?</li></ul><p>At this level, you weigh trade-offs — benefits, challenges, and how well these options align with your goals.</p><p>Finally, zoom in on the implementation details:</p><ul><li>Which programming languages or frameworks will you use?</li><li>What configurations or specific optimizations will ensure the system performs as expected?</li></ul><p>By working through these levels systematically, you ensure that every decision is grounded in what matters most — your objectives — before getting caught up in the technical details rabbit hole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*xWQUA3OJMiEt7uVybzIuTA.png" /><figcaption>Trade-Offs presented by Peter DeSantis in 2023 on his reInvent Keynote</figcaption></figure><p>It’s important to remember that any of these decisions come with trade-offs!</p><p>For instance, choosing a serverless architecture might reduce operational overhead and enhance scalability. Still, it can also lead to challenges such as increased latency during infrequent invocations or limited customization options for the runtime environment.</p><p>On the other hand, opting for containers offers flexibility but adds complexity in terms of management and scaling.</p><p>Like cooking, where you don’t create a meal using only salt or flour, you must combine various ingredients to achieve the best balance for your needs.</p><blockquote>The best meals come from carefully chosen ingredients, balanced to perfection.</blockquote><p>Similarly, it’s crucial to adapt and integrate different solutions. The goal isn’t to take an extreme stance in one direction or the other; instead, it’s about selecting the best solution tailored to your specific requirements.</p><p>This involves balancing flexibility, cost, and performance to maximize value for your business and users.</p><p>The best results often come from combining approaches.</p><ul><li>Use serverless for front-end processing or short event-driven workflows.</li><li>Opt for containers for backend tasks requiring more control, predictable workloads, or when longer execution time is needed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_dbRnmlxQDtKGZfi7ck6w.png" /><figcaption>To cook a great meal you need more than flour or salt!</figcaption></figure><p>Speaking of ingredients, there’s another one in this equation that often stirs up debate: <strong>cost</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBMEndhVbaQffOF0sgki9A.png" /><figcaption>Cost is the elephant in the room, an essential factor in every decision.</figcaption></figure><p>While the <strong>advantages and benefits of serverless or hybrid approaches are clear and impactful</strong>, they don’t always translate directly into monetary terms.</p><p>At first glance, <strong>these solutions might seem more expensive</strong>, but this is often because of the visible costs — the per-usage price in a typical time range is <strong>higher</strong> than traditional models — while the long-term efficiencies might take time. Simply adjusting our perspective can reveal the truth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bs9P1l0bd8NOH6JU5h7VYw.png" /><figcaption>Wrongly compared Lambda will always be more expensive</figcaption></figure><p>A t2.small (2GB) compared to Lambda (2GB) in a 720-hour​​ timeframe will always be dramatically cheaper, but only without considering the minimum billing interval and our usage pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYh_tS2Z0FNrSdbAcOQ9Ow.png" /><figcaption>Wisely used Lambda is dramatically cheaper than EC2</figcaption></figure><p>The nature of cloud services complicates this perception even further. Determining total costs isn’t as straightforward as adding up the price of a rack, four servers, and storage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rucp3eHqD8aBp1xyB3_epg.png" /><figcaption>Cloud Budgets are not moe than summing up a few price tags</figcaption></figure><p>Instead, we’re dealing with a dynamic environment that requires a different approach to budgeting and evaluation.</p><p>We need a solid framework for understanding and estimating costs to tackle this complexity.</p><p>Let’s start with a base fee — the cost of running your application even when not in use.</p><ul><li>That could be your master control plane running in Kubernetes or the RDS database instance for your application master data.</li><li>This includes indirect non-application-related services, such as security tools, CloudTrail logs, audit log archives, etc.</li></ul><p>In addition to the base fee, dynamic factors that fluctuate based on usage must be incorporated.</p><p>These dynamic factors should be categorized into a unit, such as per user, per checkout, per device, per tenant, or any other relevant metric, depending on your specific situation.</p><p>It could also be a combination, for example, devices and tenants.</p><p>It’s essential to break down your usage and costs for these units as well as possible.</p><h4><strong>Simplified Example Scenario</strong></h4><p>Let’s say you’re building a service that processes data from IoT devices:</p><ul><li><strong>Base Costs</strong>: The control plane running on Kubernetes and a DynamoDB table for metadata storage.</li><li><strong>Dynamic Costs</strong>: Data ingestion and storage in S3, messaging via SQS, and real-time processing using Lambda.</li></ul><p>Furthermore, it’s crucial to recognize that the base fee often increases with the system’s load.</p><p>This is because most services or applications you build have a limit on the amount of usage they can effectively manage until they need more resources.</p><p>For example, your control plane running on Kubernetes scales after ten new tenants are added, the RDS database requires a larger instance as the volume of queries increases, or the master data grows with more users.</p><p>Planning for these variables allows you to establish a solid budget and reuse this information in pricing calculations.</p><blockquote>Perfection is the enemy of progress.</blockquote><p>However, you will never be able to make your budget perfectly accurate, and if you spend more time calculating than actually improving it, it may not be worth it.</p><p>Factor in the uncertainty instead. To account for this, include a variability factor in your budget calculations, best case per service per usage type, or how you have bundled it.</p><p>For example, if we are unsure how much data the IoT device will submit per month, or the size of the messages, we can add a factor or percentage, 0.8 to 1.2.</p><p>Ideally, you can relate your expenses to your revenue. As your revenue increases, your costs will rise, and vice versa. By this, you avoid a margin compression over time — leading to pressure-reducing costs.</p><p><strong>Let me give you two contrary examples here:</strong></p><p>As the company sells more IoT devices, the costs scale with the number of connected devices sending data, but we also generate revenue per device through monthly subscriptions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x962m0VmyA5kFBpAgdxNpQ.png" /><figcaption>Revenue and Costs are running mostly parallel</figcaption></figure><p>The opposite would be an NFT online shop replicating blockchain data to hot storage and search services. Due to the infrastructure requirements (no archive, no cold storage), expenses rise continuously as the data volume increases and remain high even during periods of low revenue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S68xVPBFqD5xTiVPbjAD8w.png" /><figcaption>Revenue and Costs are evolving completly different</figcaption></figure><blockquote>“The only thing that is constant is change.” — Heraclitus.</blockquote><h4>Evolve your Architecture over Time and Needs</h4><p>Change will be necessary someday, even if you follow all the steps for thoughtful planning, decisions, and budgeting.</p><p><strong>Then, don’t be shy — be open to revisiting and reconsidering your decisions.</strong></p><p>Let’s take a typical but simplified example to illustrate this point:</p><p><strong>The Beginning</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l0sqEJe9eqzPWDx_3XEn1Q.png" /></figure><p>Initially, you expected one service in your product to process small JSON data files (just a few hundred lines) a few times an hour or maybe a day. The Lambda function worked beautifully. It was cost-efficient, quick, and required minimal resources, making it seem like the perfect solution.</p><p><strong>The Shift Over Time</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A2I2FRURcWy8Hxfo-0rglg.png" /></figure><p>As your product grew:</p><ul><li>Requests increased in frequency.</li><li>Files became larger.</li><li>A new data provider added leads to even more and different inputs to process.</li></ul><p>Suddenly, the Lambda function started running much more frequently, using more memory, leading to higher costs and sometimes even experiencing timeouts because it exceeded the 15-minute limit.</p><p><strong>The Options</strong></p><p>Now you face three choices:</p><ul><li>Leave it as is: Stick with Lambda, even with the drawbacks and issues. (Amazing idea!)</li><li>Extract functionality: Offload parts of the processing to another service.</li><li>Move entirely: Transition all processing to a different service.</li></ul><p>While leaving it unchanged might seem tempting — after all, it worked before — it’s not sustainable.</p><p>One solution could be to move everything to Amazon ECS with AWS Fargate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DGYRqa0vlkzXprB3AofAHA.png" /></figure><p>However, we should also consider whether all of our data events need immediate processing, and a more thoughtful solution might involve splitting workloads:</p><ul><li>Use AWS Batch to process larger, scheduled data files.</li><li>Retain Lambda for real-time handling.</li><li>Migrate heavier or long-running tasks to ECS with Fargate,</li><li>And even optimize API-related processing using AWS Service Integrations in API Gateway</li></ul><blockquote>Know your audience to deliver what matters.</blockquote><p>Ultimately, it’s essential to understand our audience, their needs, and priorities!</p><h3>Stay Tuned for More</h3><p>This post is just the second half of my talk. For those who joined me in Helsinki, I hope it fills in the gaps. And for everyone else, I already posted the first half of the session, covering Lambda’s &amp; Serverless Evolution over the past decade.</p><p>The full recording will be released soon. Until then, let’s keep the conversation going — connect with me on<a href="http://www.linkedin.com/in/fabianlober"> LinkedIn</a> or follow my blog on<a href="https://medium.com/@fabian_lober"> Medium</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d58171dcead6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[10 Years of AWS Lambda — The Evolution, Impact, and Future of Serverless (1/2)]]></title>
            <link>https://medium.com/@fabian_lober/10-years-of-aws-lambda-the-evolution-impact-and-future-of-serverless-1-2-0da1e86a9dae?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/0da1e86a9dae</guid>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[cloud-history]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless-computing]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 09:16:54 GMT</pubDate>
            <atom:updated>2024-12-10T09:16:54.573Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>10 Years of AWS Lambda — The Evolution, Impact, and Future of Serverless (1/2)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TGEiqv8xivHwpvotAgExhA.png" /><figcaption>A Journey Worth Celebrating!</figcaption></figure><p>AWS Lambda is turning 10 this year, marking a decade of revolutionizing how we think about computing. Since its preview launch in 2014, Lambda has become synonymous with serverless architecture, transforming workflows, reducing costs, and empowering developers to focus on code rather than infrastructure.</p><p>This blog dives into Lambda’s evolution and its transformative impact on modern computing. It is based on my recent talk, <strong>“10 Years of Lambda — The Evolution, Impact, and Future of Serverless,”</strong> presented in Helsinki on the re:Invent Watch Party.</p><p>Unfortunately, due to time constraints, I had to divide my talk into two parts. In this blog post, I will explore the first half of the talk in greater detail, providing insights for those who couldn’t attend live or prefer reading it. If you were present, you might feel like you were left hanging with a cliffhanger, but don’t worry — a follow-up post covering the second half, along with a complete recording of the talk, will be coming soon!</p><h3>2014</h3><p>The year, as it all began, was pivotal in many ways:</p><ul><li><strong>Germany defeated Brazil 7–1</strong> in the FIFA World Cup semifinals, which shocked the (soccer) world.</li><li>Marvel introduced us to <strong>Guardians of the Galaxy</strong>, a film that redefined superhero storytelling with humor and a killer soundtrack.</li><li><strong>DynamoDB</strong> turned two, solidifying its place as a foundational cloud database service.</li><li><strong>DynamoDB Streams</strong> was released — I would have lost every bet on this!</li></ul><p>Amid these events, on AWS re:Invent, Dr. Tim Wagner presented <strong>MBL202</strong>, titled <strong>“NEW LAUNCH: Getting Started with AWS Lambda”</strong> — where he gave us the first deeper insights and even a live demo!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*whApec3_vN9MCJfw" /><figcaption>MBL202 — NEW LAUNCH: Getting Started with AWS Lambda</figcaption></figure><p><em>[1] — </em><a href="https://www.youtube.com/watch?v=UFj27laTWQA"><em>https://www.youtube.com/watch?v=UFj27laTWQA</em></a><em> — (MBL202) NEW LAUNCH: Getting Started with AWS Lambda</em></p><p>Though it launched as a preview, Lambda’s impact was immediate and far-reaching. Even when it came with several constraints:</p><ul><li><strong>Runtime</strong>: Node.js was the only supported language.</li><li><strong>Execution Limits</strong>: Functions had a maximum runtime of 60 seconds.</li><li><strong>Concurrency</strong>: Only 25 concurrent requests were allowed per account.</li><li><strong>Memory</strong>: Configurable from 128 MB to 1024 MB in 64 MB increments.</li></ul><p>By today’s standards, these limits seem very restrictive. However, they sparked creativity, encouraging developers to build small, efficient, and event-driven workloads.</p><p><strong>Jeff Barr captured it perfectly in his 2014 Lambda release blog post:</strong></p><blockquote><strong><em>“You can do a lot of work in a couple of seconds.” — Jeff Barr</em></strong></blockquote><p>In fact, We should remind ourselves of that more often, even today, with execution costs lower than ever.</p><p><strong>Fun Fact: Lambda cost still the same since 2014 (for x86 in us-east-1)</strong></p><p>Despite these constraints, Lambda’s 100 ms billing interval and generous free tier made it a compelling choice.</p><h3>Built for one use case — but which?</h3><p>With a primary focus on Node.js, the 60-second execution limit, the close integration with S3 and DynamoDB, and the inclusion of libraries like ImageMagick, it’s evident that it was specifically designed for a lightweight, event-driven workload.</p><p>But what exactly is that workload?</p><p>In fact, I suspect — though I can’t confirm this — that Lambda was initially used internally at Amazon to handle image processing: uploads, resizing, and generating thumbnails of products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*faTNfswT7O0_dYOq" /><figcaption>Handling Product Image Uploads — The first Lambda Use Case?</figcaption></figure><p>It’s the kind of task that Lambda’s design is perfectly suited for — quick, resource-efficient, and highly scalable on demand.</p><blockquote><em>Don’t let appearances fool you. The real magic was happening in the backend.</em></blockquote><p>The vision was ambitious: Deliver a service that could execute code in response to events quickly and cost-effectively. In these days, this technical challenge was an extreme architectural balancing act.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*xWQUA3OJMiEt7uVybzIuTA.png" /><figcaption>Trade-Offs presented by Peter DeSantis in 2023 on his reInvent Keynote</figcaption></figure><p>Every Lambda function had to be secure and isolated while executing at a moment’s notice.</p><p>AWS decided to virtualize each function using VMs — a bold choice that prioritized security and isolation but introduced some inherent trade-offs.</p><p>In 2014, <strong>EC2 T2 instances</strong> were AWS’s go-to solution to virtualize small workloads. While T2 instances launch very quickly, they weren’t even close to quick enough for the near-instant response times Lambda needed. A way to bridge this gap without compromising the user experience was needed.</p><p>AWS tackled this by pre-warming instances, likened to drag racers revving their engines at the starting line. This ensured rapid execution once the signal — an incoming event — was received.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NA5jAGJ2x75w3WKu" /><figcaption>Revving The Engine — Waiting to Server Immediantly when Needed</figcaption></figure><p>These are in a large compute pool, like a memory cache. They have different stages: <strong>standby instances</strong>, <strong>cached</strong>, and <strong>active functions</strong>, balanced as well as possible.</p><p>However, this strategy came with its own set of challenges:</p><ul><li><strong>What happens when there aren’t enough pre-warmed instances?</strong> Latency increases, impacting performance.</li><li><strong>What happens if there are too many?</strong> Over-provisioning reduces the capacity to cache previously used functions, causing inefficiencies.</li><li><strong>What if the infrastructure itself can’t scale quickly enough?</strong> Bottlenecks emerge, limiting performance during peak usage.</li></ul><blockquote>The Infamous Cold Start</blockquote><p>Even with prepared resources, Lambda’s architecture wasn’t immune to inefficiencies. Cache misses or, even worse, no pre-warmed instances, which forced AWS to provision new instances, and then it took significantly longer than executing cached functions.</p><p>This latency became known as the <strong>cold start.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MC0T1d2OFkh_X9iI6Cg9QA.png" /><figcaption>Just a quick reminder about the Workflow in 2014</figcaption></figure><p>In the early days and worst case, these could last <strong>up to 6 seconds or more</strong>. While not the norm, they occurred frequently enough to frustrate developers. This issue is still discussed broadly today, but complaints are made at a high level of comfort.</p><p>Today, we face cold starts, depending on the language used, between 11ms and 260ms. Unfortunately, I couldn’t find any sophisticated performance tests from the old days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zw0oc3R9FU0KOPrmDPnJSA.png" /><figcaption>Avg. cold start of 10 invokes with 1GB</figcaption></figure><p><em>[1] </em><a href="https://maxday.github.io/lambda-perf/"><em>https://maxday.github.io/lambda-perf/</em></a></p><p>What we do know is that AWS was well aware that this solution wasn’t perfect. But they were also confident that these issues could be addressed as Lambda evolved.</p><h3>Milestones That Defined a Decade</h3><p>AWS Lambda has evolved dramatically since 2014, and each year, it has brought new features and enhancements, solidifying Lambda as the backbone of serverless computing.</p><p>However, it took some time to move away from using single-tenant T2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2cyDi-QBbySRg6vIuMsOWg.png" /><figcaption>Feature Timeline AWS Lambda 2015- 2023</figcaption></figure><p>The migration to <strong>Firecracker microVMs</strong> in 2018 marked this significant milestone. It is a lightweight virtual machine monitor written in Rust and on KVM, purpose-built for serverless and containerized workloads.</p><ul><li><strong>Speed</strong>: Cold start times dropped dramatically, with typical delays reduced to sub-100ms levels.</li><li><strong>Efficiency</strong>: Allowing AWS to run isolated microVMs on the same hardware increases resource utilization and keeps security high.</li></ul><p>Firecracker’s introduction finally solved the initial trade-offs and also laid the foundation for many more feature releases we have had since then!</p><p><em>[1] </em><a href="https://www.youtube.com/watch?v=0_jfH6qijVY"><em>https://www.youtube.com/watch?v=0_jfH6qijVY</em></a><em> — A closer look at AWS Lambda (SVS404-R)<br>[2] </em><a href="https://www.youtube.com/watch?v=yDplzXEdBTI"><em>https://www.youtube.com/watch?v=yDplzXEdBTI</em></a><em> — Firecracker open-source innovation (OPN402)</em></p><blockquote>Black Friday —Spot Price Market Crash?</blockquote><p>As I dove deeper into the introduction of Firecracker, a question kept gnawing at me:</p><blockquote>What happened to all the instances after Lambda transitioned away from them?</blockquote><p>Diving into historical Spot Instance data, I uncovered a fascinating shift in November 2017 — T2 instances suddenly appeared in the market with huge jump in price change activity. Could this mark the early days of Firecracker testing? Or was it simply a coincidence tied to AWS’s updates to Spot market mechanics?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LQZRYpXTXLilBGcSdw-qA.png" /><figcaption>Avg. Spot Price t1.micro &amp; t2.medium</figcaption></figure><p>While the answer remains speculative, the timing is too curious to ignore. This topic deserves its own exploration, and I’ll dive deeper into it in an upcoming dedicated blog post. Let’s say there are clear indicators for it! Stay tuned!</p><p>Back to Lambda, a few weeks ago, I came across a powerful quote:</p><blockquote><strong><em>“The fastest and lowest-cost Lambda function is the one you remove and replace with a built-in integration.”</em></strong></blockquote><p>At first, I found this quote disheartening — after all, isn’t Lambda at the heart of serverless?</p><p>But upon reflection, I have to admit there’s wisdom in it:</p><blockquote><strong><em>“Do not transport with Lambda; only transform if needed.”</em></strong></blockquote><p>That said, let’s look at one of the new features that can help us with something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q_6KlH8ME9Ei12V7tRWs-g.png" /><figcaption>Error Handling with S3 Failure Event Destinations</figcaption></figure><p>Introducing <strong>S3 failure event destinations</strong> is a game-changer for managing Lambda error workflows with asynchronous events.</p><p>Here’s how it will transform your operations:</p><ol><li>Failed invocations can now automatically route event data to an S3 bucket. This eliminates the need for custom error-capturing mechanisms, ensuring that no failed event slips through the cracks.</li><li>When you log the the errors in a <strong>DynamoDB table</strong> you create a clean, structured repository for tracking errors and referencing the events, making it easy to query or filter for specific issues.</li><li>With this data logged in DynamoDB, you can build a <strong>custom UI</strong> to view, analyze, and retrieve failed events effortlessly. Your team can recover and redrive events quickly from a user-friendly interface.</li><li>For advanced insights, leverage <strong>Amazon Athena</strong> to analyze the data directly from the S3 bucket. Whether it’s spotting patterns, identifying recurring issues, or optimizing workflows, this step provides a deeper understanding of your error prown event data.</li></ol><blockquote>“The only thing that is constant is change. “ — Heraclitus</blockquote><p>This quote remains relevant, given all the past transformations, particularly in recent days.</p><p>It might seem like everything started with <strong>AWS Lambda</strong>, but it was just the beginning of a decade-long evolution.</p><p>While Lambda was the first <strong>serverless computing service</strong>, it was built on a foundation laid by several earlier services that enabled a serverless mindset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Z4O3l6mQKqplUEKNEWWpw.png" /><figcaption>Selected AWS Serverless Services over Time since 2006</figcaption></figure><p>These services formed the pillars of what would eventually be recognized as the serverless ecosystem.</p><blockquote>Twins after 9 Months!</blockquote><p>Just nine months after the launch of Lambda, in <strong>July 2015</strong>, AWS launched <strong>API Gateway</strong> and <strong>CodePipeline</strong>. These releases were game-changers, making it easier than ever to build serverless applications.</p><p>Could we imagine today’s architectures without API Gateway and Lambda symbiosis? Probably not!</p><p>After the initial buzz, AWS quickly ramped up its offerings:</p><ul><li><strong>December 2015</strong>: <strong>ECR a</strong>nd later <strong>EFS (Elastic File System)</strong> emerged to expand serverless storage options.</li><li><strong>2016</strong>: Machine learning made its debut with <strong>Polly, Rekognition, and Lex</strong>, along with <strong>Step Functions</strong> to orchestrate workflows.</li><li><strong>2017</strong>: Key additions like <strong>Glue</strong> simplified ETL workflows, while <strong>MQ</strong>, <strong>SageMaker</strong>, and <strong>Fargate</strong> brought messaging, machine learning, and containerized workloads to the serverless landscape.</li><li><strong>2018</strong>: The introduction of <strong>EKS</strong> completed the Kubernetes serverless control plane story, catching up to Google’s earlier release of GKE in 2015.</li></ul><h3>The Expanding Ecosystem</h3><p>Today, the serverless ecosystem is massive, with approximately <strong>195 serverless services</strong> and counting. While some services have been deprecated, the range of tools available for developers is staggering. Now, listing the <strong>non-serverless services</strong> is more manageable than enumerating all those under the serverless umbrella!</p><h4>What Does “Serverless” Really Mean?</h4><p>The explosion of serverless services raises a critical question:</p><p><strong>What exactly is serverless?<br></strong> <strong>Is it a clear-cut category, or does it represent more of a continuum?</strong></p><p>Consider <strong>IAM</strong> — it requires no provisioning or interaction with hardware. Does that make it serverless?</p><p>Unsurprisingly, the <strong>ISO</strong> has weighed in with its definition:</p><blockquote>“Serverless computing is a cloud service category in which the customer can use different cloud capabilities types without the customer having to provision, deploy and manage either hardware or software resources, other than providing customer application code or providing customer data.” — ISO/IEC 22123–2</blockquote><p>For me, the definition is more straightforward:</p><blockquote>Anything that allows you to build and run applications or workloads without interacting directly with the operating system or underlying software qualifies as serverless.</blockquote><h3>Closing Thoughts: A Celebration of Innovation</h3><p>AWS Lambda’s 10-year journey has been nothing short of transformative.</p><p>From its humble beginnings to its current state as a cornerstone of modern serverless architecture, Lambda continues to empower developers to focus on building great applications rather than managing infrastructure.</p><p>To those who attended in Helsinki: thank you for being there and listening to my rapidly together packed talk!</p><p>I’d love to hear your thoughts — when did you first use Lambda, and how has it shaped your projects? What features are you missing? What would you miss if not there anymore?</p><p><strong>Share your experiences in the comments below, or connect with me directly!</strong></p><h3>Sneak Peek into Part 2</h3><blockquote>Navigating Complexity of Continuously Innovation</blockquote><p>In the next part of this series, we’ll explore how to make informed technical choices among the many options in AWS, using an analogy we all know: choosing what to wear from a packed wardrobe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OjoUiqO1p8VDeeBZ" /></figure><p>As you consider what outfits work together for your plans, AWS services are grouped into categories like Compute, Databases, Storage, and Connectivity.</p><p>We’ll adopt a top-down approach: understanding the overall landscape, narrowing down options, and evaluating trade-offs before implementation.</p><p>As your wardrobe adapts to seasons, your architecture must evolve with your system and business needs.</p><p>Additionally, we’ll discuss how AWS decision-making resembles the supermarket dilemma — so many options can lead to poor choices. Part 2 will offer strategies for navigating this complexity while aligning technical decisions with business goals. Stay tuned to learn how to simplify integration, optimize choices, and dress your architecture for success in the cloud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0da1e86a9dae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS SES — Deadly Cheap but a Workhorse or Just an Old Machine?]]></title>
            <link>https://medium.com/@fabian_lober/aws-ses-deadly-cheap-but-a-workhorse-or-just-an-old-machine-8281ebaf8f2c?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/8281ebaf8f2c</guid>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Wed, 27 Nov 2024 09:36:33 GMT</pubDate>
            <atom:updated>2024-11-27T09:36:33.486Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS SES — Deadly Cheap but a Workhorse or Just an Old Machine?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLBBkRBnelTUoEtsGvhysQ.png" /></figure><p>When building a newsletter feature, one of the first solutions that came to mind was AWS Simple Email Service (SES). Initially, I had reservations. SES is notorious for being bare-bones, requiring much effort to build and maintain. I wanted a more plug-and-play solution with minimal setup and operational overhead. However, after evaluating several other options — and feeling the pinch of their pricing models — I circled back to SES for one primary reason: its cost-effectiveness ( Pssst — I have AWS credits).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*2ZgKpq6PakGJVK4qxlFtfw.png" /><figcaption>Abstraced SES Orchastration Architetcure</figcaption></figure><p><strong>Don’t tell anybody but there is a TL;DR at the end of the page!</strong></p><h3>Why AWS SES?</h3><p>SES charges <strong>$0.07 per 10,000 emails</strong>, making it one of the cheapest email solutions on the market. In contrast, many other email service providers operate on flat-fee pricing or have significantly higher per-email costs. SES’s pricing structure makes it highly attractive, particularly for high-volume email campaigns.</p><p>However, the lower price comes with its own set of challenges. SES isn’t a 100% out-of-the-box solution like some other products on the market. You’ll need to invest some time and resources into building additional infrastructure around it.</p><h3>What’s New in SES?</h3><p>A lot has changed since I last used SES. The service now offers several valuable features, like:</p><ul><li><strong>Virtual Deliverability Manager (VDM)</strong>: A new tool that helps improve email deliverability by analyzing and reporting on delivery rates, bounces, complaints, and other metrics.</li><li><strong>Email Templates</strong>: SES now allows you to create reusable email templates, saving time on email formatting and consistency across campaigns.</li><li><strong>Subscription Management</strong> <strong>&amp;</strong> <strong>Contact Lists with Topics: </strong>Built-in feature for managing user preferences and opt-ins, segmenting mailings by topics, and allowing users to choose which types of emails they receive.</li><li><strong>Mail Manager</strong>: improves email infrastructure with features like Ingress Endpoint for filtering, Traffic Policies for managing email flow, SMTP Relay for routing, and Email Archiving for secure storage. It also includes security tools via Email Add-ons for enhanced protection.</li></ul><p>Despite these improvements, there are still some pain points.</p><h3>The Challenges of SES</h3><p><strong>Subscription and Email Sending Management</strong></p><ul><li>SES currently lacks support for bulk email sending with subscription control. To execute this, you’ll need to use custom solutions like Lambda functions or EC2 instances.</li><li>However, this can get expensive, and you may run into <strong>Lambda timeouts</strong> when dealing with large batches. One approach is to use <strong>Lambda</strong> with <strong>SQS fan-out</strong> to handle email send batches. Lambda can fetch contacts, push them to an SQS queue, and send emails in bulk.</li></ul><p><strong>Orchestration of Email Sending</strong></p><ul><li>Managing the timing and events that trigger email sending can be a challenge. <strong>AWS</strong> <strong>Step Functions</strong> can be a useful service to handle this orchestration, offering the flexibility to trigger emails based on time or specific user actions.</li></ul><p><strong>Handling Email Templates</strong></p><ul><li>SES provides HTML &amp; text email templates, but managing them can be tricky. Do you store them in your codebase or build a separate frontend for easy template management?</li><li>If you have multiple team members or dynamic content, you should build a more sophisticated frontend for easier management.</li><li>CSS styling for different amil clients can be a challenge, notably Gmail!</li></ul><p><strong>UI and API Considerations</strong></p><ul><li>Your team members probably don’t want to trigger emails manually via the AWS CLI. So, you’ll need to build a user-friendly UI and API to manage and send newsletters.</li><li>You’ll also need to handle tracking and storage for written and planned newsletters, e.g., for reporting and troubleshooting purposes.</li><li>But you will be able to incorporate this nicely in your existing product,.</li></ul><p><strong>Handling Replies, Bounces, and Complaints</strong></p><ul><li>Replies can be routed through a standard “reply-to” email address. For bounces and complaints, SES integrates with <strong>Amazon SNS</strong> to send notifications. These notifications can then be forwarded to your team via <strong>Slack</strong> or email.</li><li>However, you’ll likely want to build custom logic for managing bounced emails and complaints in your user database or CRM system.</li></ul><p><strong>Custom Subscription Management</strong></p><ul><li>While SES offers basic subscription management, most use cases require a custom-built solution integrated into your website or app. This means building an API, a frontend for users to manage their preferences, and backend logic to update the SES contacts.</li><li>You also need to build your own double opt-in handling!</li></ul><p><strong>Production Access Challenges</strong></p><ul><li>Getting production access in SES can be a tricky process. AWS has a stringent approval process for lifting the sending limits imposed on new accounts, requiring you to demonstrate adherence to email best practices. Be prepared for either delivering a well phrased first reply or some back-and-forth with AWS support during this process.</li></ul><h3>Some Quick hacks for you</h3><h4>Double Opt-In</h4><p>In Europe, it is mandatory to have a double opt-in process for newsletters. This means that after signing up, users must confirm their subscriptions. Technically, SES only tracks whether a user is subscribed or unsubscribed. It feels a bit strange because they have the subscription management in place.</p><p>I found a simple solution to this by creating the contact with <em>“UnsubscribeAll” </em>set to<em> True</em> and adding a UUID4 to the AttributesData. With this, I don’t need another DynamoDB table.</p><p><em>Signup -&gt; CreateContact with Attributes-&gt; Send Conformation Email with email plus ID -&gt; Link to Page-&gt; Backend compares ID with ID in Attribute -&gt; Welcome Email</em></p><p>In the confirmation email, I include a link that directs users to a page containing their email address and ID in the URL. When this page is opened, an API call to a Lambda function is executed, which cross-checks the email and ID. If there is a match, I change <em>“UnsubscribeAll”</em> to False and send a welcome email.</p><pre>[.....]<br><br>contact_id = str(uuid4())<br>contact_attributes = {&quot;STATUS&quot;: &quot;NEW&quot;, &quot;ID&quot;: contact_id}<br><br>SES_CLIENT.create_contact(<br>    ContactListName=NEWSLETTER_CONTACT_LIST_NAME,<br>    EmailAddress=email,<br>    UnsubscribeAll=True,<br>    AttributesData=json.dumps(contact_attributes),<br>)<br><br>[.....]<br><br>SES_CLIENT.send_email(<br>FromEmailAddress=NEWSLETTER_FROM_ADDRESS,<br>       Destination={&quot;ToAddresses&quot;: [email]},<br>       Content={<br>           &quot;Template&quot;: {<br>       &quot;TemplateName&quot;: CONFIRM_NEWSLETTER_EMAIL_TEMPLATE_NAME,<br>               &quot;TemplateData&quot;: json.dumps(<br>           {<br>                       &quot;ConfirmationLink&quot;: f&quot;https://www.example.com/newsletter/confirm?email={email}&amp;id={contact_id}&quot;<br>           }<br>       ),<br>       }<br>       },<br>    )</pre><p>However, there is a catch: when updating a contact, you must submit all attributes, or they will be lost!</p><h4>Build your own send Metrics with Amazon CloudWatch</h4><p>If you want to learn more about your newsletter, you can easily add custom metrics to your Lambda function stored in CloudWatch. This includes metrics for new subscribers, confirmations, or the number of emails/contacts per topic. You can set this up in just a few seconds using Powertools for Lambda. Just don’t forget the permissions ;)</p><pre>SES_CLIENT.create_contact(<br>        ContactListName=NEWSLETTER_CONTACT_LIST_NAME,<br>        EmailAddress=email,<br>        UnsubscribeAll=True,<br>        AttributesData=json.dumps(contact_attributes),<br>      )<br>logger.info(f&quot;Contact with email &#39;{email}&#39; created successfully. {response}&quot;)<br><br>metrics.add_metric(name=&quot;SignUps&quot;, unit=MetricUnit.Count, value=1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T9QE083LtNFepeXy" /></figure><h4>BIMI — What?</h4><p>Have you heard of BIMI? I hadn’t either until recently!</p><blockquote>Brand Indicators for Message Identification (BIMI) is an email specification that allows email inboxes to display a brand’s logo next to authenticated email messages in supported email clients.</blockquote><p>To get started with BIMI, you need to create and store your logo in SVG format, such as in an S3 bucket, and set up DMARC and DKIM for email authentication. However, to fully implement BIMI, you must obtain a Verified Mark Certificate (VMC) from a few selected providers, which typically costs around $1,500 per year. Without a VMC, it’s very unlikely that your logo will be displayed.</p><p><a href="https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-bimi.html">Using BIMI in Amazon SES — Amazon Simple Email Service</a></p><h4>Handle list &amp; non-list emails correctly</h4><p>Be precise in how you define whether an email is a list email or a non-list email, especially when sending confirmation emails before someone is officially subscribed or after they have unsubscribed. The order in which you classify the email will determine whether it is sent out, particularly if it is marked as a list email.</p><h4>Simple From Name Trick</h4><p>Want to have your From shown as something like <strong>Newsletter | Company Name &lt;news@example.com&gt; </strong>?</p><p>Just use <em>iso-2022-jp </em>encoding! Simple or?</p><pre>NEWSLETTER_FROM_ADDRESS = &quot;{} &lt;{}&gt;&quot;.format(<br>    Header(&quot;Newsletter | Company Example&quot;.encode(&quot;iso-2022-jp&quot;), &quot;iso-2022-jp&quot;).encode(),<br>    &quot;news@example.com&quot;,<br>)</pre><h3>Is SES Worth the Effort?</h3><p>After considering all the pros and cons, is SES still worth it? For me, the answer is yes. Here’s why:</p><ul><li><strong>Cost Efficiency</strong>: SES is hard to beat if you’re working with AWS credits or need a full pay-on-demand solution. Even factoring in the extra development time and infrastructure costs, SES remains one of the affordable solutions for sending large volumes of emails.</li><li><strong>Scalability</strong>: SES is built on AWS, making it highly scalable. SES integrates smoothly with other AWS tools like Lambda, Step Functions, and SQS if you’re already using AWS services.</li><li><strong>Customization</strong>: SES provides a blank slate. SES allows you to build exactly what you need if other email providers do not cover specific requirements or if you just like to build!</li></ul><h3>Final Thoughts</h3><p>Using SES comes with a trade-off between cost and effort. If you’re willing to invest in building the infrastructure and don’t mind handling the operational overhead, SES is a solid, low-cost option. However, if you’re looking for a ready-made solution with all the bells and whistles (like built-in analytics, subscription management, and UI), you may want to consider other providers — even if they come with a higher price tag.</p><p>Ultimately, and as always, the choice depends on your budget, resources, and specific needs.</p><h3>TL;DR: If You’ve Reached This Point</h3><p><strong>Why Consider SES?</strong></p><ul><li><strong>Cost-effective</strong>: $0.07 per 10,000 emails makes SES one of the cheapest options.</li><li><strong>AWS Ecosystem Integration</strong>: Works well with Lambda, Step Functions, SQS, and other AWS tools.</li><li><strong>Customization</strong>: Ideal for tailored email solutions if you need or can build on your own.</li></ul><p><strong>What’s New in SES?</strong></p><ul><li><strong>Virtual Deliverability Manager</strong>: Insights into bounces, complaints, and delivery rates.</li><li><strong>Email Templates</strong>: Reusable designs for consistency.</li><li><strong>Subscription Management</strong>: Segment users and manage preferences.</li><li><strong>Mail Manager</strong>: Advanced tools for email flow and security.</li></ul><p><strong>Challenges:</strong></p><ul><li>Lacks plug-and-play functionality.</li><li>Requires custom infrastructure for bulk emails, email templates, UI, subscription handling, and bounce/complaint management.</li><li>Approval for production access can be cumbersome.</li><li>Handling double opt-in and managing attributes requires workarounds.</li></ul><p><strong>Hacks &amp; Tips:</strong></p><ul><li>Use UUIDs and AttributesData for double opt-in with SES attributes.</li><li>Build metrics using CloudWatch for better insights.</li><li>Explore BIMI for branded email display (though costly).</li><li>Simplify “From” names using encoding tricks.</li></ul><p><strong>Verdict:</strong> SES is worth the effort for cost-sensitive, high-volume campaigns where customization is key. If you prefer out-of-the-box solutions with less overhead, consider pricier alternatives. The choice hinges on your budget, resources, and need for scalability or flexibility.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8281ebaf8f2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Power of Amazon API Gateway: A Comparative Analysis of Service Integrations and…]]></title>
            <link>https://medium.com/@fabian_lober/unveiling-the-power-of-amazon-api-gateway-a-comparative-analysis-of-service-integrations-and-4ad241ff71e3?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ad241ff71e3</guid>
            <category><![CDATA[amazon-api-gateway]]></category>
            <category><![CDATA[efficiency]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[cloud-cost-optimization]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Mon, 20 Nov 2023 10:12:31 GMT</pubDate>
            <atom:updated>2023-11-20T10:12:31.808Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unveiling the Power of Amazon API Gateway: A Comparative Analysis of Service Integrations and Lambda Functions</h3><p>In this post, I go into the performance and cost-efficiency of Service Integrations (DynamdoDB) in Amazon API Gateway and compare them to a Lambda Function. We use a more than Hello-World example API to test how much each costs and the speed and briefly discuss where you can utilize it and where you may avoid it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jsGHkPnoE6xCh3vF8kynCw.png" /><figcaption>Service Integrations vs. Lambda Functions — Who wins?</figcaption></figure><h4>What is a Service Integration?</h4><p>Service Integrations give you access to a few AWS service actions directly from the Amazon API Gateway. You must configure this in the integration request and response and set up necessary data mappings in both directions.</p><p>Since I discovered them, I have loved and hated them simultaneously. I used it in small and big projects. My DevOps hated me, but I was still convinced it was a great solution.</p><p>The language used is VTL, which can be a pain, and the documentation of AWS regarding the Service Integration was even worse a few years ago. These days, it is better, but it is still challenging. I’m also waiting for a replacement of VTL (it&#39;s even deprecated).</p><p>But not needing a Lambda Function (or similar backend) can be, on many points, beneficial. For example, it is less overhead to operate, quicker to write &amp; build (most of the time), but it is also cheaper and faster. I was always sure about this before I had done any tests or comparisons.</p><p>Now, the time has come to do a simple comparison!</p><h4>What can a test scenario look like?</h4><p>Our test case is a simple Books REST API in Amazon API Gateway with one each GET, POST, PUT, and DELETE method.</p><ul><li>GET — Get all Books</li><li>POST — Create a Book</li><li>GET — Get a Book by ID</li><li>PUT — Update Book</li><li>DELETE — Delete Book by ID</li></ul><blockquote>The Get all Books is limited to 500 results in the DynamoDB Scan to unify the results and work around the first limitation of VTL! We could only return a next_token, but not repeat our scan until all results are loaded.</blockquote><p>BTW you can find the code I used on my <a href="https://github.com/lober-io/amazon-api-gateway-automated-tests-and-machine-auth-example">GitHub</a>!</p><p>We build the same REST API endpoints twice in the same API Gateway, one with a Lambda Proxy Integration and one directly with DynamoDB integrated.</p><p>The API Gateway has a regional endpoint, no caching, and tracing is active, as well as metrics. As AWS region, we use <em>eu-central-1</em>.</p><p>The Lambda Function backend is written in Python (3.10), makes use of Powertools for Lamba, Tracing, Lambda Insights, and boto3, and has a 2048MB memory assigned.</p><p>In addition, I ran the same tests with ARM, Python 3.9, 4GB RAM, no tracing, and no XRAY. Later, more to come.</p><p>The DynamoDB Table was cleaned before every run and set to Pay per Request so as not to be the bottleneck.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l5OB5uK6pGQ8A9tJjPyAYA.png" /><figcaption>AWS Architecture for the tests</figcaption></figure><p>To test the API, I ran Postman Performance Tests on a 16&quot; MacBook Pro with 20 virtual users for 10 minutes to balance out any cold start and build up some data &amp; load. The location is in the south of Germany and has a 1Gbit internet connection.</p><p>In the following image, you can see the tests executed. <em>20 — Delete all created Books</em> was completed every 200 calls. Due to how Postman Performance Tests works, not all Books were deleted, and per run, roughly 8000 entries were built up in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*qdms2PRJCCvbgiIq9-a3ug.png" /><figcaption>API Calls &amp; orders used for the Performance Tests</figcaption></figure><h4>The results…</h4><p>… have been surprising</p><p>We can see in the following three charts that the Service Integration delivered twice as many Requests/second at half of the average speed, which is consistent across all requests. To be precise, the x86 Lambda archived only 58% (ARM 64%) of the Service Integration in Requests/s performance and 53% (both) in Average Response Time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OZ6fcXXFMGp6HOzfuffmpA.png" /><figcaption>The difference between the backends compared to the Service Integration.</figcaption></figure><p>Quite interesting is the <em>Get all Books</em> endpoint, which has a significantly slower response time in Lambda&#39;s backend. I couldn’t detect any errors or throttle, but it&#39;s probably worth repeating the test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUzyP70yKvedv2Hegkjk1A.png" /><figcaption>Requests per second and Avg. response time for Lambda and DDB Service Integration.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikHOMK3wrVbMI4BZ3R1o0A.png" /><figcaption>Requests per second across requests and Lambda and DDB Service Integration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aNCd6IeajszN5UALOeVJqQ.png" /><figcaption>Avg. response time across requests and Lambda and DDB Service Integration</figcaption></figure><p>When you disable tracing in the Lambda Function, you gain around 3% in average response time and more interesting, get around 12% more requests per second!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FMCYsKZp4SN2gBn5h7ge-A.png" /><figcaption>Avg. response time across requests with and without Tracing</figcaption></figure><p>Looking at the Postman charts, both are getting slower over time (not all data was deleted immediately). However, the Service Integration has shown less performance impact (no Lambda throttling happened).</p><p>Also, the Lambda Function was slower from the beginning. Overall, the Service Integration shows a more consistent performance with a few peaks. Due to the high increase in response time at the beginning, the Lambda chart looks a bit off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qR7VJwLs5ZhcFJMOnjgadw.png" /><figcaption>Response time over time of the Service Integration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Stirl1FNGXQUGdcPTXwsnQ.png" /><figcaption>Response time over time the Lambda backend</figcaption></figure><p>In the throughput chart, we have a similar result. Nearly all the time, the Lambda backend was significantly slower. Interestingly, there is an increase in the Service Integration towards the end of the run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kN2otQzKQZ7PzMbf5diJAw.png" /><figcaption>Throughput of the Lambda backend</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K0q1kuvg3s4CsmIPU-Btow.png" /><figcaption>Throughput of the Service Integration</figcaption></figure><h4>What about costs?</h4><p>First, we must compare them to the same number of requests.</p><p>Let’s assume there is no Free Tier, and we call our example from before 100.000 times in one hour. This will result in 10 million requests with roughly 29GB of traffic.</p><p>In both cases, we have similar costs for the Amazon API Gateway and the Amazon DynamoDB. They are also the most significant portion. So, the differentiator is the compute cost.</p><p><a href="https://aws.amazon.com/lambda/pricing/?nc1=h_ls">Lambda is charged</a> in computing costs (ms) and per request. Across all calls of this example, we had around an average of 160ms billed duration. We use this as a foundation for the calculation.</p><blockquote>If you use (what you should do!) Xray, Cloudwatch and other tools will incur additional costs, but we exclude them to keep it more uncomplicated.</blockquote><p>Lambda (x86) is adding up around $5.53 (7.88%) to the costs, bringing it up to $62.21.</p><p><strong>Does ARM make a difference?</strong></p><p>Even when the compute costs of ARM Lambda Functions are 20% cheaper, it makes, in our example, only a ~2% difference ($61.14).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tdnrr2A4jK0d6GtkfcuaHg.png" /><figcaption>Cost comparison of the various solutions</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iCEEqAVBR447T0HVVaHqbg.png" /></figure><h4>So, is it worth it?</h4><p>As always, you need to trade-off, in this case, mainly cost, complexity, speed, operation and development.</p><ul><li>We can answer this from a pure performance perspective with a simple yes.</li><li>From a pure cost perspective, it is also yes (it&#39;s even easier to calculate).</li></ul><p>But the real world is not a boolean value.</p><p>One thing you need to consider is that dependencies are tricky to resolve. For example, if you need to fetch another item from a database or table, check something before deleting or need some business logic implemented.</p><p>Nevertheless, you can get around a few things with a DynamodDB Single Table Design.</p><p>Also, service integrations can get complex to build and maintain and are more complicated to implement into any Infrastructure-as-Code, especially if another department needs to provide the code or logic.</p><p>Sadly, VTL can be hard to read &amp; debug. A simple comma at the end of a line can break everything, and you end up with a useless error message, predominantly a <em>“com.amazon.coral.service#SerializationException”.</em></p><p>You always go for it when you have a simple use case, sandbox, PoC, or you want to start fast. You can easily migrate everything or even single endpoints to a Lambda or ECS afterwards.</p><p>That&#39;s also the second option: Decide per endpoint and mix it. Whenever it’s a simple request, something called very often or performance relevant, go for the service integration. <a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/cloud-design-patterns/strangler-fig.html">That&#39;s also an excellent pattern for migrating &amp; modernizing legacy applications!</a></p><p>If the small performance or cost difference doesn’t matter for you or operational reasons are making it not worth it, go with a Lambda!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ad241ff71e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon API Gateway together Powertools and AWS Lambda non-proxy asynchronous invocation]]></title>
            <link>https://aws.plainenglish.io/amazon-api-gateway-together-powertools-and-aws-lambda-non-proxy-asynchronous-invocation-032d6ceb80af?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/032d6ceb80af</guid>
            <category><![CDATA[amazon-api-gateway]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Tue, 07 Nov 2023 11:26:57 GMT</pubDate>
            <atom:updated>2023-11-10T04:32:12.005Z</atom:updated>
            <content:encoded><![CDATA[<p>I am working on remodelling a Lambda Function and finally using <a href="https://docs.powertools.aws.dev/lambda/python/latest/">Powertools for Lambda</a>, like in all others.</p><p>The Lambda Function is integrated within a REST API built with Amazon API Gateway. Most calls required a proxy integration and synchronous invocation. Still, there is also one call which must be an asynchronous invocation, which is only possible with a non-proxy integration.</p><p>Sadly, I couldn’t find any out-of-the-box support for Powertools for Lambda with non-proxy integrations, which is mandatory for an asynchronous invocation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*Is4VcrWPhouMCOZp.png" /><figcaption>Example Serverless Architecture with Amazon API Gateway, AWS Lambda and Amazon DynamoDB</figcaption></figure><p>Before we begin with the solution, let&#39;s review a few details to ensure everything is clear before we proceed.</p><p><strong>What is Powertools for Lambda?</strong></p><p><a href="https://docs.powertools.aws.dev/lambda/python/latest/">Powertools for Lambda</a> is a fantastic toolkit for implementing best practices and increasing efficiency while developing.</p><p>The Event Handler for REST APIs makes it easy &amp; fast to use your AWS Lambda functions with Amazon API Gateway.</p><p>Besides simple mapping of HTTP Methods and endpoints to methods, you can do the exception and response handling with a few lines of code, as well as structured logging.</p><p><strong>What is an async invocation?</strong></p><p>In Lambda non-proxy integration, the backend function is invoked synchronously by default. This is the desired behaviour for most REST API operations. Some applications require work asynchronously (as a batch or a long-latency operation), typically by a separate backend component. In this case, the backend Lambda function is invoked asynchronously, and the front-end REST API method doesn’t return the result.</p><blockquote><strong>Keep in mind!</strong></blockquote><blockquote>You need to do error handling, retries etc. in your Lambda function and e.g. with a DLQ. The API Gateway will always return 202, except when the error happens outside of the integration.</blockquote><p><strong>How to do an async invocation?</strong></p><p>You can configure the Lambda function for a Lambda non-proxy integration to be invoked asynchronously by specifying ‘Event’ as the Lambda invocation type. More details on:</p><p><a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-integration-async.html#asynchronous-invocation-console-examples">Set up asynchronous invocation of the backend Lambda function</a></p><p><strong>How to make it work?</strong></p><p>I managed to find a solution after trying different methods and reading through the documentation.</p><p>By creating a mapping template that matches a proxy synchronous invocation event in the integration request, the request is processed successfully. The Powertools Event Handler also functions as intended in this scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNBqL5mBlKZ5snrftdvgdQ.png" /><figcaption>Mapping templates in integration requests of the Amazon API Gateway</figcaption></figure><p>In the mapping template, we need to perform some magic because certain parameters are unavailable, such as the complete path with the dynamic variable filled in.</p><p>The path could look like <em>/example/1/update</em>, but only <em>/example/{id}/update</em> is available as a parameter. As we know all values, we can quickly replace them in the string!</p><blockquote>If you need multiValueQueryStringParameters or multiValueHeaders<em>,</em> you must change the script, the method and the integration request.</blockquote><p>The final mapping template would look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/da4861f1c62784a14f98025f0be3f7f8/href">https://medium.com/media/da4861f1c62784a14f98025f0be3f7f8/href</a></iframe><h3>In Plain English</h3><p><em>Thank you for being a part of our community! Before you go:</em></p><ul><li><em>Be sure to </em><strong><em>clap</em></strong><em> and </em><strong><em>follow</em></strong><em> the writer! 👏</em></li><li><em>You can find even more content at </em><a href="https://plainenglish.io/"><strong><em>PlainEnglish.io</em></strong></a><strong><em> 🚀</em></strong></li><li><em>Sign up for our </em><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. 🗞️</em></li><li><em>Follow us: </em><a href="https://twitter.com/inPlainEngHQ"><strong><em>Twitter</em></strong></a><strong><em>(X</em></strong>), <a href="https://www.linkedin.com/company/inplainenglish/"><strong><em>LinkedIn</em></strong></a>, <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong><em>YouTube</em></strong></a>, <a href="https://discord.gg/in-plain-english-709094664682340443"><strong><em>Discord</em></strong></a><strong><em>.</em></strong></li><li><em>Check out our other platforms: </em><a href="https://stackademic.com/"><strong><em>Stackademic</em></strong></a>, <a href="https://cofeed.app/"><strong><em>CoFeed</em></strong></a>, <a href="https://venturemagazine.net/"><strong><em>Venture</em></strong></a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=032d6ceb80af" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/amazon-api-gateway-together-powertools-and-aws-lambda-non-proxy-asynchronous-invocation-032d6ceb80af">Amazon API Gateway together Powertools and AWS Lambda non-proxy asynchronous invocation</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CodeBuild fails with the error “Commands to be of string type: found subkeys instead.”]]></title>
            <link>https://medium.com/@fabian_lober/aws-codebuild-fails-with-the-error-commands-to-be-of-string-type-found-subkeys-instead-304f7c6861b1?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/304f7c6861b1</guid>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[codebuild]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Thu, 02 Nov 2023 11:36:54 GMT</pubDate>
            <atom:updated>2023-11-03T12:18:24.718Z</atom:updated>
            <content:encoded><![CDATA[<p>Troubleshooting an AWS CodeBuild failure in the <em>DOWNLOAD_SOURCE</em> phase with the error “<em>Phase context status code: YAML_FILE_ERROR Message: Expected Commands[3] to be of string type: found subkeys instead at line 26, value of the key tag on line 25 might be empty</em>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eP6S7VWDPG9D3bkRI--oLQ.png" /><figcaption>AWS CodeBuild fails during the DOWNLOAD_SOURCE phase.</figcaption></figure><p>While working on automated API tests with AWS CodeBuild &amp; Newman (blog post will follow soon!) I stumbled across the following error, which let AWS CodeBuild fail during the DOWNLOAD_SOURCE phase.</p><pre>Phase context status code: YAML_FILE_ERROR Message: Expected Commands[3] to be of string type: found subkeys instead at line 26, value of the key tag on line 25 might be empty</pre><blockquote>The numbers in error vary on your buildspec.yml file.</blockquote><p>Line 26 in my buildspec.yml is a curl command to get an Authorization Token with a Client ID and Client Secret from AWS Cognito.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f70705787c5e7318c41b8e8cd6b1076/href">https://medium.com/media/9f70705787c5e7318c41b8e8cd6b1076/href</a></iframe><p>It took me a while to find the root cause, even if it’s well-mentioned in the <a href="https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-syntax">AWS documentation</a>. I somehow missed it and couldn’t find it immediately with Google.</p><blockquote>If a command contains a character, or a string of characters, that is not supported by YAML, you must enclose the command in quotation marks (“”). The following command is enclosed in quotation marks because a colon (:) followed by a space is not allowed in YAML. The quotation mark in the command is escaped (\”).</blockquote><h4>How to solve it?</h4><p>The easiest solution is not to use a colon followed by a space. Just enough to remove the space.</p><pre># Will fail<br>echo &quot;Hello: World&quot;<br><br># Will succeed <br>echo &quot;Hello:World&quot;</pre><p>If it’s impossible, as in my case, we need to enclose the command in double quotes.</p><p>A simplified version of my buildspec.yml file would look like this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a74dba6c52d7b680fe074c6c0c2feed/href">https://medium.com/media/0a74dba6c52d7b680fe074c6c0c2feed/href</a></iframe><p>When we put double quotes around the command, it will bring up a new issue — the existing quotes in the command.</p><p>We need to change or remove the following double quotes:</p><ul><li>around the <em>API_ACCESS_TOKEN_URL</em></li><li>around <em>Content-Type: ….</em></li><li>in the <em>jq</em> command</li></ul><p><em>Content-Type</em> and <em>jq</em> could be easily solved with single quotes, but when using them for the <em>API_ACCESS_TOKEN_URL</em>, the variable is not replaced anymore.</p><p>Curl without any quotes around the URL will fail. So, I escape the double quotes with a backslash, as suggested in the AWS documentation. This could also be used for the other parts of the command.</p><p>Finally, I ended up with this, and it worked!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6053b433ae2c736ffc6811ff65d38a7/href">https://medium.com/media/e6053b433ae2c736ffc6811ff65d38a7/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=304f7c6861b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grave accents in code snippets break Medium Story!]]></title>
            <link>https://medium.com/@fabian_lober/grave-accents-in-code-snippets-break-medium-63550ae18aae?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/63550ae18aae</guid>
            <category><![CDATA[medium]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[bugs]]></category>
            <category><![CDATA[blog]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 10:29:34 GMT</pubDate>
            <atom:updated>2023-10-31T10:29:34.397Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I worked on a Medium Story about recent troubleshooting and wanted to utilize the code snippet feature. After adding the first code block, it continuously failed to save, and even when removing the code, it was impossible to get the story saved again. <strong>Be careful! You can lose what you wrote!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*kOV6m3GIatst71IaBUO0pg.png" /><figcaption>Medium Story could not be saved.</figcaption></figure><p>When I added the following code, the story couldn’t be saved, and I had to reload the whole page. After switching to gist, I could finish writing my Story.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a74dba6c52d7b680fe074c6c0c2feed/href">https://medium.com/media/0a74dba6c52d7b680fe074c6c0c2feed/href</a></iframe><p>After that, I did some tests &amp; analyses and could break it down to the root cause.</p><p>First, why do we get an error?</p><p>That is relatively easy. A short view into the Network tab of the Developer Tools shows us that Cloudflare is blocking the POST request when saving the story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyFPyAqvzMhwJh1SU71P0A.png" /><figcaption>Cloudflare is blocking the POST request to Medium.com.</figcaption></figure><p>Now, what part of the command is the issue?</p><p>After a bit of try &amp; error, I can say that the surrounding grave accents (`) in the command are the issues. Without them, it&#39;s saving!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63550ae18aae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Internal Server Error — API Gateway with private Network Load Balancer & Security Groups]]></title>
            <link>https://medium.com/@fabian_lober/internal-server-error-api-gateway-with-network-load-balancer-92ab1aa2bd7b?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/92ab1aa2bd7b</guid>
            <category><![CDATA[internal-server-error]]></category>
            <category><![CDATA[troubleshooting]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 10:18:27 GMT</pubDate>
            <atom:updated>2023-08-30T10:18:27.380Z</atom:updated>
            <content:encoded><![CDATA[<h3>Internal Server Error — API Gateway with private Network Load Balancer &amp; Security Groups</h3><p>To enable access to resources in your VPC as REST API with Amazon API Gateway, it is necessary to utilize a private Network Load Balancer with a Private Link that connects both endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/0*NcNA49M-2sEeGacF" /></figure><p>In this setup, you may encounter the following error when using a new API setup or adding a new Network Load Balancer to an existing one despite following the AWS Guide for the example setup.</p><blockquote>Thu Aug 04 17:48:21 UTC 2022 : Execution failed due to configuration error: There was an internal error while executing your request<br>Thu Aug 04 17:48:21 UTC 2022 : Method completed with status: 500</blockquote><p><a href="https://aws.amazon.com/about-aws/whats-new/2023/08/network-load-balancer-supports-security-groups/">After introducing Security Groups on the Network Load Balancer on 10.08.2023</a>, a configuration change must be made to ensure its functionality. Unfortunately, limited updated documentation is available to address these issues, and the error message itself is very general.</p><p>To troubleshoot, your first step should be to check the comprehensive guide on the AWS repost (<a href="https://repost.aws/knowledge-center/api-gateway-500-error-vpc">Troubleshoot Amazon API Gateway 500 errors with VPC link integration</a>).</p><p>Your Security Group is blocking the traffic if you&#39;re still encountering errors. This could happen if you entered the VPC CIDR range or the SG ID as a source in the SG, which doesn’t allow connections coming over the VPC Link/Private Link.</p><p>To resolve this, you have two viable options available to you.</p><p>Firstly, you can unselect the “<a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-security-groups.html#update-security-settings">Enforce inbound rules on PrivateLink traffic</a>” option on the Network Load Balancer. Although this option has a minor security impact, it can help mitigate the issue.</p><p>Alternatively, you can employ multiple IP ranges as sources, such as all available private CIDR ranges or simply 0.0.0.0/0, which can lead to a <strong>significant</strong> security impact.</p><p>Unfortunately, there are no other alternatives to consider as the endpoint is not visible in “Endpoints”. Only the service can be viewed in “Endpoint services”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dtEsgF6RJpO1aO3z" /></figure><p>It may be necessary to obtain knowledge of the private IP address of the API Gateway located within the Amazon Web Services Virtual Private Cloud, as denoted in the Network Load Balancer documentation.</p><blockquote><em>If you enable inbound rules on PrivateLink traffic, the source of the traffic is the private IP address of the client, not the endpoint interface.</em></blockquote><p>In this scenario disabling the <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-target-groups.html#client-ip-preservation">Preserve client IP addresses</a> on the NLB Target Group doesn’t change the outcome.</p><p>It is also impossible to identify blocked requests, for example, using VPC Flow Logs or<a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-access-logs.html"> Access Logs</a> on the NLB. The Security Group is applied logically before a connection reaches the NLB, which likely blocks the requests with different source IP addresses.</p><p>However, the logs for requests that came through after the change will display the private IP (VPC CIDR) of the NLB.</p><blockquote>tls 2.0 2023–08–28T08:21:31 net/pv-link-test-1/4d2940e541bae8b9 963cc1c4dd2e772d 172.16.103.14:42222 172.16.24.214:443 9 5 0 0 — arn:aws:acm:eu-central-1:123456789012:certificate/412eb6d3–24b8–427a-99e4–52943f389456 — ECDHE-RSA-AES128-GCM-SHA256 tlsv12 — pv-link-test-1–4d2940e541bae8b9.elb.eu-central-1.amazonaws.com — — — 2023–08–28T08:21:31</blockquote><p><strong>Keep in mind</strong></p><blockquote><em>Network Load Balancers (NLB) support access logs only for Transport Layer Security (TLS) listeners. The log contains information about TLS requests made to the Network Load Balancer. Transmission Control Protocol (TCP) is not supported.</em></blockquote><h4><strong>Sources</strong></h4><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-security-groups.html#update-security-settings">Security groups for your Network Load Balancer</a><br><a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-nlb-for-vpclink-using-console.html">Set up a Network Load Balancer for API Gateway private integrations</a><br><a href="https://aws.amazon.com/about-aws/whats-new/2023/08/network-load-balancer-supports-security-groups/">Network Load Balancer now supports security groups</a><br><a href="https://repost.aws/knowledge-center/api-gateway-500-error-vpc">Troubleshoot Amazon API Gateway 500 errors with VPC link integration | AWS re:Post</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92ab1aa2bd7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How is the AWS Zürich region doing after the winter?]]></title>
            <link>https://medium.com/@fabian_lober/how-is-the-aws-z%C3%BCrich-region-doing-after-the-winter-e59b10e3733?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/e59b10e3733</guid>
            <category><![CDATA[cloud-cost-optimization]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-region]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[switzerland]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Mon, 13 Feb 2023 08:04:16 GMT</pubDate>
            <atom:updated>2023-08-30T09:14:07.280Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W11xIWBgZWUpMoVLpQmkag.jpeg" /><figcaption>The place to be!</figcaption></figure><p>The AWS Zurich region was announced in November 2022. Some time has passed, late winter is starting<em>,</em> and now it’s time to catch up!</p><blockquote><em>Where I come from, we would say,</em> “Seitdem ist viel Wasser den Rhein runtergeflossen”<em>, which means </em>“A lot of water has flowed down the Rhine since then”<em>. Funny that the Rhine rises in Switzerland ;)</em></blockquote><p>There is no need for a summary of the region’s release, most were written in the AWS region release blog post!</p><p><a href="https://aws.amazon.com/blogs/aws/a-new-aws-region-opens-in-switzerland/">A New AWS Region Opens in Switzerland | Amazon Web Services</a></p><p>In the AWS blog post, we see a list of services and features. Most of them are, in my perspective, “core” services, but what does this mean?</p><p>We can categorise these roughly into the following:</p><ul><li><strong>Fundamental</strong> services like IAM, KMS, CloudWatch, CloudTrail</li><li><strong>Compute</strong> services like EC2, EC2 Autoscaling, ECS, Fargate and Lambda</li><li><strong>Storage</strong> services like EBS and S3</li><li><strong>Database</strong> services like DynamoDB, Aurora and RDS</li><li><strong>Networking</strong> services like Route53, ALB and NLB,</li><li><strong>Workflow and Event </strong>services like StepFunctions, SNS and SQS</li></ul><p>Depending on what you want to build or migrate, this couldn’t be enough and influence your architecture, migration and timeline decisions.</p><h4>What does this mean?</h4><p>For example:</p><ul><li>Building resilient and high-available on Amazon EC2 and Amazon ECS is way more challenging without a shared filesystem like Amazon EFS.</li><li>Also, without Amazon EKS, many microservice architecture patterns are more complex to build and operate.</li><li>AWS Managed Microsoft AD and Amazon FSx are part of the typical tech stack in our data-center migrations. Without the help of these managed services, you have a significant overhead on your shoulders.</li><li>The same applies to AWS DataSync and AWS Application Migration Service, which are tools we use day-to-day for migrating hundreds of servers and TB of data to AWS.</li><li>Amazon Kinesis Data Firehose is an essential component for data-driven workloads, without streaming data to targets being way more demanding.</li></ul><h4>No need to worry!</h4><p>As usual, AWS is incredibly fast, and since then, a bunch of services have been added to the region. Nearly all examples listed above are now available!</p><blockquote>To learn more, check this fantastic video from re:invent 2020 with insides about service delivery at AWS!</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FngnMj1zbMPY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DngnMj1zbMPY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FngnMj1zbMPY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d787dd130e2e56242fd5e85055f29a13/href">https://medium.com/media/d787dd130e2e56242fd5e85055f29a13/href</a></iframe><p>The services added include Amazon EFS, Amazon EKS, AWS Directory Service, AWS DataSync, and many more!</p><p><strong>A list of releases since November 2022:</strong></p><ul><li>Amazon EKS (<a href="https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-eks-europe-zurich-spain-hyderabad-aws-regions/">https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-eks-europe-zurich-spain-hyderabad-aws-regions/</a>)</li><li>Amazon EFS (<a href="https://aws.amazon.com/about-aws/whats-new/2022/12/amazon-elastic-file-system-efs-available-aws-europe-zurich-region/">https://aws.amazon.com/about-aws/whats-new/2022/12/amazon-elastic-file-system-efs-available-aws-europe-zurich-region/</a>)</li><li>AWS DataSync (<a href="https://aws.amazon.com/about-aws/whats-new/2023/02/aws-datasync-3-additional-regions/">https://aws.amazon.com/about-aws/whats-new/2023/02/aws-datasync-3-additional-regions/</a>)</li><li>Amazon GuardDuty (<a href="https://aws.amazon.com/about-aws/whats-new/2022/12/amazon-guardduty-available-aws-europe-zurich-region/">https://aws.amazon.com/about-aws/whats-new/2022/12/amazon-guardduty-available-aws-europe-zurich-region/</a>)</li><li>AWS Resource Access Manager (<a href="https://aws.amazon.com/about-aws/whats-new/2022/12/aws-resource-access-manager-aws-europe-zurich-region/">https://aws.amazon.com/about-aws/whats-new/2022/12/aws-resource-access-manager-aws-europe-zurich-region/</a>)</li><li>AWS Cloud Map (<a href="https://aws.amazon.com/about-aws/whats-new/2022/12/aws-cloud-map-available-new-regions/">https://aws.amazon.com/about-aws/whats-new/2022/12/aws-cloud-map-available-new-regions/</a>)</li><li>Amazon Kinesis Data Streams for DynamoDB (<a href="https://aws.amazon.com/about-aws/whats-new/2023/01/amazon-kinesis-data-streams-dynamodb-11-additional-regions/">https://aws.amazon.com/about-aws/whats-new/2023/01/amazon-kinesis-data-streams-dynamodb-11-additional-regions/</a>)</li><li>Storage Gateway (<a href="https://aws.amazon.com/about-aws/whats-new/2023/01/aws-storage-gateway-europe-spain-zurich-regions/">https://aws.amazon.com/about-aws/whats-new/2023/01/aws-storage-gateway-europe-spain-zurich-regions/</a>)</li><li>Amazon Kinesis Data Firehose (<a href="https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-kinesis-data-firehose-europe-zurich-spain-hyderabad-regions/">https://aws.amazon.com/about-aws/whats-new/2023/02/amazon-kinesis-data-firehose-europe-zurich-spain-hyderabad-regions/</a>)</li><li>AWS Directory Service for Microsoft AD and AD Connector (<a href="https://aws.amazon.com/about-aws/whats-new/2023/02/aws-directory-service-microsoft-active-directory-ad-connector-spain-zurich-hyderabad/">https://aws.amazon.com/about-aws/whats-new/2023/02/aws-directory-service-microsoft-active-directory-ad-connector-spain-zurich-hyderabad/</a>)</li></ul><h4>What be fantastic to have next?</h4><p>To continue building awesome solutions for our customers, I am waiting for the following (and, yes, more!):</p><ul><li>Amazon EC2 Gravition Instances</li><li>Amazon FSx</li><li>Transit Gateway &amp; Traffic Mirroring</li><li>Amazon DynamodDB DAX</li><li>Reserved Instance for Amazon RDS</li></ul><h3>Finally, let’s talk about money!</h3><p>We face price differences between all AWS regions, which is no surprise, as salaries, infrastructure costs, taxes, fees, and more are different across the globe. Also, the maturity of a region seems to have an impact (maybe due to increased efficiency?).</p><p>For example, North Virginia is typically the cheapest region. There might be exceptions, but I haven’t seen any.</p><p>In Sao Paulo, it costs 52% more to deploy similar infrastructure than in North Virginia.</p><blockquote>Remember that prices of new or expensive regions are decreasing significant over time. As well as in all other regions, but there slower. (<a href="https://aws.amazon.com/blogs/aws-cost-management/amazon-ec2-15th-years-of-optimizing-and-saving-your-it-costs/">https://aws.amazon.com/blogs/aws-cost-management/amazon-ec2-15th-years-of-optimizing-and-saving-your-it-costs/</a>)</blockquote><p>Also, not all regions in the US cost the same. North California would cost 21% more compared to North Virginia.</p><p>In Europe, Ireland is typically the cheapest region, while Frankfurt is somewhere in between.</p><h4><strong>But how is the Zurich region doing?</strong></h4><p>In comparison, Zurich is more expensive overall, which isn’t surprising. But, for everyone who knows how pricy things in Switzerland can be, the differences are surprisingly small!</p><p>Nearly all services we compared are around 10% higher than in Frankfurt, except for Fargate (~17%), EBS (~20%), and EFS (~20%).</p><blockquote>For reassurance: Roughly the same ratio apears when comparing these services between Frankfurt and Ireland.</blockquote><p>For example, traffic, VPN and private CA are similar in the three regions.</p><p><strong>Let’s look at some examples!</strong></p><p><strong>Amazon S3 — Standard Tier</strong></p><ul><li>~6.5% between Ireland and Frankfurt</li><li>10.0% between Frankfurt and Zurich</li><li>~17% between Ireland and Zurich</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*tfyoj4YgoFRrMtz1zFA25w.png" /><figcaption>Amazon S3 Standard Tier price comparison</figcaption></figure><p><strong>Amazon EC2 with a t3.xlarge Linux instances without EBS</strong></p><ul><li>6.67% (5.31%) between Ireland and Frankfurt</li><li>10.00% (10.00%) between Frankfurt and Zurich</li><li>17.33% (15.83%) between Ireland and Zurich</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*1_GZ55pJvKCKO4z-tVssmQ.png" /><figcaption>Amazon EC2 price comparison</figcaption></figure><p><strong>Amazon Aurora mySQL with a db.r5.large (reserved N/A in Zurich)</strong></p><ul><li>9.38% between Ireland and Frankfurt</li><li>10.00% between Frankfurt and Zurich</li><li>20.31% between Ireland and Zurich</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*Xaa0NpYOooWn-Zt7JaeKCA.png" /><figcaption>Amazon Aurora price comparison</figcaption></figure><p><strong>Amazon EFS in throughput mode with 100GB and 20/80 split</strong></p><ul><li>8.49% (9.04%) between Ireland and Frankfurt</li><li>17.47% (19.17%) between Frankfurt and Zurich</li><li>27.44% (30.003%) between Ireland and Zurich</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*ajzE8DdpNDJd8Tst6qYTBQ.png" /><figcaption>Amazon EFS price comparison</figcaption></figure><h4>What does this mean for you?</h4><p>In short, detailed planning gets even more important!</p><p>Before you start, you need to analyze what you want or need to run in Zurich.</p><ul><li>Be prepared to replace components with newly launched services</li><li>Multi-region or cross-region deployments can be a cost-effective (from a TCO perspective) alternative while waiting for the regional launch of a service</li></ul><p>Frequent architecture reviews &amp; cost optimisations, e.g. from AWS Partners are mandatory to get the bests benefits.</p><ul><li>Replace services with more efficient managed services after the release</li><li>Resources which you forgot to delete or got obsolete</li></ul><p>This always applies but gets even more critical because of the available services and expected higher cost</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e59b10e3733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating to Amazon FSx for Windows is easy, isn’t it?]]></title>
            <link>https://medium.com/@fabian_lober/migrating-to-amazon-fsx-for-windows-is-easy-isnt-it-77a48c65cdd5?source=rss-3b2e680e5103------2</link>
            <guid isPermaLink="false">https://medium.com/p/77a48c65cdd5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[windows-file-system]]></category>
            <category><![CDATA[amazon-fsx]]></category>
            <category><![CDATA[gui̇de]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Fabian Lober]]></dc:creator>
            <pubDate>Thu, 02 Feb 2023 18:12:28 GMT</pubDate>
            <atom:updated>2023-08-30T09:13:49.634Z</atom:updated>
            <content:encoded><![CDATA[<p>Cool, then we are done here. Thanks for reading!</p><p>Just kidding. It isn’t. But why?</p><p>To understand this, we need to dive deeper into the topic, and you have a lot of time to read this and the official <a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/what-is.html#">AWS documentation</a>. In advance, it’s more complex as it looks from a distance, and you need to consider many areas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*rsDWlujS9kP-lQ9eTD0J4Q.png" /><figcaption>Amazon FSx for Windows File Server</figcaption></figure><h3>Let’s first take a look at what Amazon FSx is about.</h3><p>Amazon FSx is a fully managed service that makes it easy to set up and operate file storage in the AWS cloud. It provides three native AWS major file storage options: Amazon FSx for Lustre, Amazon FSx for Windows File Server and Amazon FSx for OpenZFS.</p><p>Amazon FSx for Windows File Server is designed for use cases that require Windows-based file storage, such as running Windows-based applications or storing data accessed by Windows clients. You can create a file system fully compatible with Windows and access it using the standard SMB (version 2.0 to 3.1.1) protocol.</p><h3>Why should you use Amazon FSx?</h3><p>One of the main benefits of using Amazon FSx for Windows File Server is that it provides a simple and cost-effective way to run Windows-based file storage in AWS. You don’t have to worry about setting up or managing the underlying infrastructure, and you can quickly scale your file system size and speed as needed to meet the changing demands of your applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*EdNToHIc5H7TaSyu" /><figcaption>Amazon FSx for Windows with a local File Gateway for faster client access</figcaption></figure><p>Amazon FSx can run your applications on EC2 and access your file system, making it easy to scale your computing resources as needed or clients in and out of AWS like Amazon AppStream, hybrid file share via VPN and with/over Storage Gateway, replication for disaster recovery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/0*4Ck_boaIOe1I50PP" /><figcaption>Amazon FSx for Windows in use with Amazon AppStream 2.0</figcaption></figure><blockquote>Amazon FSx is a massive area with many hidden stumbling stones. Taking a look at everything would make this blog post into a book. But promised, more will follow!</blockquote><h3>What are the goals?</h3><p>When migrating to AWS FSx for Windows, we focus on scalability, flexibility (both size and performance), availability (deployment options, cross-region) and reachability (connectivity). In addition, we keep an eye on related tasks like backup and disaster recovery.</p><p>With this in mind, we get the most value while keeping the costs down.</p><p>We want to avoid a one-to-one migration of all data into one Amazon FSx file share. In this case, we must select the required speed, availability and backup according to the highest standard, creating unnecessary costs.</p><p>A migration strategy could look like this:</p><ul><li>Migrating the archive folder to a Single-AZ HDD-based share.</li><li>Migrate the company file share to a Multi-AZ HDD-based share with Storage Gateway running on-premise.</li><li>Migrate &amp; refactor the on-premise application, which needs a high-performance share to AWS.</li><li>Store the infrequent read &amp; re-creatable data, which must always be available, to a Multi-AZ HDD-based share without a backup, no data deduplication and shadow copies.</li></ul><h3>So what does a migration looks like?</h3><p>We break it down into the well-known three phases Discovery, Planning, and Migration, which I will cover in the following chapters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WkKnAlLpu5NkP1QaLizYSQ.png" /></figure><h4>Discovery</h4><p>First, we need to understand what we need to migrate, how it’s used and who is responsible. We collect all results in a template to keep them centrally and unified.</p><p>We start with the current infrastructure, like the fileserver and storage hardware. The network setup with the internet connection, bandwidth and capacity utilisation. If available, how is the current AWS environment set up, or will it be?</p><p>For the integration, it’s also necessary to know the existing Active Directory setup.</p><p>To understand how we can match the data to new file shares, we need to answer the following questions:</p><ul><li>What are the current size and amount of files?</li><li>Which clients are accessing the data? From where? How often, and what do they do (write, read)?</li><li>What type of data is stored, and for what it’s used?</li><li>What are the security requirements?</li><li>What are the expected RTO and RPO?</li><li>Which features are used on the file system? E.g. Shadow Copies, Data Deduplication, etc</li><li>Are there any third-party tools in place?</li></ul><p>Knowledge about possible downtimes, cutover windows, the business impact, and availability hours is crucial to plan the migration.</p><p>Last, it’s essential to understand the timeline and reason for migrating.</p><p>To clarify many of these questions talking to all stakeholders, like application owners, security, etc., is necessary. Looking at graphs in monitoring solutions for multiple timeframes can help determine the current throughput or IOPS.</p><p>If there is something unclear or doubts are upcoming, running a PoC can help to clarify these, validate assumptions or collect metrics.</p><blockquote>Because of the nature of the system, it must be defined if you either get access to the fileserver via an Active Directory user or the IT support with all tasks related to the sync and file server like creating shares, setting up schedules for VS, etc.</blockquote><h4>Planning</h4><p>With all data by hand, we start planning. While doing this, we must remember that we can’t switch the disk and deployment types and shrink the volume without a backup and restore.</p><p>We match the data to FSx shares and specify the deployment type, initial size, disk type, and throughput. The backup and DR also influence where to put which data. For each share, a DNS alias will be created so that it can be easily recognised.</p><p>For connectivity, the network needs to be planned. The exact needs depend on the client&#39;s locations and access pattern, the data, the migration tool, and the Active Directory setup.</p><p>For example, you do not need a VPN if you plan to migrate entirely to AWS and have no on-premise clients or connections. But if your Active Directory stays on-premise, you would need one, regardless of where your clients connect to the FSx.</p><blockquote>AWS DataSync can work over a public endpoint. The migration can be started before a VPN is in place.</blockquote><p>For the Active Directory integration, you need to be able to resolve the DNS names of the AD servers and also a service account if you connect to a self-managed Microsoft AD.</p><p>The service account, at a minimum, the following permissions in the OU that you’re joining the file system to:</p><ul><li>Delegated permissions to join computers to the domain.</li><li>Ability to reset passwords</li><li>Ability to restrict accounts from reading and writing data</li><li>Validated ability to write to the DNS hostname</li><li>Validated ability to write the service principal name</li><li>Be delegated control to create and delete computer objects.</li><li>Validated ability to read and write Account Restrictions</li></ul><p>AWS DataSync needs a user to mount and access your SMB and FSx for Windows locations. This can be a local user on your Windows file server or a domain user defined in your Microsoft Active Directory.</p><p>DataSync requires the <strong>SE_RESTORE_NAME</strong> and the <strong>SE_SECURITY_NAME</strong> privilege.</p><p>The source and destination locations must belong to the same Microsoft Active Directory domain or have an Active Directory trust relationship between their domains.</p><blockquote>Understanding how the right performance can be archived is such a complex topic that an additional blog post concentrating on this will follow. Generally, it’s way more complicated to match the right performance with HDD than SSD.</blockquote><blockquote>Data Deduplication and shadow copies schedules can only be set on a per-file share level!</blockquote><blockquote>For the migration plan, it’s essential to know the requirements and dependencies.</blockquote><p><strong>What about the migration and running costs?</strong></p><p>For running Amazon FSx for Windows, you should consider the following:</p><ul><li>Multi-AZ is more expensive than Single-AZ (GB-month ~1.7x &amp; MBps-month ~2.1x)</li><li>HDD is around 1/10 of the SSD costs (Single-AZ &amp; Multi-AZ)</li><li>For tiny volumes, throughput is one of the biggest costs drivers (e.g. 128MBps: $309.76 Single-AZ / $633.60 Multi-AZ)</li><li>You pay for each GB data transfer inside of AWS and out to your on-premise!</li></ul><p><strong>Pricing Examples</strong></p><p>Assume you migrate a 10TB (raw) file share to HDD-based storage in the Frankfurt (eu-central-1) region.</p><p>Based on typical deduplication savings of 50%, we provision a 5 TB Multi-AZ file system with 16 MBps of throughput capacity. The needed backup storage is 5 TB in this example.</p><p>The total monthly costs will be ~$499.5/Month ($0.049/GB/Month) and can be broken down into:</p><ul><li>Storage: $150 (5 TB x $0.03 GB-month)</li><li>Throughput: $79.5 (16 MBps x $4.95/MBps-month)</li><li>Backup: $270 (5 TB x $0.054/GB-month)</li></ul><p>For the migration with AWS DataSync, you pay $0.0125 per GB for data copied.</p><p>If you migrate the 10 TB from a self-managed server to Amazon FSx for Windows File Server, the initial sync cost will be around $128.00.</p><p>More on <a href="https://aws.amazon.com/datasync/pricing/?nc1=h_ls">Online Data Transfer and Migration — AWS DataSync — Amazon Web Services</a> and <a href="https://aws.amazon.com/fsx/windows/pricing/?nc1=h_ls">Amazon FSx for Windows File Server Pricing — Amazon Web Services</a>.</p><h4>Migration</h4><p>The two primary tools used are AWS DataSync and Robocopy, while DataSync is the preferred solution. For massive amounts of data, alternatives could be considered, but these don’t work directly from source to target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qyx1tCbuvyN4c8lN" /><figcaption>Migration with AWS DataSync from on-premise over a Public Endpoint a Multi-AZ Amazon FSx</figcaption></figure><blockquote>It can be tricky to migrate a file server with a high deduplication rate to FSx without a backup &amp; restore or having an overprovisioned file share.</blockquote><p>First, we set up the FSx file shares with the predefined settings, create the target folders, set the FSx and AWS backup and the maintenance window. We select a higher throughput than calculated to have a buffer.</p><p>For DataSync, we need to set up the agent on your local hypervisor and create the sources and target locations, which we then combine on the sync tasks. Remember that locations can’t be changed afterwards!</p><p>When creating DataSync tasks, a bandwidth limit should be set to avoid impacting other clients. Transferring only specific folders in one task can help with performance issues and increase speed when running multiple agents on huge file shares.</p><p>For troubleshooting, it’s helpful to log <strong>at least</strong> the errors to CloudWatch.</p><p>Before the first sync, you should disable the data deduplication jobs on the on-premise file server.</p><p>Now we can start syncing the data with AWS DataSync without a final data verification (mode “Check integrity during transfer”).</p><p>You can enable data deduplication now on the FSx file share and let it run until you reach the final ratio. If you are left with tons of free space, you can make a backup &amp; restore to shrink it.</p><p>For the cutover, verify that all clients can access the file share and all dependencies are solved. Then set the on-premise file share to read-only and run the final sync in the mode “Verify all data in the destination”</p><p>Now you can switch your clients either by remapping your clients in your GPO or a DNS change resolving now to the default DNS name of the Amazon FSx file system instead of the original file system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/0*U-VBcFN1mZ5wJzDj" /><figcaption>AWS DataSync data verification options</figcaption></figure><p>If not done, you can enable data deduplication and shadow copies on your FSx file share and set the schedules according to your needs.</p><p><strong>What’s essential?</strong></p><p>For larger shares with many files, which should be HDD-based in the end, it’s highly recommended to set up an SSD-based file share and restore it later to HDD. If not, typically, the sync and verification process kills the HDD throughput and, with this, the performance. There will also be a performance impact on the source server.</p><p>If you need to migrate fast, you could sync everything to one share and, from there, inside AWS to your target file shares.</p><p>Data Deduplication can cause problems with your performance (mostly on HDD-based file shares) <strong>and </strong>synchronization!</p><p>Transferring specific folders in one task helps with performance issues and increases the speed but requires running multiple agents parallel (Only one active sync per agent is possible).</p><p>Scaling is only available 6 hours after the last increase or the storage optimisation process has been completed, whichever time is longer. The optimisation process takes time (from a few hours to a few days). In addition, it has an impact on the performance of your file share (mostly critical on small and medium HDD-based file shares)</p><p>Each storage capacity increase must be 10% of the current capacity, up to the maximum allowed value of 65 TiB.</p><h4>Operate your Amazon FSx for Windows file shares</h4><p>As Amazon FSx is a managed service, the effort to operate it is pretty low.</p><p>AWS is taking care of the routine software patching for the Microsoft Windows Server serving FSx. You need to select the maintenance time slot and shouldn’t forget the impact on the availability during this time. You should expect that your Single-AZ file system will be unavailable, and your Multi-AZ file systems will automatically failover and failback. A failover typically completes in less than 30 seconds, and failback to the original Multi-AZ configuration also completes in less than 30 seconds.</p><p>For monitoring, you can use Amazon CloudWatch, which automatically collects metrics from FSx. The guide in the AWS documentation is so good that there is no need for a summary (<a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/monitoring_overview.html">Monitoring FSx for Windows File Server</a>).</p><p>Logging can be broken down into AWS events, file system audit, and file system event logging.</p><ul><li>We have the Cloudtrail logs for the AWS site, which contains all API calls for Amazon FSx as events.</li><li>File access auditing enables you to record end-user accesses of individual files, folders, and file shares based on your defined audit controls.</li><li>The event logs are automatically sent to CloudWatch Logs.</li></ul><p>AWS provides a detailed guide for troubleshooting issues with your FSx file shares (<a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/troubleshooting.html">Troubleshooting Amazon FSx</a><a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/troubleshooting.html)">)</a>.</p><blockquote>AWS provides code for an automatic storage size increase, which you can also adapt to your needs, e.g. with approval steps. (<a href="https://docs.aws.amazon.com/fsx/latest/WindowsGuide/managing-storage-capacity.html#automate-storage-capacity-increase">Increasing the storage capacity of an FSx for Windows File Server file system dynamically</a>)</blockquote><h4>My conclusion about migrating to Amazon FSx for Windows!</h4><p>Amazon FSx is a fantastic service which takes a lot of burden from your IT department and frees them up. Migrations can be done easily and quickly using AWS native tools and trusted advisors.</p><p>You can add new shares, scale the size or performance in less than minutes. These processes can even be automated. Also, creating high-available shares with sophisticated backup and disaster recovery can be done easily. But at the same time, it’s a complex system where many things impact how you plan, migrate, operate etc.</p><p>The architecture and migration must plan very good to lay the foundation for a successful outcome. To do so, discovering is very important and must be done well. Here is also the customer needed and responsible for delivering the correct data. The verification process can take a while for large amounts of data and slow down the cutover.</p><p>When your share runs out of burst credits, you face a similar situation as with EC2 t* instances. It’s nearly impossible to use. Keep a good eye on them via your monitoring!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77a48c65cdd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>