<?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 Marios Gavriil on Medium]]></title>
        <description><![CDATA[Stories by Marios Gavriil on Medium]]></description>
        <link>https://medium.com/@mikopos?source=rss-b32d06268f99------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aSdWevFPB6RguvaWXYKQdA.jpeg</url>
            <title>Stories by Marios Gavriil on Medium</title>
            <link>https://medium.com/@mikopos?source=rss-b32d06268f99------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 12:26:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mikopos/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[5MinutesDevStory : “The CAP Theorem Exposed: Why You Can’t Have It All in Distributed Systems!”]]></title>
            <link>https://medium.com/@mikopos/5minutesdevstory-the-cap-theorem-exposed-why-you-cant-have-it-all-in-distributed-systems-2f231746cfe3?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f231746cfe3</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 22:48:15 GMT</pubDate>
            <atom:updated>2025-03-10T22:48:15.464Z</atom:updated>
            <content:encoded><![CDATA[<h3>5MinutesDevStory : <strong>“The </strong><a href="https://en.wikipedia.org/wiki/CAP_theorem"><strong>CAP Theorem</strong></a><strong> Exposed: Why You Can’t Have It All in </strong><a href="https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture"><strong>Distributed Systems</strong></a><strong>!”</strong> 🚀🔥</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PHcJQpwiROWUoODz9_MRbQ.jpeg" /></figure><p>The <a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP theorem</a> is a fundamental concept in <a href="https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture">distributed systems</a> that helps us understand the trade-offs involved in designing and managing databases. It states that in a <a href="https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture">distributed system</a>, you can only guarantee <strong>two out of three properties</strong> at the same time:</p><ul><li><strong>Consistency (C )</strong></li><li><strong>Availability (A)</strong></li><li><strong>Partition Tolerance (P)</strong></li></ul><p>Let’s break down each component, analyze why partition tolerance is unavoidable, and explore real-world implications.</p><h3>Why Partition Tolerance is Non-Negotiable</h3><p>In <a href="https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture">distributed systems</a>, <strong>network partitions</strong> (e.g., dropped connections, server failures) are inevitable. Partition tolerance ensures the system continues operating even if nodes can’t communicate.</p><p><strong>Example</strong>: If two data centers lose connectivity, a partition-tolerant system won’t crash.</p><p><strong>Reality</strong>: All <a href="https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture">distributed systems</a> must prioritize partition tolerance. This means <strong>you’re really choosing between C and A</strong>.</p><h3>What Does “Consistency” Mean in CAP?</h3><p>In <a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP</a>, <strong>consistency means strong consistency</strong>:</p><p>Every read receives the <strong>most recent write</strong> or an error.</p><p>All nodes see the same data simultaneously.</p><pre>[Strong Consistency]  <br>Node A (Latest Data: X=5) → Node B (Syncs to X=5)  <br>Read from any node → Always X=5</pre><p><strong>Weak consistency</strong> (e.g., eventual consistency) is <em>not</em> what <a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP </a>refers to.</p><h3>What Happens to Availability-First Systems?</h3><p>A database prioritizing <strong>availability</strong> will respond to every request, even with stale data during partitions.</p><pre>[AP System During Partition]  <br>Node A (X=5) ---- Network Partition ---- Node B (X=4)  <br>User reads Node B → Returns X=4 (stale but available)</pre><p><strong>Pros:</strong></p><ul><li>Zero downtime.</li><li>Ideal for social media, streaming, or e-commerce.</li></ul><p><strong>Cons:</strong></p><ul><li>Temporary inconsistencies (e.g., outdated product stock).</li></ul><h3>Are Availability-First Databases Consistent?</h3><p><strong>No</strong> — they prioritize availability over <em>strong</em> consistency. Most use <strong>eventual consistency</strong>:</p><pre>[Eventual Consistency]  <br>Node A (X=5) → Syncs to Node B → Node B eventually becomes X=5</pre><ul><li>Example databases: Cassandra, DynamoDB.</li></ul><h3>Consistency vs. Availability: Which to Prioritize?</h3><p><strong>Prioritize Consistency (CP) | Prioritize Availability (AP)</strong></p><h3><a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP </a>Theorem Visualized</h3><h3>1. <a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP </a>Venn Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/1*0Qb9VF9S_2_P_9FYgyY1kg.png" /><figcaption><a href="https://en.wikipedia.org/wiki/CAP_theorem">The Cap Theorem</a> unveiled</figcaption></figure><pre>       +---------------------+<br>       |      CAP Theorem    |<br>       +---------------------+<br>       |    🟢 Consistency   |<br>       |    🔵 Availability  |<br>       |    🟠 Partition     |<br>       +---------------------+<br>       Overlap Labels:  <br>       - CA: Rare (no real-world systems)  <br>       - CP: Strong consistency + partition tolerance  <br>       - AP: High availability + partition tolerance</pre><h3>2. Network Partition Scenario</h3><pre>Node A 🟢 (X=5)          Node B 🔵 (X=4)  <br>           \             /  <br>            \           / <br>             \         / <br>            ⚡💥⚡ (Network Partition)  <br>CP System: Node B stops responding ❌  <br>AP System: Node B serves stale data ⚠️</pre><h3>Conclusion</h3><p>Summing up, if you mind about accuracy, <strong>CP </strong>is your thing. If resilience is your priority, you should go with <strong>AP</strong>. Keep in mind though that Partition Tolerance is non negotiable in <a href="https://www.atlassian.com/microservices/microservices-architecture/distributed-architecture">distributed systems</a>. So build wisely your application and remember to use <a href="https://en.wikipedia.org/wiki/CAP_theorem">CAP theorem</a> as a guide for the trade offs and not as a strict rule.🔨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f231746cfe3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Minutes Dev Story | Idempotency in APIs- Building Reliable Systems the Fun Way]]></title>
            <link>https://medium.com/@mikopos/5-minutes-dev-story-idempotency-in-apis-building-reliable-systems-the-fun-way-070d2949571f?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/070d2949571f</guid>
            <category><![CDATA[idempotency]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Fri, 21 Feb 2025 19:08:01 GMT</pubDate>
            <atom:updated>2025-02-21T19:08:01.462Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhyBhmLZ5I3_JGGx_V6kfQ.png" /></figure><p>Imagine you’re ordering your favorite pizza online. You click “order,” but due to a hiccup with your internet, you’re not sure if the order went through. So, you click “order” again-and maybe even a third time-fearing your hunger might not wait. Now, imagine if the pizzeria processed all those orders. Suddenly, you’re stuck with three pizzas instead of one. Not only is that confusing for you, but it’s also a logistical nightmare for the restaurant!</p><p>This everyday scenario mirrors a common challenge in the world of <strong>Application Programming Interfaces (APIs)</strong>: handling duplicate requests gracefully. The solution? <strong>Idempotency</strong>. At its core, idempotency ensures that whether you press the button once or multiple times, the outcome remains the same. In API lingo, it’s all about making sure that repeating the same request doesn’t cause unintended side effects.</p><p>In this article, we’ll explore what idempotency means, why it’s so valuable, and how you can build idempotent APIs in a way that’s both robust and a bit fun. We’ll dive into practical techniques-from leveraging unique constraints in databases to clever in-memory tracking and distributed caches. So, sit back, relax, and let’s make idempotency less of a head-scratcher and more of a trusted friend in your API toolkit.</p><h3>What on Earth Is Idempotency?</h3><p>Before we dive deep, let’s break down the term “idempotency” into everyday language. In mathematics, an operation is called idempotent if doing it once or several times yields the same result. For instance, think about pressing the “reset” button on your TV. Whether you press it once or five times in a row, your TV resets just once-because extra presses don’t make a difference.</p><p>Now, let’s translate that into API speak. An idempotent API operation is one where no matter how many times you send the same request, the state of the system remains unchanged after the first successful execution. It’s like having a superpower for your API: no matter how many times it gets hit with the same command, it only acts once!</p><p>This property is incredibly useful for operations like creating orders, processing payments, or updating records. By ensuring that multiple identical requests don’t lead to duplicate records or unexpected behavior, idempotency protects both your system and your users from accidental mishaps.</p><h3>Why Should We Care About Idempotency?</h3><p>Let’s get real-life isn’t always perfect, and neither are networks or devices. When your app is interacting with an API, a host of issues can crop up: network timeouts, dropped connections, or just plain old user error (like double-clicking a button out of nervous excitement). This is where idempotency steps in as the unsung hero of API design.</p><h3>A Smoother User Experience</h3><p>Picture this: you’re using a mobile banking app, and you tap “transfer funds.” Due to a network glitch, you’re not sure if the money moved. In a non-idempotent system, if you press “transfer” again, you might end up sending the money twice. That’s a recipe for disaster! But with idempotency, the app can detect that the transfer has already been processed, and no extra funds are sent out-saving you from an embarrassing bank call later.</p><h3>Guarding Against Network Gremlins</h3><p>We all know that networks can be unpredictable. A brief lag here or an unexpected timeout there can cause your API to receive the same request multiple times. Idempotency acts like a safety net, ensuring that even if the same message lands on your server more than once, the effect remains as if it were received a single time.</p><h3>Keeping Distributed Systems in Sync</h3><p>In today’s tech landscape, many systems aren’t built on a single server-they’re spread out over multiple machines and even across different data centers. In such distributed systems, making sure that every node is on the same page is a tall order. By designing your API endpoints to be idempotent, you make sure that even if two nodes receive the same command, the end state of your system remains consistent.</p><h3>Making Life Easier for Developers</h3><p>When your API guarantees idempotency, developers can sleep a little easier. There’s no need for complex client-side logic to track which requests have already been made. Instead, clients can simply fire off their requests and trust that the API will handle duplicates intelligently. This simplification leads to cleaner, more maintainable code-something every developer can appreciate.</p><h3>How Do We Build Idempotent APIs?</h3><p>So, you’re sold on idempotency and ready to implement it. But how exactly do you build an API that’s immune to the chaos of duplicate requests? Let’s walk through some tried-and-true techniques, explained in plain language and with a touch of fun.</p><h3>1. Database Unique Constraints: The Old Reliable</h3><p>One of the simplest ways to enforce idempotency is to rely on the database itself. By setting up a unique constraint-say, on an order number or transaction ID-you ensure that the database will automatically reject duplicate entries. Think of it as a bouncer at the door of your database club, only letting in each unique request once.</p><p><strong>How It Works:</strong></p><p><strong>The Upside:</strong><br> It’s simple and leverages the built-in capabilities of your database, ensuring atomicity in the process.</p><p><strong>The Downside:</strong><br> Relying solely on your database can sometimes become a bottleneck if the volume of requests is high. It might also require careful error handling to avoid confusing your users.</p><h3>2. In-Memory Tracking: The Quick Fix</h3><p>For operations where you don’t need to persist state over a long period, tracking requests in memory is a speedy solution. This method uses a simple data structure (like a hash map) to store request identifiers and their outcomes.</p><p><strong>How It Works:</strong></p><p><strong>The Upside:</strong><br> It’s super fast, as in-memory operations are blazingly quick-ideal for high-speed applications.</p><p><strong>The Downside:</strong><br> Since the data is stored in volatile memory, it will be lost if the server restarts. Plus, in a multi-server environment, you need a way to share this memory across nodes.</p><h3>3. Distributed Caches: The Modern Marvel</h3><p>In a world where your application might be running on several servers across the globe, a distributed cache like Redis or Memcached comes in handy. This approach combines the speed of in-memory operations with the resilience needed for distributed systems.</p><p><strong>How It Works:</strong></p><p><strong>The Upside:</strong><br> It scales well and ensures consistency across multiple nodes, making it perfect for modern cloud environments.</p><p><strong>The Downside:</strong><br> It introduces extra complexity in your infrastructure, and while the cache is fast, it’s a tad slower than pure in-memory operations on a single server.</p><h3>4. Message Deduplication: The Async Hero</h3><p>For systems that process tasks asynchronously-think message queues and background jobs-message deduplication is a must. This technique ensures that even if a message is delivered more than once, it’s only processed once.</p><p><strong>How It Works:</strong></p><p><strong>The Upside:</strong><br> It’s particularly effective in asynchronous, event-driven architectures where retries are common.</p><p><strong>The Downside:</strong><br> Maintaining a deduplication store requires careful thought-especially around how long to keep processed IDs and how to handle potential race conditions.</p><h3>5. Other Clever Techniques</h3><p>Beyond the main strategies we’ve discussed, there are a few other tricks you can pull out of your API design toolkit:</p><h4>Real-World Examples: Idempotency in Action</h4><p>Let’s bring this all together with some real-world scenarios. How exactly does idempotency help in everyday applications?</p><h4>Payment Processing</h4><p>Imagine you’re using an online payment system. You click “pay” and the system processes your payment-but due to a temporary glitch, the response never makes it back to you. You click “pay” again. In a non-idempotent system, this could lead to your card being charged twice! With idempotency, the system recognizes that the same payment request is being made, and only one transaction is processed. This not only saves you from financial headaches but also builds trust in the service.</p><h4>Order Management</h4><p>In the bustling world of e-commerce, duplicate orders can be a nightmare. Let’s say a customer’s internet connection is spotty, and they accidentally submit an order twice. An idempotent API can detect the duplicate order-perhaps using a unique order key or transaction ID-and ensure that the order is processed only once. This helps avoid inventory issues and customer complaints, keeping the shopping experience smooth and enjoyable.</p><h4>Microservices and Distributed Systems</h4><p>Modern applications often consist of multiple microservices that communicate asynchronously. For example, when an order is placed, one service might handle the payment while another takes care of shipping. If one service sends a message multiple times due to a retry mechanism, idempotency ensures that downstream services process that message just once. This is crucial for maintaining consistency and reliability in a distributed system where messages can be delayed, duplicated, or even lost.</p><h3>Best Practices and Fun Tips for Implementing Idempotency</h3><p>Building idempotent APIs isn’t just about slapping on a few techniques-it’s about thoughtful design. Here are some best practices and fun tips to keep in mind:</p><ol><li><strong>Document Your API Clearly:</strong><br> Make sure your API documentation clearly explains which endpoints are idempotent and how clients should use idempotency keys or other mechanisms. Clear documentation reduces confusion and ensures developers know how to interact with your API correctly.</li><li><strong>Combine Strategies for Extra Safety:</strong><br> Don’t rely on just one technique. For example, you might use database unique constraints along with distributed caches. This layered approach adds robustness and covers any gaps that one method alone might leave.</li><li><strong>Monitor and Log Duplicate Requests:</strong><br> Keep an eye on how often duplicate requests occur. Logging these incidents can help you fine-tune your system and identify potential issues in client behavior or network reliability.</li><li><strong>Test, Test, Test:</strong><br> Use automated tests to simulate duplicate requests, network timeouts, and other common failure scenarios. The more you test, the more confident you can be in your API’s resilience.</li><li><strong>Stay Flexible and Evolve:</strong><br> As your system grows, be prepared to adjust your idempotency strategies. What works well for a small startup might need to scale up as your user base grows. Stay informed about new techniques and technologies that can further improve your API’s reliability.</li></ol><h3>Wrapping It Up</h3><p>At the end of the day, idempotency isn’t just a technical term-it’s a practical tool that makes APIs more reliable, user-friendly, and resilient in the face of real-world challenges. Whether you’re dealing with flaky networks, user impatience, or the complexity of distributed systems, idempotency ensures that your system behaves predictably and gracefully under pressure.</p><p>By understanding and implementing idempotency, you’re not just building a better API; you’re creating a system that users can trust. Imagine a world where every click, tap, or swipe leads to the right outcome, regardless of network hiccups or duplicate actions. That’s the promise of idempotent APIs-a promise of reliability and peace of mind.</p><p>So next time you’re designing an API, remember: it’s okay to double-check your work, but your API shouldn’t double-do it. Embrace idempotency and let your API handle retries like a pro. With smart design choices-whether you’re using database constraints, in-memory tracking, distributed caches, or even message deduplication-you can build a system that remains robust no matter what.</p><p>Every line of code is an opportunity to make your system smarter and more resilient. Think of idempotency as your API’s built-in “do-over” button-a way to handle mistakes gracefully without leaving a trace of error. And as developers, isn’t that what we all want? A system that’s forgiving of errors and reliable under pressure.</p><p>In conclusion, idempotency is more than just a design pattern. It’s a mindset-one that embraces the unpredictable nature of technology and turns it into an opportunity for building trust. Whether you’re managing financial transactions, processing orders, or coordinating microservices, idempotency provides a robust framework for ensuring that your API does exactly what it’s supposed to do-once, and only once.</p><p>So here’s to building APIs that are as reliable as your favorite pizza delivery, as trustworthy as your go-to bank app, and as resilient as your best-laid plans. Embrace idempotency, and let your APIs shine with the confidence of knowing that no matter how many times that “order” button is pressed, everything will work out just fine.</p><p>Happy coding, and may your APIs always be idempotent!</p><p><em>Originally published at </em><a href="https://mariosgavriil.com//tech/2025/02/21/Idempotency.html"><em>https://mariosgavriil.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=070d2949571f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5MinutesDEVStory | From 50-Seconds Queries to Lightning-Fast — My Epic Journey Optimizing MongoDB]]></title>
            <link>https://medium.com/@mikopos/5minutesdevstory-from-50-seconds-queries-to-lightning-fast-my-epic-journey-optimizing-mongodb-3da62d063514?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/3da62d063514</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[documentdb]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Sun, 09 Feb 2025 14:46:58 GMT</pubDate>
            <atom:updated>2025-02-09T14:46:58.196Z</atom:updated>
            <content:encoded><![CDATA[<h3>5MinutesDEVStory | From 50-Seconds Queries to Lightning-Fast — My Epic Journey Optimizing MongoDB</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*hHxty9b0tG5055ny6CxQEA.png" /></figure><blockquote><strong><em>TL;DR</em></strong><em>: 5MinutesDEvStory is back with a life changing dev experience. I transformed a painfully slow MongoDB query (about 50 seconds) into a near-instant (sub-10ms) operation. This article showcases the entire process-from devising compound indexes, streamlining aggregation pipelines, and handling pagination and sorting, to exploring in-memory versus database-based sorting and employing Java virtual threads for efficient concurrency. If you’ve faced similar bottlenecks or timeouts, read on.</em></blockquote><h3>Table of Contents</h3><ol><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#prologue--realizing-the-problem">Prologue — Realizing the Problem</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#chapter-1--early-challenges">Chapter 1 — Early Challenges</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#chapter-2--key-concepts-indexing-sort-skip-and-limit">Chapter 2 — Key Concepts: Indexing, $sort, $skip, and $limit</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#chapter-3--experimenting-with-batching">Chapter 3 — Experimenting with Batching</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#chapter-4--searching-for-the-ideal-approach">Chapter 4 — Searching for the Ideal Approach</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#chapter-5--full-text-queries-and-textcriteria">Chapter 5 — Full-Text Queries and TextCriteria</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#chapter-6--java-concurrency-from-fixed-threads-to-virtual-threads">Chapter 6 — Java Concurrency: From Fixed Threads to Virtual Threads</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#chapter-7--the-final-optimized-solution">Chapter 7 — The Final Optimized Solution</a></li><li><a href="http://mariosgavriil.com/tech/2025/02/05/from-25-secdonds-to-lighting-fast.html#epilogue--performance-gains--future-directions">Epilogue — Performance Gains &amp; Future Directions</a></li></ol><h3>Prologue — Realizing the Problem</h3><p>It all started when the application went live and the datasets from some thousands enlarged to many millions. Initially, I believed that the queries would execute quickly, however user feedback indicated significant timeouts. In practice, the aggregation pipeline was taking nearly 50 seconds to return a single paginated set of results even for the last day. While some indexes were in place, the query plan consistently resorted to a massive <strong>COLLSCAN</strong> (collection scan), highlighting several issues:</p><ol><li>The existing indexes did not align well with the filtering or sorting.</li><li>$skip + $limit pagination can degrade performance without proper indexing.</li><li>Sorting is only efficient when MongoDB leverages the appropriate index.</li></ol><p>This set the stage for an in-depth exploration of MongoDB and Spring Data, specifically focusing on performance improvements and concurrency strategies.</p><h3>Chapter 1 — Early Challenges</h3><h3>Scenario</h3><p>We employed an aggregator pipeline of this form</p><p>Although it looked straightforward-especially given that date.dateTime was indexed- explain(&quot;executionStats&quot;) painted a different picture:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><p>At almost 51 seconds, the pipeline scanned thousands of documents, applying a sort in memory, and then skipped to the relevant offset. This indicated that the index on date.dateTime alone was insufficient or mismatched.</p><h3>Lesson #1</h3><p>Whenever your <strong>sort</strong> fields do not perfectly match the underlying index, MongoDB defaults to an in-memory sort, which is by far computationally expensive and explains the protracted runtime.</p><h3>Chapter 2 — Key Concepts: Indexing, $sort, $skip, and $limit</h3><h3>$sort</h3><ul><li><strong>Index-based</strong>: If your sort field is covered by an index, MongoDB avoids an in-memory sort.</li><li><strong>In-memory</strong>: If no relevant index exists, MongoDB allocates resources to perform a separate sorting phase, often scanning large portions of the collection.</li></ul><h3>$skip and $limit</h3><ul><li><strong>$limit</strong>: Typically low cost if the data is already sorted using an index.</li><li><strong>$skip</strong>: Can cause substantial overhead if MongoDB must read many documents to skip them, unless the sort is handled directly through the index.</li></ul><h3>Compound Index</h3><p>A multi-field index is invaluable if you filter or sort on multiple fields. For instance:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><p>By aligning the fields used for filtering ( userId, status) and sorting ( date.dateTime), you can vastly improve performance.</p><h3>Chapter 3 — Experimenting with Batching</h3><p>After addressing the issue with indexes, I assumed that apart from pagination batching will reduce overhead by retrieving data in segments. so I ended up with an implementation like the below one:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><p><strong>Advantages</strong>:</p><ul><li>Potentially mitigates memory usage for massive datasets.</li><li>Suitable for data migrations or large-scale batch analytics.</li></ul><p><strong>Drawbacks</strong>:</p><ul><li>Introduces complexity.</li><li>Fails to fix underlying index mismatches if each sub-query still scans large swaths of data.</li></ul><p>Ultimately, batching proved not to be the primary solution for a query returning just 50 results. Correctly configured indexes remained the decisive factor.</p><h3>Chapter 4 — Searching for the Ideal Approach</h3><p>I evaluated various techniques in the twilight of the batching failure:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><ol><li><strong>Aggregation Pipeline</strong></li><li><strong>Streaming with </strong><strong>find()</strong></li></ol><ul><li>Simpler in many respects, especially with .hint() to force an index.</li><li>Less flexible for sophisticated transformations.</li></ul><p>3.<strong> In-memory Sorting</strong></p><ul><li>Fetch results and sort them in Java if the user wants a sort that is not covered by existing indexes.</li><li>Practical only for relatively small datasets or infrequent usage.</li></ul><h3>Lesson #2</h3><p>Choose the approach that aligns with your data volume and transformation needs. For large datasets or performance-critical queries, ensure $sort leverages a compound index.</p><h3>Chapter 5 — Full-Text Queries and TextCriteria</h3><p>Then came the request for a <strong>free-text search</strong> on text field and I have to introduce Spring Data MongoDB<strong>TextCriteria</strong>:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><p>However, TextCriteria implements CriteriaDefinition, not Criteria, meaning it cannot directly plug into methods like new Criteria().andOperator(...). So I must either:</p><ul><li>Apply two $match stages, one for standard filters and one for text search.</li><li>Carefully merge them if you want a single $match.</li></ul><p>You also need a <strong>text index</strong>:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><h3>Lesson #3</h3><p>Text-based queries require a dedicated text index. Merging them with other filter criteria demands careful handling, since TextCriteria is not the same as Criteria.</p><h3>Chapter 6 — Java Concurrency: From Fixed Threads to Virtual Threads</h3><p>Our query logic involved two parallel tasks:</p><ol><li>The aggregator pipeline.</li><li>A count query to determine the total records.</li></ol><p>Initially, we used:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><p>While functional, scaling it up increased concerns about thread blocking. The advent of <strong>Project Loom</strong> (Java 19+ preview, or Java 21 stable) offered <strong>virtual threads</strong>:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><p>Virtual threads consume fewer resources, allowing you to maintain a direct, blocking style without saturating a limited pool of OS threads. A very good choice for containerized applications.</p><h3>Lesson #4</h3><p>On Java 21 or the Java 19 preview, virtual threads can greatly simplify concurrency. They handle large volumes of blocking tasks without the traditional overhead of a large pool of platform threads.</p><h3>Chapter 7 — The Final Optimized Solution</h3><p>Ultimately, the following methods converged into our cohesive fix:</p><blockquote><strong><em>For the exact code snippet, check out this </em></strong><a href="http://mariosgavriil.com//tech/2025/02/05/from-25-secdonds-to-lighting-fast.html"><strong><em>detailed post</em></strong></a><strong><em>.</em></strong></blockquote><p><strong>Result</strong>: We reduced a 50+ second operation to under 20ms or even single-digit milliseconds on large datasets. The dreaded COLLSCAN or in-memory SORT was effectively avoided.</p><h3>Epilogue — Performance Gains &amp; Future Directions</h3><p>We benchmarked:</p><ul><li><strong>Original aggregator</strong>: ~50 seconds.</li><li><strong>With a proper compound index</strong>: ~8 ms.</li><li><strong>Adding parallel aggregator + count</strong>: near-instant for small result sets.</li><li><strong>Text search</strong>: minimal overhead if the text index is well-defined.</li></ul><p><strong>Possible Next Steps</strong>:</p><ul><li><strong>Partial indexes</strong> if you only care about recent or frequently accessed data.</li><li><strong>Collation</strong> for case-insensitive sorting.</li><li><strong>Sharding</strong> once the dataset outgrows a single node.</li><li><strong>Advanced concurrency</strong> (further exploiting virtual threads).</li></ul><p><strong>Core Message</strong>: Rely on explain(&quot;executionStats&quot;) to confirm the aggregator pipeline is properly indexed. A suitable compound index and an efficient pipeline can drastically enhance performance.</p><h3>Final Words</h3><p>What began as a routine query quickly escalated into a 50-second bottleneck. By leveraging compound indexes, concurrency (even via virtual threads), and occasionally in-memory sorting for edge cases, we achieved a robust and scalable solution.</p><p>If you find yourself dealing with $sort bottlenecks, heavy $skip usage, or text search integration dilemmas, I hope this guide helps you refine your indexing strategy, concurrency approach, and aggregator design. Best of luck, and may your queries always be fast!</p><p>🚀 <em>This post was originally published on my website:</em><br>👉<a href="http://www.mariosgavriil.com/">mariosgavriil.com </a>— where I share Java performance tips, best practices, and deep dives into Java frameworks and much more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3da62d063514" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Minutes DEV Story: AWS Data Protection (Top 3 services)]]></title>
            <link>https://awstip.com/5-minutes-dev-story-aws-data-protection-top-3-services-3d8d63e15d73?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d8d63e15d73</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Wed, 22 Mar 2023 15:54:29 GMT</pubDate>
            <atom:updated>2023-03-27T18:51:13.059Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s world, data protection has become a critical aspect of cloud computing. With the increasing amount of sensitive information being stored and processed in the cloud, it’s imperative to ensure that this data is secure and protected from unauthorized access. Amazon Web Services (AWS) provides a range of data protection services to help customers secure their data. In this article, we will discuss encryption and key management services provided by AWS, including <a href="https://aws.amazon.com/kms/">Amazon Key Management Service (KMS)</a>, <a href="https://aws.amazon.com/certificate-manager/">AWS Certificate Manager (ACM)</a>, and<a href="https://aws.amazon.com/secrets-manager/"> AWS Secrets Manager.</a></p><h3>Speaking of encryption</h3><p>First things first… What exactly is the encryption ?</p><p>Encryption is the process of converting plain text into an unreadable format to protect sensitive information from unauthorized access. Encryption is a crucial component of data protection and is used to secure data at rest and in transit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/0*VCd_Me-N9OfxCO-E.gif" /></figure><p>AWS provides encryption services for data at rest and in transit to protect customer data. For data at rest, AWS offers encryption for Amazon Simple Storage Service (S3) buckets, Amazon Elastic Block Store (EBS) volumes, and Amazon Relational Database Service (RDS) databases. For data in transit, AWS offers encryption for Amazon Virtual Private Cloud (VPC) traffic and Amazon S3 Transfer Acceleration.</p><p>But how we achieve it ?</p><h3><a href="https://aws.amazon.com/kms/">Key Management Service (KMS)</a></h3><p><a href="https://aws.amazon.com/kms/">Amazon Key Management Service (KMS)</a> is a managed service that makes it easy for customers to create, control, and manage the encryption keys used to encrypt their data. <a href="https://aws.amazon.com/kms/">KMS </a>provides a central location to manage encryption keys, making it easier for customers to encrypt their data and manage their encryption keys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Jqboo_4nwXMSRy8.png" /><figcaption><a href="https://aws.amazon.com/kms/">https://aws.amazon.com/kms/</a></figcaption></figure><p><strong>Benefits and Features</strong></p><ul><li>Centralized Key Management: <a href="https://aws.amazon.com/kms/">KMS </a>provides a centralized location to manage encryption keys, making it easier for customers to encrypt their data and manage their encryption keys.</li><li>Easy to Use: <a href="https://aws.amazon.com/kms/">KMS </a>is easy to use and integrates with other AWS services, making it simple for customers to encrypt their data.</li><li>Compliance: <a href="https://aws.amazon.com/kms/">KMS </a>meets a variety of compliance requirements, including PCI DSS, HIPAA, and FedRAMP.</li><li>Auditability: <a href="https://aws.amazon.com/kms/">KMS </a>provides auditing capabilities, making it easier for customers to track key usage and meet regulatory requirements.</li></ul><p><strong>Use Cases</strong></p><ul><li>Encrypting Data: <a href="https://aws.amazon.com/kms/">KMS </a>can be used to encrypt data stored in AWS services, such as S3 and RDS.</li><li>Key Management: <a href="https://aws.amazon.com/kms/">KMS </a>can be used to manage encryption keys for customer applications and services.</li></ul><p><strong><em>Differences between AWS and Customer Key Management</em></strong></p><p>When it comes to key management, customers have the option to either use <a href="https://aws.amazon.com/kms/">AWS KMS</a> or manage their own encryption keys. While both options have their benefits, there are some differences between <a href="https://aws.amazon.com/kms/">AWS KMS</a> and customer key management.</p><ul><li>Cost: <a href="https://aws.amazon.com/kms/">AWS KMS</a> is a managed service, which means that customers pay for the service. On the other hand, customer key management requires customers to manage their own infrastructure, which can be more expensive.</li><li>Security: <a href="https://aws.amazon.com/kms/">AWS KMS</a> is a secure service that is managed by AWS security experts. Customer key management requires customers to manage their own security, which can be challenging.</li><li>Scalability: <a href="https://aws.amazon.com/kms/">AWS KMS</a> is a highly scalable service that can be used to manage encryption keys for large and complex environments. Customer key management can be more challenging to scale.</li></ul><h3><a href="https://aws.amazon.com/certificate-manager/">AWS Certificate Manager (ACM)</a></h3><p><a href="https://aws.amazon.com/certificate-manager/">AWS Certificate Manager (ACM)</a> is a service that makes it easy for customers to manage SSL/TLS certificates. <a href="https://aws.amazon.com/certificate-manager/">ACM </a>provides a simple way to request, deploy, and manage SSL/TLS certificates for applications running on AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zL0rsBDjw-tkE2T_.png" /><figcaption><a href="https://aws.amazon.com/certificate-manager/">https://aws.amazon.com/certificate-manager/</a></figcaption></figure><p><strong>Benefits and Features</strong></p><ul><li>Easy to Use: <a href="https://aws.amazon.com/certificate-manager/">ACM </a>is easy to use and integrates with other AWS services, making it simple for customers to manage SSL/TLS certificates.</li><li>Cost-Effective: <a href="https://aws.amazon.com/certificate-manager/">ACM </a>provides a cost-effective way to manage SSL/TLS certificates, as customers only pay for the certificates they use.</li><li>Secure: <a href="https://aws.amazon.com/certificate-manager/">ACM </a>provides a secure way to manage SSL/TLS certificates, as the certificates are stored in a secure and highly available infrastructure.</li><li>Automated Renewal: <a href="https://aws.amazon.com/certificate-manager/">ACM </a>automates the renewal of SSL/TLS certificates, making it easier for customers to keep their certificates up-to-date.</li></ul><p><strong>Use Cases</strong></p><ul><li>Secure Websites: <a href="https://aws.amazon.com/certificate-manager/">ACM </a>can be used to secure websites running on AWS services, such as Amazon CloudFront and Amazon Elastic Load Balancer.</li><li>Secure Applications: <a href="https://aws.amazon.com/certificate-manager/">ACM </a>can be used to secure applications running on AWS services, such as Amazon Elastic Container Service and Amazon Elastic Kubernetes Service.</li></ul><h3><a href="https://aws.amazon.com/secrets-manager/">AWS Secrets Manager</a></h3><p><a href="https://aws.amazon.com/secrets-manager/">AWS Secrets Manager</a> is a service that makes it easy for customers to store, manage, and rotate secrets, such as database credentials and API keys. <a href="https://aws.amazon.com/secrets-manager/">Secrets Manager</a> provides a secure and scalable way to manage secrets, making it easier for customers to secure their applications and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z32JIUSLLuvEv1HL.png" /><figcaption><a href="https://aws.amazon.com/secrets-manager/">https://aws.amazon.com/secrets-manager/</a></figcaption></figure><p>Benefits and Features</p><ul><li>Secure Storage: <a href="https://aws.amazon.com/secrets-manager/">Secrets Manager</a> provides a secure and scalable way to store secrets, making it easier for customers to protect sensitive information.</li><li>Automated Rotation: <a href="https://aws.amazon.com/secrets-manager/">Secrets Manager</a> automates the rotation of secrets, making it easier for customers to keep their secrets up-to-date.</li><li>Easy to Use: <a href="https://aws.amazon.com/secrets-manager/">Secrets Manager</a> is easy to use and integrates with other AWS services, making it simple for customers to manage secrets.</li></ul><p>Use Cases</p><ul><li>Database Credentials: <a href="https://aws.amazon.com/secrets-manager/">Secrets Manager</a> can be used to store and manage database credentials, making it easier for customers to secure their databases.</li><li>API Keys: <a href="https://aws.amazon.com/secrets-manager/">Secrets Manager</a> can be used to store and manage API keys, making it easier for customers to secure their APIs.</li></ul><h3>Summary</h3><p>In conclusion, AWS provides a range of data protection services, including encryption and key management services, to help customers secure their data. Whether customers are looking to encrypt their data, manage their SSL/TLS certificates, or store and manage secrets, AWS provides a secure and scalable solution to meet their needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d8d63e15d73" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/5-minutes-dev-story-aws-data-protection-top-3-services-3d8d63e15d73">5 Minutes DEV Story: AWS Data Protection (Top 3 services)</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5MinutesDEVStory: IAM Part 3 (2 Services to protect your infrastructure)]]></title>
            <link>https://medium.com/@mikopos/5minutesdevstory-iam-part-3-2-services-to-protect-your-infrastructure-5fcc1c6ab3ab?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fcc1c6ab3ab</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 15:46:44 GMT</pubDate>
            <atom:updated>2023-03-13T15:46:44.155Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS provides a comprehensive range of services to secure and protect infrastructure against malicious attacks, system failures, and other potential threats. In this article, we will explore the three approaches to AWS infrastructure protection, along with their pros and cons and the AWS services that support them. Additionally, we will discuss about two essential AWS services for infrastructure protection, the <a href="https://aws.amazon.com/waf/">AWS WAF</a> and <a href="https://aws.amazon.com/shield/">AWS Shield</a>.</p><h3>Approaches to AWS Infrastructure Protection</h3><ol><li><strong>Traditional Security Measures</strong></li></ol><p>Traditional security measures involve setting up firewalls, access controls, and other security protocols within the AWS infrastructure. These measures are usually deployed as a first line of defense against unauthorized access and network attacks. However, traditional security measures may not be sufficient to protect against advanced threats such as DDoS attacks or malware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkBi0Cz0ow9KisLREDxSgQ.png" /></figure><p>AWS Services for Traditional Security Measures:</p><ul><li><a href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html">Amazon VPC (Virtual Private Cloud)</a></li><li><a href="https://aws.amazon.com/iam/">AWS Identity and Access Management (IAM)</a></li><li><a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html">AWS Security Groups</a></li><li><a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html">AWS Network ACLs (Access Control Lists)</a></li></ul><p>2. <strong>Cloud-native Security Measures</strong></p><p>Cloud-native security measures are designed specifically for the cloud environment and leverage the benefits of cloud computing, such as scalability and flexibility. These measures include automated threat detection, incident response, and recovery mechanisms that can quickly respond to and mitigate potential security incidents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bCKsWtTfr6PBBoJm-W9Vxw.png" /></figure><p>AWS Services for Cloud-native Security Measures:</p><ul><li><a href="https://aws.amazon.com/cloudtrail/">AWS CloudTrail</a></li><li><a href="https://aws.amazon.com/guardduty/">Amazon GuardDuty</a></li><li><a href="https://aws.amazon.com/config/">AWS Config</a></li><li><a href="https://aws.amazon.com/cloudwatch/">AWS CloudWatch</a></li></ul><p>3. <strong>Third-party Security Measures</strong></p><p>Third-party security measures are provided by external vendors who specialize in cybersecurity and offer advanced security features such as machine learning and AI-powered threat detection. These vendors offer security solutions that are tailored to specific business needs and can provide a higher level of security than traditional or cloud-native security measures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TttSDuG1x_oCbvec-Lo5iw.png" /></figure><p>AWS Services for Third-party Security Measures:</p><ul><li>Trend Micro Cloud One — Workload Security</li><li>Palo Alto Networks VM-Series</li><li>McAfee Cloud Workload Security</li><li>Symantec Endpoint Protection</li></ul><p>On the other side there are two dedicated AWS services that provided top notch security features in cloud applications and these are <a href="https://aws.amazon.com/waf/">AWS WAF</a> and <a href="https://aws.amazon.com/shield/">AWS Shield</a>, both of which are being described below :</p><h3><a href="https://aws.amazon.com/waf/">AWS WAF (Web Application Firewall)</a></h3><p><a href="https://aws.amazon.com/waf/">AWS WAF</a> is a web application firewall that helps protect web applications from common exploits such as SQL injection, cross-site scripting (XSS), and other application layer attacks. It provides customizable rules that can be configured to block or allow traffic based on IP addresses, user agents, HTTP headers, or other criteria.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZRdonXCYvrEWoq6y.png" /><figcaption><a href="https://aws.amazon.com/waf/">https://aws.amazon.com/waf/</a></figcaption></figure><p>Benefits of <a href="https://aws.amazon.com/waf/">AWS WAF</a>:</p><ul><li>Easy to deploy and manage</li><li>Customizable rules to protect against common application layer attacks</li><li>Integrates with AWS services such as Amazon CloudFront and Elastic Load Balancing</li></ul><p>Use Cases of <a href="https://aws.amazon.com/waf/">AWS WAF</a>:</p><ul><li>Protecting e-commerce websites from credit card fraud and data theft</li><li>Securing online banking and financial applications</li><li>Blocking unauthorized access to internal applications</li></ul><h3><a href="https://aws.amazon.com/shield/">AWS Shield</a></h3><p><a href="https://aws.amazon.com/shield/">AWS Shield</a> is a managed DDoS (Distributed Denial of Service) protection service that helps protect web applications and services against DDoS attacks. It provides two levels of protection — <a href="https://aws.amazon.com/shield/">AWS Shield</a> Standard and <a href="https://aws.amazon.com/shield/">AWS Shield</a> Advanced. <a href="https://aws.amazon.com/shield/">AWS Shield</a> Standard is automatically enabled for all AWS customers and provides basic protection against most common DDoS attacks. <a href="https://aws.amazon.com/shield/">AWS Shield</a> Advanced is a paid service that offers more advanced protection against large and sophisticated DDoS attacks, along with 24/7 support from AWS DDoS Response Team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tqKDd9uMwQMAU1p3.png" /><figcaption><a href="https://aws.amazon.com/shield/">https://aws.amazon.com/shield/</a></figcaption></figure><p>Benefits of <a href="https://aws.amazon.com/shield/">AWS Shield</a>:</p><ul><li>Automatic protection against most common DDoS attacks with <a href="https://aws.amazon.com/shield/">AWS Shield</a> Standard</li><li>Advanced protection against large and sophisticated DDoS attacks with <a href="https://aws.amazon.com/shield/">AWS Shield</a> Advanced</li><li>24/7 support from AWS DDoS Response Team with AWS Shield Advanced</li></ul><p>Use Cases of <a href="https://aws.amazon.com/shield/">AWS Shield</a>:</p><ul><li>Protecting e-commerce websites from DDoS attacks during peak shopping seasons</li><li>Securing online gaming platforms against DDoS attacks during major tournaments</li><li>Protecting critical business applications from DDoS attacks that can cause financial loss and reputational damage</li></ul><h3>Summary</h3><p>Protecting the AWS infrastructure is critical for businesses to ensure the availability, integrity, and confidentiality of their applications and services. Traditional security measures, cloud-native security measures, and third-party security measures provide different levels of protection against potential threats. On the other hand <a href="https://aws.amazon.com/waf/">AWS WAF</a> and <a href="https://aws.amazon.com/shield/">AWS Shield</a> are two essential services that help protect web applications and services against application layer attacks and DDoS attacks, respectively. By understanding the different approaches to AWS infrastructure protection and leveraging the right AWS services, businesses can minimize the risk of security incidents and protect their assets in the cloud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fcc1c6ab3ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5MinutesDEVStory: AWS IAM Part2 (Security Monitor Mechanisms)]]></title>
            <link>https://awstip.com/5minutesdevstory-aws-iam-part2-security-monitor-mechanisms-a3d172019e51?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3d172019e51</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 15:56:53 GMT</pubDate>
            <atom:updated>2023-03-13T18:16:08.268Z</atom:updated>
            <content:encoded><![CDATA[<p>As more and more organizations migrate their infrastructure to the cloud, it is becoming increasingly important to implement proper monitoring mechanisms to ensure the security and compliance of their <a href="https://aws.amazon.com/">AWS</a> environment. <a href="https://aws.amazon.com/">AWS</a> offers several monitoring services, including <a href="https://aws.amazon.com/guardduty/">GuardDuty</a>, Security Hub, and Macie, to help organizations identify potential threats and vulnerabilities. In this article, we will explore these services in detail, along with pictures of their structure.</p><h3><a href="https://aws.amazon.com/guardduty/">GuardDuty</a> Service</h3><p><a href="https://aws.amazon.com/">AWS</a> <a href="https://aws.amazon.com/guardduty/">GuardDuty</a> is a threat detection service that uses machine learning algorithms and integrated threat intelligence to identify potential security issues in an <a href="https://aws.amazon.com/">AWS</a> environment. It continuously monitors an <a href="https://aws.amazon.com/">AWS</a> account for suspicious activities, such as unauthorized access attempts or unusual API calls.</p><p><a href="https://aws.amazon.com/guardduty/">GuardDuty</a> collects data from various <a href="https://aws.amazon.com/">AWS</a> sources, such as <a href="https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html">VPC Flow Logs</a>, <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-log-file-examples.html">CloudTrail Logs</a>, and <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/query-logs.html">DNS Logs</a>, to analyze and detect potential security threats. It also integrates with <a href="https://aws.amazon.com/">AWS</a> Organizations to provide centralized security monitoring across all accounts within an organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bkoa7q8BsMsx_9ZB.png" /><figcaption><a href="https://aws.amazon.com/guardduty/">https://aws.amazon.com/guardduty/</a></figcaption></figure><p>One of the primary use cases of <a href="https://aws.amazon.com/guardduty/">GuardDuty</a> is to detect and respond to potential security threats in real-time. <strong>For example</strong>, <a href="https://aws.amazon.com/guardduty/">GuardDuty</a> can identify a brute-force attack on an <a href="https://aws.amazon.com/">AWS</a> account and trigger an alert to notify the account owner of the suspicious activity. The account owner can then take appropriate action to mitigate the threat, such as revoking the attacker’s access or resetting the account password.</p><h3><a href="https://aws.amazon.com/security-hub/">Security Hub</a> Service</h3><p><a href="https://aws.amazon.com/">AWS</a> <a href="https://aws.amazon.com/security-hub/">Security Hub</a> is a security and compliance service that provides a comprehensive view of an organization’s security posture across <a href="https://aws.amazon.com/">AWS</a> accounts and third-party integrations. It aggregates and prioritizes security alerts from various <a href="https://aws.amazon.com/">AWS</a> services, such as <a href="https://aws.amazon.com/guardduty/">GuardDuty</a>, <a href="https://aws.amazon.com/inspector/">Inspector</a>, and <a href="https://aws.amazon.com/macie/">Macie</a>, into one dashboard.</p><p><a href="https://aws.amazon.com/security-hub/">Security Hub</a> also integrates with third-party security tools and services, such as <a href="https://www.splunk.com/">Splunk</a>, <a href="https://www.tenable.com/">Tenable</a>, and <a href="https://www.rapid7.com/">Rapid7</a>, to provide a unified view of security alerts and compliance posture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tOZOQu4NK7mYB_MR.png" /><figcaption><a href="https://aws.amazon.com/security-hub/">https://aws.amazon.com/security-hub/</a></figcaption></figure><p>One of the primary use cases of <a href="https://aws.amazon.com/security-hub/">Security Hub</a> is to provide a centralized view of an organization’s security posture across <a href="https://aws.amazon.com/">AWS</a> accounts and third-party integrations. <strong>For example</strong>, <a href="https://aws.amazon.com/security-hub/">Security Hub</a> can identify potential vulnerabilities across all <a href="https://aws.amazon.com/">AWS</a> accounts within an organization and provide recommendations for mitigating these risks.</p><h3><a href="https://aws.amazon.com/macie/">Macie</a> Service</h3><p><a href="https://aws.amazon.com/">AWS</a> <a href="https://aws.amazon.com/macie/">Macie</a> is a data discovery and classification service that helps organizations identify and protect sensitive data in an <a href="https://aws.amazon.com/">AWS</a> environment. It uses machine learning algorithms to detect and classify sensitive data, such as personally identifiable information (PII), intellectual property, and financial information.</p><p><a href="https://aws.amazon.com/macie/">Macie</a> continuously monitors data stored in <a href="https://aws.amazon.com/">AWS</a> services, such as S3, and analyzes the content to identify potential sensitive data. It also provides a detailed report of the data classification and helps organizations enforce data protection policies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LQJpfYt8EbtMK1XO.png" /><figcaption><a href="https://aws.amazon.com/macie/">https://aws.amazon.com/macie/</a></figcaption></figure><p>One of the primary use cases of <a href="https://aws.amazon.com/macie/">Macie</a> is to identify and protect sensitive data in an <a href="https://aws.amazon.com/">AWS</a> environment. <strong>For example</strong>, <a href="https://aws.amazon.com/macie/">Macie</a> can identify a file containing PII in an S3 bucket and generate an alert to notify the account owner of the potential risk. The account owner can then take appropriate action to protect the sensitive data, such as encrypting the file or restricting access to the file.</p><h3>Summary</h3><p><a href="https://aws.amazon.com/">AWS</a> monitoring mechanisms, including <a href="https://aws.amazon.com/guardduty/">GuardDuty</a>, <a href="https://aws.amazon.com/security-hub/">Security Hub</a>, and <a href="https://aws.amazon.com/macie/">Macie</a>, are critical for ensuring the security and compliance of an <a href="https://aws.amazon.com/">AWS</a> environment. These services provide continuous monitoring, threat detection, compliance reporting, and automated remediation capabilities. By leveraging these services, organizations can identify potential threats and vulnerabilities, enforce data protection policies, and achieve compliance goals.</p><p>In this article, we explored the use case examples and pictures of the structure for <a href="https://aws.amazon.com/guardduty/">GuardDuty</a>, <a href="https://aws.amazon.com/security-hub/">Security Hub</a>, and <a href="https://aws.amazon.com/macie/">Macie</a>. <a href="https://aws.amazon.com/guardduty/">GuardDuty</a> provides real-time threat detection, <a href="https://aws.amazon.com/security-hub/">Security Hub</a> provides a centralized view of an organization’s security posture, and <a href="https://aws.amazon.com/macie/">Macie</a> helps identify and protect sensitive data in an <a href="https://aws.amazon.com/">AWS</a> environment. By leveraging these services, organizations can improve their overall security posture and reduce the risk of data breaches.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3d172019e51" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/5minutesdevstory-aws-iam-part2-security-monitor-mechanisms-a3d172019e51">5MinutesDEVStory: AWS IAM Part2 (Security Monitor Mechanisms)</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5Minutes DEV Story: AWS IAM PART 1 (3 services to match any usecase)]]></title>
            <link>https://awstip.com/5minutes-dev-story-aws-iam-part-1-3-services-to-match-any-usecase-11f92d06b174?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/11f92d06b174</guid>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Thu, 16 Feb 2023 17:50:46 GMT</pubDate>
            <atom:updated>2023-03-17T15:15:46.329Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of cloud computing, security is paramount. AWS (Amazon Web Services) provides a comprehensive set of services and features to ensure that customer data and resources are secure. One of the most important services that AWS provides is <a href="https://aws.amazon.com/iam/">IAM </a>(Identity and Access Management). <a href="https://aws.amazon.com/iam/">IAM </a>enables users to manage access to AWS services and resources securely. In this article, we will discuss <a href="https://aws.amazon.com/iam/">IAM</a>, the difference between authentication and authorization, and the various services that help us to achieve them. We will also talk about AWS <a href="https://aws.amazon.com/iam/">IAM </a>for access management, <a href="https://aws.amazon.com/cognito/">Amazon Cognito</a> for mobile, and <a href="https://aws.amazon.com/directoryservice/">AWS Directory Service</a> for user federation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*60lkkCWFaFIC8meN.png" /><figcaption><a href="https://aws.amazon.com/iam/">https://aws.amazon.com/iam/</a></figcaption></figure><p><strong>Authentication vs. Authorization</strong></p><p>Before diving into <a href="https://aws.amazon.com/iam/">IAM</a>, it’s important to understand the <em>difference between authentication and authorization</em>. <strong>Authentication </strong>is the process of verifying the identity of a user, application, or device. In simple terms, it answers the question, “Who are you?” Authentication can be achieved through various means, such as usernames and passwords, multi-factor authentication (MFA), biometric authentication, and so on.</p><p><strong>Authorization</strong>, on the other hand, is the process of granting or denying access to resources based on the identity of the user. In simple terms, it answers the question, “What are you allowed to do?” Authorization can be achieved through the use of policies, roles, and permissions.</p><h3>AWS <a href="https://aws.amazon.com/iam/">IAM </a>for Access Management</h3><p><a href="https://aws.amazon.com/iam/">IAM </a>is a web service that enables users to manage access to <a href="https://aws.amazon.com/">AWS services </a>and resources securely. <a href="https://aws.amazon.com/iam/">IAM </a>allows users to create and manage AWS users and groups, assign permissions, and enable MFA. <a href="https://aws.amazon.com/iam/">IAM </a>also provides an easy way to grant temporary access to resources when needed.</p><p><a href="https://aws.amazon.com/iam/">IAM </a>is designed to provide the following features:</p><ol><li><strong>Centralized control:</strong> <a href="https://aws.amazon.com/iam/">IAM </a>enables centralized control of <a href="https://aws.amazon.com/">AWS </a>accounts. Users can create and manage multiple users and groups, and assign policies and permissions to them.</li><li><strong>Shared access:</strong> <a href="https://aws.amazon.com/iam/">IAM </a>enables shared access to <a href="https://aws.amazon.com/">AWS </a>accounts. Users can grant permissions to other users or <a href="https://aws.amazon.com/">AWS services</a> without sharing their access keys.</li><li><strong>Granular permissions:</strong> <a href="https://aws.amazon.com/iam/">IAM </a>provides granular permissions for <a href="https://aws.amazon.com/">AWS</a> resources. Users can create policies and assign permissions at the resource level.</li><li><strong>Secure access:</strong> <a href="https://aws.amazon.com/iam/">IAM </a>enables secure access to <a href="https://aws.amazon.com/">AWS </a>resources. Users can enable MFA, use SSL/TLS to encrypt data in transit, and integrate with AWS CloudTrail to monitor and log all <a href="https://aws.amazon.com/iam/">IAM </a>activity.</li></ol><h3><a href="https://aws.amazon.com/cognito/">Amazon Cognito</a> for Mobile</h3><p><a href="https://aws.amazon.com/cognito/">Amazon Cognito</a> is a web service that enables mobile app developers to authenticate users, store app data, and sync user data across devices. <a href="https://aws.amazon.com/cognito/">Cognito </a>provides a simple way to authenticate users using social identity providers such as Facebook, Google, and Amazon. <a href="https://aws.amazon.com/cognito/">Cognito </a>also provides a secure way to store app data and sync user data across devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZdyGmWdeTOZzI6Rq.png" /><figcaption><a href="https://aws.amazon.com/cognito/">https://aws.amazon.com/cognito/</a></figcaption></figure><p><a href="https://aws.amazon.com/cognito/">Cognito </a>provides the following features:</p><ol><li><strong>User authentication:</strong> <a href="https://aws.amazon.com/cognito/">Cognito </a>enables user authentication using social identity providers or user pools. User pools enable developers to create a custom authentication flow for their app.</li><li><strong>Data synchronization:</strong> <a href="https://aws.amazon.com/cognito/">Cognito </a>provides a way to store app data and sync user data across devices. Developers can use <a href="https://aws.amazon.com/cognito/">Cognito </a>sync to store and synchronize user data such as preferences, settings, and game state.</li><li><strong>Security:</strong> <a href="https://aws.amazon.com/cognito/">Cognito </a>provides a secure way to store app data and authenticate users. <a href="https://aws.amazon.com/cognito/">Cognito </a>encrypts user data at rest and in transit, and integrates with AWS <a href="https://aws.amazon.com/iam/">IAM </a>to manage user access.</li></ol><h3><a href="https://aws.amazon.com/directoryservice/">AWS Directory Service</a> for User Federation:</h3><p><a href="https://aws.amazon.com/directoryservice/">AWS Directory Service</a> is a web service that enables users to integrate their existing directories with <a href="https://aws.amazon.com/">AWS services</a>. <a href="https://aws.amazon.com/directoryservice/">Directory Service</a> provides two options for user federation: AD Connector and Simple AD.</p><p><strong>AD Connector</strong> enables users to connect their on-premises Active Directory (AD) to <a href="https://aws.amazon.com/">AWS services</a> such as EC2, RDS, and S3. This allows users to manage access to <a href="https://aws.amazon.com/">AWS </a>resources using their existing AD credentials.</p><p><strong>Simple AD</strong> is a managed directory service that is compatible with Microsoft AD. Simple AD enables users to create a directory in the cloud and manage access to <a href="https://aws.amazon.com/">AWS </a>resources using their existing AD credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qupc4jw2NPOjkRvO.png" /><figcaption><a href="https://aws.amazon.com/directoryservice/">https://aws.amazon.com/directoryservice/</a></figcaption></figure><p><a href="https://aws.amazon.com/directoryservice/">Directory Service</a> provides the following features:</p><ol><li><strong>User federation:</strong> <a href="https://aws.amazon.com/directoryservice/">Directory Service</a> enables users to integrate their existing directories with <a href="https://aws.amazon.com/">AWS services</a>. This allows users to manage access to <a href="https://aws.amazon.com/">AWS </a>resources using their existing credentials.</li><li><strong>Scalability:</strong> <a href="https://aws.amazon.com/directoryservice/">Directory Service</a> is designed to be highly scalable. Users can create and manage multiple directories, and <a href="https://aws.amazon.com/directoryservice/">Directory Service</a> can handle millions of objects in a single directory.</li><li><strong>Security:</strong> <a href="https://aws.amazon.com/directoryservice/">Directory Service</a> provides a secure way to integrate existing directories with <a href="https://aws.amazon.com/">AWS services</a>. <a href="https://aws.amazon.com/directoryservice/">Directory Service</a> encrypts data in transit and at rest, and integrates with AWS IAM to manage user access.</li></ol><h3>Summary</h3><p>Summing up, AWS <a href="https://aws.amazon.com/iam/">IAM</a>, <a href="https://aws.amazon.com/cognito/">Amazon Cognito</a>, and <a href="https://aws.amazon.com/directoryservice/">AWS Directory Service</a> are three services that are essential for managing identity and access in the AWS cloud. <a href="https://aws.amazon.com/iam/">IAM </a>enables centralized control, shared access, granular permissions, and secure access to <a href="https://aws.amazon.com/">AWS </a>resources. <a href="https://aws.amazon.com/cognito/">Cognito </a>provides user authentication, data synchronization, and security for mobile app developers. <a href="https://aws.amazon.com/directoryservice/">Directory Service</a> enables user federation, scalability, and security for integrating existing directories with <a href="https://aws.amazon.com/">AWS services</a>. By using these services, users can ensure that their <a href="https://aws.amazon.com/">AWS </a>resources are secure and only accessible to authorized users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=11f92d06b174" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/5minutes-dev-story-aws-iam-part-1-3-services-to-match-any-usecase-11f92d06b174">5Minutes DEV Story: AWS IAM PART 1 (3 services to match any usecase)</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5Minutes DEV Story: AWS EC2 Auto-Scaling]]></title>
            <link>https://medium.com/@mikopos/5minutes-dev-story-aws-ec2-auto-scaling-9f65ac577b36?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f65ac577b36</guid>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Tue, 07 Feb 2023 21:29:18 GMT</pubDate>
            <atom:updated>2023-02-07T21:29:18.500Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://aws.amazon.com/ec2/autoscaling/">AWS EC2 Auto Scaling</a> is a service provided by Amazon Web Services (AWS) that automatically adjusts the number of Amazon Elastic Compute Cloud (EC2) instances in a group based on demand. The goal of <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a> is to maintain the desired number of running instances to handle the current workload, while also ensuring that the instances are balanced across Availability Zones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yeO-K-Jq7QI23tbs.png" /><figcaption><a href="https://aws.amazon.com/ec2/autoscaling/">https://aws.amazon.com/ec2/autoscaling/</a></figcaption></figure><h3>Types of scaling</h3><p>There are two main types of scaling in <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a>: vertical scaling and horizontal scaling.</p><p><strong>Vertical scaling </strong>involves adjusting the size of an <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html">EC2 instance</a> by either upgrading to a larger instance type or downgrading to a smaller instance type. <strong>This type of scaling is used to adjust the amount of CPU, memory, and storage resources available to an instance</strong>. Vertical scaling is used when the current instance type is no longer able to handle the workload or when the workload has decreased, and a smaller instance type is needed to reduce costs.</p><p><strong>Horizontal scaling</strong> involves adjusting the number of <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html">EC2 instances</a> in a group. <strong>This type of scaling is used to adjust the capacity of the application to handle changes in demand</strong>. Horizontal scaling is used when the current number of instances is no longer able to handle the workload or when the workload has increased and more instances are needed.</p><h3>Key components of Auto Scaling</h3><p>There are several key components in <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a>:</p><ol><li><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-templates.html">Launch Templates</a>: A launch template is used to define the <strong>configurations </strong>for <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html">EC2 instances</a> in an auto scaling group. The launch template includes information such as the <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html">Amazon Machine Image (AMI)</a> ID, instance type, security group, and storage options. This allows you to specify the<strong> exact configurations for your instances</strong>, <strong>ensuring consistency across your auto scaling group</strong>.</li><li><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html">Auto Scaling Groups</a>: An auto scaling group is a <strong>collection </strong>of <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html">EC2 instances</a> that are <strong>managed together as a single unit</strong>. You can specify the desired number of instances, the minimum number of instances that must be running at all times, and the maximum number of instances that can be running. This allows you to set limits on the number of instances that can be added or removed from your group, helping to ensure that the group does not become too large or too small.</li><li><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html">Auto Scaling Policies</a>: Auto scaling policies are used to <strong>define the rules </strong>for scaling your auto scaling group. You can define policies based on <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>Alarms, which will trigger the scaling of instances based on specific conditions, <strong>such as CPU utilization or network traffic</strong>. For example, if the CPU utilization of your instances reaches 80%, a policy can be created to add additional instances to the group to help balance the load.</li></ol><p>In addition to these key components, <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a> also includes features such as <strong>health checks</strong> and <strong>instance protection</strong>. Health checks are used to determine the health of your instances and determine if they are functioning as expected. Instance protection allows you to protect specific instances from being terminated by the auto scaling group, ensuring that important instances are not accidentally terminated during a scaling event.</p><p>To use <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a>, you <strong>first need to create a launch template</strong>, which will define the configurations for your instances. <strong>Next, you will create an auto scaling group</strong>, specifying the desired number of instances and the minimum and maximum number of instances that can be in the group. <strong>Finally, you will create auto scaling policies</strong>, which will define the rules for scaling your group.</p><p>Once you have created your launch template, auto scaling group, and auto scaling policies, <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a> will automatically add or remove instances from your group as needed to maintain the desired number of running instances. The service will also adjust the size of your instances as needed to ensure that they are running at the optimal size for the workload.</p><h3>Summary</h3><p>Summarizing what I learned in this course, <a href="https://aws.amazon.com/ec2/autoscaling/">AWS EC2 Auto Scaling</a> is a powerful service that helps you to automatically manage the capacity of your <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html">EC2 instances</a>, ensuring that your application is always running at the optimal level. By using the combination of vertical and horizontal scaling, launch templates, auto scaling groups, and auto scaling policies, you can easily manage the capacity of your instances, saving time and reducing costs.</p><p>It is important to note that <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a> is just one of the many services provided by AWS that can be used to manage your application. To fully utilize the benefits of <a href="https://aws.amazon.com/ec2/autoscaling/">EC2 Auto Scaling</a>, <strong><em>it is recommended</em></strong> that you use it in conjunction with other AWS services, such as <a href="https://aws.amazon.com/cloudwatch/">CloudWatch</a>, <a href="https://aws.amazon.com/elasticloadbalancing/">Elastic Load Balancer</a>, and <a href="https://aws.amazon.com/s3/">Amazon S3</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f65ac577b36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5Minutes DEV Story: AWS Load Balancers]]></title>
            <link>https://medium.com/@mikopos/5minutes-dev-story-aws-load-balancers-823f6a8c85a1?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/823f6a8c85a1</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Sun, 05 Feb 2023 19:30:33 GMT</pubDate>
            <atom:updated>2023-02-05T19:30:33.837Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Web Services (AWS) provides a range of load balancing services that help customers distribute incoming traffic across multiple targets, such as EC2 instances, containers, and IP addresses. Load balancing increases the availability and fault tolerance of applications and can also improve overall performance by distributing incoming requests evenly across multiple resources. In this article, we will analyze the three main types of load balancing services offered by AWS: <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Elastic Load Balancer (ELB)</a>, <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">Application Load Balancer (ALB)</a>, and <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">Network Load Balancer (NLB)</a>.</p><h3><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Elastic Load Balancer (ELB)</a></h3><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Elastic Load Balancer (ELB)</a> is a load balancing service that automatically distributes incoming application traffic across multiple targets in a single or multiple Availability Zones. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">ELB </a>supports two types of load balancers: <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Classic Load Balancer</a> and <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">Application Load Balancer</a>. Classic Load Balancer operates at the transport layer (TCP/IP) and provides basic load balancing capabilities for both application and network traffic. It is suitable for use cases that require simple load balancing, such as distributing incoming traffic evenly across EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/0*JJDT-w3pWIgnSq2Z.png" /><figcaption><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html</a></figcaption></figure><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Classic Load Balancer</a> uses a round-robin algorithm to distribute incoming traffic evenly across the registered targets. It also provides features such as health checks, connection draining, and security features like SSL offloading and access control. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Classic Load Balancer</a> is a good choice for simple use cases and small to medium-sized applications, as it provides basic load balancing capabilities at a lower cost compared to<a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html"> Application Load Balancer</a> and <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">Network Load Balancer</a>.</p><h3><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">Application Load Balancer (ALB)</a></h3><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">Application Load Balancer (ALB</a>) is a more advanced load balancing service that operates at the application layer (HTTP/HTTPS) and provides additional features such as content-based routing, host-based routing, and path-based routing. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>integrates with other AWS services, such as Amazon EC2 Container Service (ECS), Amazon S3, and Amazon Lambda, making it a good choice for deploying and managing modern applications. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>is designed to handle modern application traffic patterns and provides improved performance, better fault tolerance, and a more intelligent traffic routing mechanism compared to <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Classic Load Balancer</a>.</p><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>uses a request routing mechanism that allows you to route incoming traffic based on the URL path, host header, or other attributes of the incoming request. This enables you to route incoming traffic to different target groups based on the type of request, making it easier to manage and scale your application. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>also provides features such as automatic host-based routing, which allows you to route incoming traffic to a specific target group based on the host name in the URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7Y4eM1v0Gnvhtkan.png" /></figure><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>also provides features such as content-based routing, which allows you to route incoming traffic to a specific target group <strong>based on the contents of the incoming request</strong>. For example, you can route incoming requests for images to an Amazon S3 bucket and incoming requests for dynamic content to an EC2 instance. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>provides a flexible and scalable solution for deploying and managing modern applications, and is a good choice for applications that require advanced routing and traffic management capabilities.</p><h3><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">Network Load Balancer (NLB)</a></h3><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">Network Load Balancer (NLB)</a> is a high-performance load balancing service that operates at the transport layer and provides extreme performance and stability for workloads that require high throughput and low latency. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB </a>supports TCP and UDP protocols, making it ideal for use cases such as gaming, financial services, and large-scale deployments. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB</a> is designed to handle heavy network traffic and provides improved performance compared to <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">Classic Load Balancer</a>.</p><p><a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB </a>uses a flow-based routing mechanism that distributes incoming traffic based on the source IP address, destination IP address, and protocol. This enables you to route incoming traffic to different target groups based on the characteristics of the incoming request. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB </a>also provides features such as health checks, connection draining, and security features, making it a secure and reliable solution for deploying and managing applications that<strong> require high performance and stability</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wI3xTnNIOVHyHsnc.png" /><figcaption><a href="https://aws.amazon.com/elasticloadbalancing/?nc=sn&amp;loc=0">https://aws.amazon.com/elasticloadbalancing/?nc=sn&amp;loc=0</a></figcaption></figure><p>Another advantage of <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB </a>is its ability to handle sudden and volatile traffic patterns. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB </a>uses a flow-based routing mechanism that enables it to quickly adjust to changes in incoming traffic patterns, ensuring that incoming traffic is distributed evenly and efficiently. This makes it ideal for <strong>use cases such as gaming, financial services, and large-scale deployments</strong> where incoming traffic can be unpredictable and volatile.</p><h3>Summary</h3><p>Summing up, AWS provides a range of load balancing services that enable customers to distribute incoming traffic across multiple targets and increase the availability and fault tolerance of applications. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">ELB </a>provides basic load balancing capabilities for both application and network traffic, while <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>provides advanced routing and traffic management capabilities for modern applications. <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB </a>provides extreme performance and stability for workloads that require high throughput and low latency.</p><p>When choosing a load balancing service, it is important to consider the specific needs and requirements of your application. If you have a simple use case and basic load balancing requirements, <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/introduction.html">ELB Classic Load Balancer</a> may be a good choice. If you have a modern application and require advanced routing and traffic management capabilities, <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html">ALB </a>may be a better choice. If you have a high-performance workload that requires extreme performance and stability, <a href="https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html">NLB </a>may be the best option.</p><p>Regardless of the specific load balancing service you choose, AWS provides the tools and resources you need to deploy and manage your applications with confidence. With its wide range of load balancing services, AWS enables you to distribute incoming traffic efficiently, increase the availability and fault tolerance of your applications, and provide improved performance and stability for your customers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=823f6a8c85a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Minutes DEV Story: AWS Monitoring — Cloudwatch the not so secret power]]></title>
            <link>https://medium.com/@mikopos/5-minutes-dev-story-aws-monitoring-cloudwatch-the-not-so-secret-power-c47589813565?source=rss-b32d06268f99------2</link>
            <guid isPermaLink="false">https://medium.com/p/c47589813565</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[monitoring]]></category>
            <dc:creator><![CDATA[Marios Gavriil]]></dc:creator>
            <pubDate>Thu, 02 Feb 2023 20:37:28 GMT</pubDate>
            <atom:updated>2023-02-02T20:37:28.451Z</atom:updated>
            <content:encoded><![CDATA[<h3>5 Minutes DEV Story: <a href="https://aws.amazon.com/">AWS</a> Monitoring — Cloudwatch the not so secret power</h3><p><a href="https://aws.amazon.com/">Amazon Web Services (AWS)</a> <a href="https://aws.amazon.com/cloudops/monitoring-and-observability/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;whats-new-cards.sort-order=desc&amp;blog-posts-cards.sort-by=item.additionalFields.createdDate&amp;blog-posts-cards.sort-order=desc">monitoring </a>is the process of tracking and analyzing the performance and usage of your <a href="https://aws.amazon.com/">AWS </a>resources. The benefits of monitoring <a href="https://aws.amazon.com/">AWS </a>include:</p><ol><li><strong>Cost optimization:</strong> <a href="https://aws.amazon.com/">AWS </a>monitoring helps you identify underutilized or overutilized resources, which can help you reduce unnecessary spending.</li><li><strong>Improved performance:</strong> <a href="https://aws.amazon.com/cloudops/monitoring-and-observability/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;whats-new-cards.sort-order=desc&amp;blog-posts-cards.sort-by=item.additionalFields.createdDate&amp;blog-posts-cards.sort-order=desc">Monitoring </a>allows you to detect and resolve performance issues before they affect your customers.</li><li><strong>Better security:</strong> <a href="https://aws.amazon.com/">AWS </a><a href="https://aws.amazon.com/cloudops/monitoring-and-observability/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;whats-new-cards.sort-order=desc&amp;blog-posts-cards.sort-by=item.additionalFields.createdDate&amp;blog-posts-cards.sort-order=desc">monitoring </a>provides insights into potential security risks, helping you ensure the security of your resources and data.</li><li><strong>Compliance:</strong> <a href="https://aws.amazon.com/cloudops/monitoring-and-observability/?whats-new-cards.sort-by=item.additionalFields.postDateTime&amp;whats-new-cards.sort-order=desc&amp;blog-posts-cards.sort-by=item.additionalFields.createdDate&amp;blog-posts-cards.sort-order=desc">Monitoring </a>helps you stay compliant with industry and government regulations, by providing you with visibility into the configuration of your resources.</li></ol><p>The above benefits are being achieved by the use of several types of metrics that can be monitored in <a href="https://aws.amazon.com/">AWS</a>, including:</p><ol><li><strong>Resource utilization metrics</strong>: These metrics provide information on the usage of resources such as EC2 instances, RDS databases, and S3 storage.</li><li><strong>Application performance metrics:</strong> These metrics provide information on the performance of your applications, such as response time, error rate, and latency.</li><li><strong>Infrastructure metrics:</strong> These metrics provide information on the performance of your infrastructure, such as network bandwidth and CPU usage.</li><li><strong>Billing metrics</strong>: These metrics provide information on your AWS costs, allowing you to monitor your spending and identify cost-saving opportunities.</li></ol><p>In general, <a href="https://aws.amazon.com/">AWS </a>provides a number of tools for monitoring, including Amazon <a href="https://aws.amazon.com/cloudwatch/">CloudWatch</a>, <a href="https://aws.amazon.com/config/">AWS Config</a>, and <a href="https://aws.amazon.com/cloudtrail/">AWS CloudTrail</a>. Below I would you a sneak preview about the Amazon <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>and some of its subsystems that help us in the monitoring.</p><h3><a href="https://aws.amazon.com/cloudwatch/">Amazon CloudWatch</a></h3><p><a href="https://aws.amazon.com/cloudwatch/">Amazon CloudWatch</a> is a monitoring service provided by Amazon Web Services (AWS) that provides monitoring for AWS resources and customer applications. It allows you to collect, monitor, and analyze metrics, log files, and alarms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bu7LbpowOhowhyrf.png" /><figcaption><a href="https://aws.amazon.com/cloudwatch/">https://aws.amazon.com/cloudwatch/</a></figcaption></figure><p><strong><em>Metrics</em></strong>: <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>metrics provide data on the performance and usage of your AWS resources, such as EC2 instances, RDS databases, and S3 storage. This data can be used to identify performance issues, monitor resource utilization, and track the health of your infrastructure. You can also create custom metrics to monitor specific business and application-level metrics.</p><p><strong><em>Logs:</em></strong> <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>Logs allow you to monitor, store, and access log files from a variety of AWS resources and customer applications. This provides you with the ability to diagnose and resolve issues more quickly, as well as comply with regulatory requirements. You can use <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>Logs to monitor log files, search and filter logs, and create alarms based on log events.</p><p><strong><em>Alarms:</em></strong> <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>Alarms allow you to monitor the performance of your resources and take automated actions in response to any changes. For example, you can set up an alarm to notify you if an EC2 instance becomes unavailable, or if the error rate of a customer application exceeds a specified threshold. Alarms can be triggered by changes in metrics, or by events in <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>Logs.</p><p>In summary, <a href="https://aws.amazon.com/cloudwatch/">CloudWatch </a>provides a comprehensive monitoring solution for AWS resources and customer applications. By using <a href="https://aws.amazon.com/cloudwatch/">CloudWatch</a> metrics, logs, and alarms, you can ensure the performance and availability of your resources, and quickly respond to any issues that arise. Moreover you can use the alarms for auto-scaling the available resources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c47589813565" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>