<?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 Berkay Çınar on Medium]]></title>
        <description><![CDATA[Stories by Berkay Çınar on Medium]]></description>
        <link>https://medium.com/@Berkay_Cinar?source=rss-b0dde94eca96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZV8yfukQLEYR0LFkEyG9Tg.png</url>
            <title>Stories by Berkay Çınar on Medium</title>
            <link>https://medium.com/@Berkay_Cinar?source=rss-b0dde94eca96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:36:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Berkay_Cinar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS CloudWatch: Monitoring Spot Instances]]></title>
            <link>https://medium.com/trendyol-tech/aws-cloudwatch-monitoring-spot-instances-ae10e432526d?source=rss-b0dde94eca96------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae10e432526d</guid>
            <category><![CDATA[fluentbit]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloudwatch]]></category>
            <category><![CDATA[spot-instances]]></category>
            <dc:creator><![CDATA[Berkay Çınar]]></dc:creator>
            <pubDate>Thu, 16 Feb 2023 11:10:40 GMT</pubDate>
            <atom:updated>2023-02-24T09:17:12.087Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*CzCg10ME2SQXgVYXPtdQYA.png" /></figure><p>In this blog post, I will briefly explain <a href="https://aws.amazon.com/cloudwatch/">Amazon CloudWatch</a>, including how to monitor Spot instances, set alarms, and take corresponding actions based on those alarms.</p><p>Observability and monitoring is crucial for understanding the performance and behavior of software systems. It allows for proactive identification and resolution of issues, and can aid in troubleshooting and debugging. By providing insight into the inner workings of a system, observability can help to ensure the reliability and stability of software.</p><p>Amazon CloudWatch is a monitoring service that provides data and operational insights for various AWS resources. It helps users monitor and troubleshoot their applications, as well as optimize resource utilization.</p><p>CloudWatch collects monitoring and operational data in the form of logs, metrics, and events. It also provides a range of visualization and alerting tools to help users analyze and act on this data. CloudWatch Logs allows users to monitor, store, and access their log files from Amazon Elastic Compute Cloud (EC2) instances, Auto Scaling, and other cloud resources. It can be used to troubleshoot issues and identify patterns in log data.</p><p>We use <a href="https://fluentbit.io/">Fluent Bit</a> for streaming log data from Kubernetes to CloudWatch, which can be seamlessly integrated into an EKS cluster. Once the <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs-FluentBit.html">Fluent Bit configuration</a> is complete, log data from containers running in the EKS cluster will be streamed to CloudWatch in real-time. By using Fluent Bit and CloudWatch together, we gain valuable insights into the operation of their applications and infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*s6dLeTU4bdV_B4AvsbiWMw.png" /></figure><p>Alarms are essential for identifying and resolving issues that arise in a system. Setting alarms in Amazon CloudWatch typically involves using either the built-in metrics or logs collected by Fluent Bit, depending on the specific use case and monitoring needs. In this regard, there are various ways to configure alarms using metrics, and the following are among the most common methods:</p><ol><li>Single metric alarm: This type of alarm is based on a single metric, such as CPU utilization or network traffic. You can set a threshold for the metric, and the alarm will trigger when the metric value crosses the threshold.</li><li>Composite alarm: A composite alarm is based on multiple metrics, and you can define a Boolean expression that combines the metrics. For example, you might create a composite alarm that triggers when the CPU utilization is high AND the number of requests is high.</li><li>Anomaly detection alarm: With Amazon CloudWatch anomaly detection, you can create alarms that trigger when a metric value deviates significantly from the expected behavior. This can be useful for detecting unusual spikes in traffic or unexpected drops in performance.</li><li>Percentile-based alarm: With percentile-based alarms, you can create alarms that trigger when a metric value exceeds a certain percentile threshold. For example, you might create an alarm that triggers when the 99th percentile of response times is greater than 500ms.</li><li>High-resolution custom metric alarm: Amazon CloudWatch supports high-resolution custom metrics, which can be used to monitor detailed performance metrics with sub-minute granularity. You can create alarms based on these metrics just like you would with standard metrics.</li></ol><h3><strong>How to monitor spot instances?</strong></h3><p>When using Spot node group instances to host applications, it is important to be aware that Amazon EC2 may not always be able to fulfill your request for Spot instances. This can happen when the demand for Spot instances exceeds the available capacity, or when the Spot price exceeds the maximum price that you are willing to pay.</p><p>If EC2 is unable to fulfill a request for Spot instances, it can cause problems with your Auto Scaling group. For example, if you have configured your Auto Scaling group to scale out when the demand for EC2 instances increases, and there are not enough Spot instances available to fulfill the request, the scale-out action will fail.</p><p>Here is an example CloudWatch alarm that can be used to monitor the difference between InService and Desired instances. This alarm will notify you when there is a difference between the two metrics that exceeds a certain threshold, allowing you to take action to ensure that your Auto Scaling group is operating at the desired capacity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lq9i8W3-Fdre-HU42tCrg.png" /></figure><p>CloudWatch Events allows users to create rules that match incoming events and route them to various targets, such as Amazon SNS topics, Auto Scaling Group, and more.</p><p>When the InService/Desired state is in an alert state and the EC2 is unable to meet a request for Spot instances, there are several possible solutions to try to resolve the issue. We will explore two of these solutions.</p><p>One potential solution is to use Auto Scaling actions to launch On-Demand instances as a backup mechanism. By doing so, the system can ensure that the desired capacity of the group is met even if the number of available Spot instances is limited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7A4ppmUFuIdSlFHRfWPE6w.png" /></figure><p>The second solution entails using a Lambda function that subscribes to an SNS topic. This function can be triggered by a CloudWatch alarm when the ratio of requested instances to the number of in-service instances in the group exceeds a certain threshold. This Lambda function can notify you when the Auto Scaling group is unable to meet the demand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4md2qRbaYYnCMx7pJmmeA.png" /></figure><p>The Lambda that subscribes to the notification topic can perform one or more of the following actions:</p><ol><li>Attempt to request additional Spot instances: The function can try to request additional Spot instances from EC2, using a higher maximum price if necessary.</li><li>Scale out using On-Demand instances: If it is not possible to obtain additional Spot instances, the function can scale out the Auto Scaling group using On-Demand instances instead.</li><li>Send an alert: If the scale-out action is still not possible, the function can send an alert (e.g. via email or Slack) to notify the appropriate personnel of the issue.</li></ol><p>The best solution will depend on your specific use case and requirements. It may be necessary to try a few different solutions and monitor the results to determine what works best for your needs.</p><p>Overall, Amazon CloudWatch is a powerful monitoring service that can help users improve the performance, reliability, and security of their applications and infrastructure on AWS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae10e432526d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/trendyol-tech/aws-cloudwatch-monitoring-spot-instances-ae10e432526d">AWS CloudWatch: Monitoring Spot Instances</a> was originally published in <a href="https://medium.com/trendyol-tech">Trendyol Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tyk Gateway vs Amazon API Gateway]]></title>
            <link>https://medium.com/kloia/tyk-gateway-vs-amazon-api-gateway-cc422edfea63?source=rss-b0dde94eca96------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc422edfea63</guid>
            <category><![CDATA[tyk]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-api-gateway]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[gateway]]></category>
            <dc:creator><![CDATA[Berkay Çınar]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 10:14:59 GMT</pubDate>
            <atom:updated>2022-04-21T13:28:06.480Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/717/0*Sz8qh-9qoXGcx_0j" /></figure><p>An API gateway is in its simplest form, a bridge between the clients and your APIs. API Gateways act as a reverse proxy to client requests by routing them to appropriate services and returning an appropriate response.</p><p>There are many different benefits of using API gateways, but the most common are :</p><ul><li>Enhancing security by disabling direct access to APIs, being able to white and black list IPs</li><li>Simplifying the client by moving logic for calling multiple services from the client to the API gateway</li><li>Reducing latency by handling possible round trips to many services as a single point of entry</li><li>Translating from web-friendly API protocols to many other protocols used internally</li><li>Handling authentication to control which data is transmitted to your APIs.</li><li>Ensuring the API does not get flooded with requests by setting up Cache, Rate Limiting &amp; Quotas.</li></ul><p>For this post, we decided to compare Tyk Gateway to Amazon API Gateway because of the wide use of AWS as one of the biggest cloud providers globally and Tyk API Gateway, as it’s the Open Source Gateway that powers the highest rated API Management Platform according to <a href="https://www.gartner.com/reviews/market/full-life-cycle-api-management/vendor/tyk-technologies/product/tyk">Gartner Peer Insights</a>, with a market-leading 4.7 out of 5.</p><h3>Production-Ready Authentication</h3><p>Authentication enables companies to keep secure their public APIs and networks by allowing them to be used by only authenticated users. The user or computer has to prove its identity to the requested resource. In client-server architectures, this mechanism is best practice and almost inevitable.</p><h3>Tyk Gateway</h3><p>Tyk Gateway OSS supports lots of industry-standard <a href="https://tyk.io/docs/basic-config-and-security/security/authentication-authorization/">authentication and authorization </a>options to lock-down APIs and handles the traffic securely. Tyk Gateway supports Basic Authentication, Bearer Tokens, JSON Web Tokens(JWT), Multiple Auth, OAuth 2.0, OpenID Connect, and custom plugins written in many languages for complex authentication and authorization scenarios, including legacy auth servers. Tyk Gateway is seamlessly integrated with almost every access control solution.</p><p>Tyk Gateway works with Redis, and it is a highly available and consistent key-value store. Redis stores in-memory Tyk session objects. The session objects can include metadata, access rights, policies, tags, etc. You can use stored in-memory session objects in custom Tyk Gateway custom plugins and middlewares, and it is convenient to process this data for any requirement.</p><p>There is no alternative that can be used as open-source software that supports all of these features, making Tyk stand out compared to its competitors.</p><h3>AWS Gateway</h3><p>Amazon API Gateway supports AWS Cognito or Lambda Authorizers for access management. AWS Cognito is a managed service, and it supports sign-in with social identity providers and enterprise identity providers via SAML 2.0 and OpenID Connect.</p><p>Lambda Authorizers are AWS Lambda functions constructed to control access to the API Gateway with user-defined logic. Users are required to create and maintain their Lambda Authorizers. This Lambda function can programmatically fine-tune your authorization process or connect to existing authentication mechanisms running on your, let’s say, on-premises. The only disadvantage of using custom authorizer Lambda functions is that users are required to code and maintain their custom Lambda function.</p><p>API Gateways policies give granular authorization control after the authentication mechanism. These controls are very important in terms of controlling, limiting, and invoicing customers.</p><h3>Tyk Gateway</h3><p>Policies are JSON-based documents that give you granular control of APIs for rate limiting, access rights, and quotas, and are applied as soon as with hot reload support. They can be used with trial keys as a temporary policy with a fixed expiration date. We can apply different policies to each environment. Also, Tyk Gateway policies have a granular path and method-based control feature which allows you to define policies for each API’s version.</p><h3>AWS Gateway</h3><p>On the AWS API Gateway, you can allow and restrict user-based access with IAM User and Group policies. However, these access rights must be defined for each IAM user. If we want to control Rate and Quota limits separately, we can also use AWS Gateway Resource Policy and Usage Plan services. AWS API Gateway allows you to build API versions with a gateway like Tyk. There’s a feature on Amazon API Gateway called stage variables. Stage variables act like environment variables and can be used to change the behavior of your API Gateway methods for each deployment stage, for example, making it possible to reach a different back end depending on which stage the API is running on.</p><p>Keep in mind that applying policies on AWS has some caveats. You may define your policies at the API level, Usage Plan level, IAM level, and Resource Policies level.</p><h3>White-Black List For Url Paths</h3><p>For API versioning, enabling or disabling access to paths or HTTP methods. White-black listing allows you to block the access instead of vanishing the paths.</p><h3>Tyk Gateway</h3><p>Tyk Gateway has Black and White list features that allow or block specified paths and methods (POST, GET).</p><p>Adding a path to a whitelist will cause other paths to become blacklisted. This means you can open specific endpoints and close others by just adding paths that will open to the whitelist. Moreover, there is regex support to define white and black lists.</p><h3>AWS Gateway</h3><p>API Gateway Resource Policies allow users to define access policies at the API and method levels. Resource Policies can be used to white/black list the access to the entire API or selected methods. However, Resource Policies does not support regex, users would be required to define each IP address or CIDR block.</p><h3>Rate limit and Quota for a consumer API key</h3><p>Rate limiting is one of the fundamental aspects of the API gateway. It is used to control the rate of requests to the servers. It protects services from being overloaded.</p><p>Quota is similar to rate limiting. However, It is not used to protect services from overwhelming API resources. It is used to regulate the usage of API resources.</p><h3>Tyk Gateway</h3><p>Tyk Gateway has key level and API level <a href="https://tyk.io/docs/basic-config-and-security/control-limit-traffic/rate-limiting/">rate limiting</a>. Key level rate limiting is focused on controlling traffic from individual sources. As a use case, let’s say there is an API service that has different pricing plans, such as silver and gold and platinum. This way, users who need to consume more of the service faster can pay more for the service in a plan. When they try to use more than a limit, the Tyk Gateway key level rate-limiting feature stops them.</p><p>API level rate limiting is used to defend our services from DOS and DDOS attacks.</p><p>Tyk Gateway has a feature. Let’s say, you want to offer 5,000 requests to the API per month. You can implement that by just adding a quota to the Tyk gateway. Tyk Gateway handles resetting and managing.</p><h3>AWS Gateway</h3><p>API Gateway allows users to configure <em>Usage Plans </em>to enable customers to access selected APIs and begin <a href="https://tyk.io/docs/basic-config-and-security/control-limit-traffic/request-throttling/">throttling </a>requests to those APIs based on defined limits and quotas.</p><p>API Gateway also allows users to block IP addresses using Resource Policy definitions.</p><h3>Request Manipulation (Middleware) / Transform</h3><h3>Tyk Gateway</h3><p>Tyk Gateway has a powerful <a href="https://tyk.io/docs/plugins/">middleware scripting </a>custom plugin. In the middleware, you can <a href="https://tyk.io/docs/concepts/middleware-execution-order/">intercept and manipulate requests pre and post-execution </a>chains by Javascript functions. Request contexts, session, and specs objects are exposed in the middleware pipeline.</p><p>Request context manipulation is not limited to the header section, it can apply to the body, URL, and other contextual attributes. By changing the body, URL, and query string of the request, you can change upstream endpoints and fulfill business requirements. Post-middleware has access to session objects (metadata, quota, policies), so after execution, you are able to do anything with these objects.</p><h3>AWS Gateway</h3><p>For Input Manipulation, after integrating the API Gateway with a Lambda function, by default, the request is delivered as-is. If you want to intervene and manipulate the input, you need to change the configuration of the Integration Request and not use “ Lambda Proxy integration”. Also, if you need to manipulate with API Gateway, you would create a Mapping template after integrating Lambda and Amazon API Gateway.</p><p>Custom middleware Lambda has some disadvantages such as users having to code and maintain Lambda functions. On top of that, each API Gateway request will invoke the middleware function and the actual Lambda function, doubling the cost.</p><h3>Custom JSVM Middleware</h3><h3>Tyk Gateway</h3><p>Tyk Gateway includes a JavaScript virtualization environment called JSVM to execute JavaScript code without a browser, which can also be used with the middleware. This enables Tyk Gateway to have a Virtual Endpoints feature<a href="https://tyk.io/docs/advanced-configuration/compose-apis/virtual-endpoints/"> </a>that allows you to define JavaScript functions as API Endpoints.</p><p>Virtual Endpoints are added on top of the existing API methods, and can be used to aggregate data from different resources, or to produce a dynamic response object that converts or computes data from upstream services.</p><h3>AWS Gateway</h3><p>AWS API Gateway does not include a JavaScript virtualization environment, because AWS Lambda provides execution runtime for most of the programming languages.</p><p>So far, we’ve only compared the Tyk Gateway component with Amazon’s API Gateway, but there are lots of other feature sets available with Tyk, including their different deployment options (On-prem, hybrid, and Cloud/Multi-Cloud) as well as the open and closed source components. For example, an <a href="https://tyk.io/docs/tyk-identity-broker/">Identity broker </a>is open source while and are closed source components. Let’s dive into these components.</p><p>Tyk pump provides observability which is really important in order to take full control of APIs and identify bottlenecks, including security and operational issues. It has rich integrations with external analytic storage such as Elasticsearch, Kafka, Prometheus, and traffic analysis can be done with these tools. Also, Tyk pump supports sharded analytics, so every API or organization can use its own analytics tool.</p><p>Tyk-Sync is a command-line tool and library to manage and synchronize with version control systems (VCS). Tyk-Sync used to dump all the APIs and Policies to VCS and publish it back to another environment. It also has support for using Swagger/OpenAPI JSON files to publish APIs.</p><h3>GraphQL Support</h3><p>One of the great features of Tyk Gateway is <a href="https://tyk.io/docs/universal-data-graph/">Universal Data Graph</a>. It offers us a service to aggregate data from multiple services. You do not need to write code. You just need to create your schemas and configure data sources.</p><p>Amazon API Gateway does not support GraphQL because AWS offers its GraphQL service separately, called AWS AppSync. Both APIGateway and AppSync are services that help users create APIs, so users would be required to use both the AppSync and the APIGateway to attain GraphQL features.</p><h4>Developer Portal</h4><p>Tyk Developer Portal is used to expose a facade of your APIs. It lets third-party developers register and consume your APIs. It has Swagger support. By just adding Swagger content into the code editor, or via a link to a public Swagger hosted URL, you can expose Swagger UI to third-party developers.</p><h3>The Final Verdict</h3><p>Based on the different feature sets compared above, it’s fair to say if we compare Tyk Gateway with Amazon’s API gateway alone, Tyk Gateway leads the front by a considerable margin. This is mainly because Tyk Gateway OSS is a standalone API Gateway tool with comprehensive features. Amazon API Gateway is a lightweight service that has to integrate with other AWS services to solve the same issues Tyk Gateway, but without much flexibility.</p><p>In this article alone, we have mentioned the use of 8 different AWS services to solve the same issues that Tyk Gateway solves independently. Below are various other reasons to choose Tyk:</p><ul><li>The number of AWS services has grown massively over the years. The learning curve gap required to solve the same issues as Tyk Gateway does on AWS is massive.</li><li>Tyk has excellent documentation and is just easy to work with.</li><li>Tyk OSS is free! AWS gets costly quickly as most of our clients also have to spin up other services.</li><li>Tyk has excellent support and the power of open source! You can find your answers to issues on either Tyk docs or contact Tyk support for assistance with any problems you encounter. If that just doesn’t cut it, you can always ask the community for help on guidance.</li><li>You have the Tyk source code at hand. You can fork the latest version of Tyk to develop tailor-made solutions for your use case.</li></ul><p>Kloia’s opinion, as an Advanced AWS Consulting Partner and a Tyk Partner, would be that even though both of these tools serve the same purpose, they both have different use cases. As an always valid response in Software Engineering, there is no silver bullet, and you should always choose a solution based on your needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc422edfea63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kloia/tyk-gateway-vs-amazon-api-gateway-cc422edfea63">Tyk Gateway vs Amazon API Gateway</a> was originally published in <a href="https://medium.com/kloia">kloia</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>