<?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 Osman Okuyan on Medium]]></title>
        <description><![CDATA[Stories by Osman Okuyan on Medium]]></description>
        <link>https://medium.com/@osmanokuyan?source=rss-3b92e2513f9e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1g2qVOPGuPkxlUgi6FliVw.png</url>
            <title>Stories by Osman Okuyan on Medium</title>
            <link>https://medium.com/@osmanokuyan?source=rss-3b92e2513f9e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 10:01:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@osmanokuyan/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[My 2025 Backend Wrapped: From Invisible Bottlenecks to Event-Driven Architecture]]></title>
            <link>https://osmanokuyan.medium.com/my-2025-backend-wrapped-from-invisible-bottlenecks-to-event-driven-architecture-25b28cb46e78?source=rss-3b92e2513f9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/25b28cb46e78</guid>
            <category><![CDATA[change-data-capture]]></category>
            <category><![CDATA[cdc]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <dc:creator><![CDATA[Osman Okuyan]]></dc:creator>
            <pubDate>Sun, 28 Dec 2025 13:16:36 GMT</pubDate>
            <atom:updated>2025-12-28T13:16:36.744Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oG_ER_plYBx51TrX" /></figure><p>Every December, our feeds fill with “Wrapped” playlists. But my 2025 wasn’t scored by Spotify — it was scored by production logs, architectural pivots, and those heart-stopping moments when alerts went silent… because the monitoring itself was down.</p><p>Looking back, 2025 was the year I truly transitioned from writing code to engineering systems. It was the year I built an AI-powered Model Context Protocol (MCP) for my company, survived a massive outage caused by a silent infrastructure killer, and learned the hard way why Event-Driven Architecture isn’t just a buzzword — it’s a lifeline.</p><p>Here is my 2025 Wrapped: The outages, the solutions, and the promotion that came with them.</p><h3>Level Up: The Jump from Junior to Mid</h3><p>Before diving into the technical chaos, I want to highlight a personal milestone. Early this year, I was promoted from Junior to Mid-level Developer.</p><p>A lot of developers ask, “What is the exact checklist to get promoted?” Looking back, it wasn’t just about writing cleaner Ruby code or mastering Go. It was about a shift in mindset.</p><p>I stopped waiting for tasks to be assigned to me and started <strong>actively seeking out ownership</strong>. I stepped up to handle parts of the legacy monolith that were <strong>rarely touched due to their complexity</strong>. I realized that technical growth is a byproduct of solving harder problems. You don’t learn how to fix a production outage by reading about it; you learn by being the one who raises their hand to say, “I’ll handle this.”</p><p>This mindset shift was the catalyst for everything that followed.</p><h3>The Crisis: The Invisible Killer</h3><p>Every developer has a “war story.” Mine happened this year, and the culprit was an invisible infrastructure bottleneck.</p><p>Our main monolith is a Rails application powering a Restaurant Management System (RMS) and POS. The logic relies heavily on the Order model. When an order is finalized, a massive chain of callbacks fires—sending data to 3rd party integrations, updating inventory, etc. We handled this asynchronously using Sidekiq, backed by Redis.</p><p>One day, our Redis instance went silent. It was running on an instance type with a <strong>burstable performance profile</strong>. We hadn’t set up monitoring for the specific saturation points of this profile. Under sustained load, we hit a hard limit we didn’t see coming. The CPU was aggressively throttled to its baseline, effectively freezing the instance.</p><h3>The Domino Effect</h3><p>You might think, <em>“If Redis is down, only background jobs should fail, right?”</em> <strong>Wrong.</strong></p><p>Because our Rails app was trying to enqueue jobs into Redis within the main request cycle, the application started hanging. It waited for a response from Redis that never came.</p><ul><li><strong>The Result:</strong> The main business logic (finalizing orders) locked up. The POS system became unresponsive. A simple infrastructure oversight brought the entire business operation to a halt.</li></ul><h3>The Solution: Event-Driven Architecture with CDC</h3><p>We realized we had a tight coupling problem. The “Finalizing an Order” action should never depend on whether Redis is alive.</p><p>To solve this, we shifted to an <strong>Event-Driven Architecture</strong> using the <strong>Outbox Pattern</strong> and <strong>Change Data Capture (CDC)</strong>.</p><p>Instead of pushing directly to Redis during the request:</p><ol><li>The Rails app simply updates the Order status to completed in PostgreSQL. The transaction commits immediately. The POS responds instantly.</li><li>We implemented a CDC tool to listen to the PostgreSQL WAL (Write-Ahead Logs).</li><li>When the tool detects a change in the Order table, <em>it</em> triggers the necessary events and handles the background jobs asynchronously.</li></ol><h3>Why Go and Trendyol’s go-pg-cdc?</h3><p>While we are primarily a Ruby shop, I had already initiated a stack modernization earlier this year by migrating our Public API from Crystal to <strong>Go (using Fiber)</strong>. Seeing the performance gains there gave me the confidence to choose Go again for this specific component.</p><p>We utilized <a href="https://github.com/Trendyol/go-pq-cdc">go-pq-cdc</a>, an excellent open-source tool developed by the engineering team at <strong>Trendyol</strong>. It allowed us to stream database changes efficiently without adding load to our Rails monolith. Thanks to this shift, even if Redis disappears completely today, our customers can still close orders and take payments. The system is resilient.</p><h3>The New Interface: AI-Powered Back Office</h3><p>With our order pipeline now resilient, I finally had the bandwidth to support our client teams (Web, iOS, Android) on a major new feature. We wanted to enable our customers to interact with their data and perform back-office operations using AI.</p><p>My second major project of 2025 was building the <strong>Model Context Protocol (MCP) for our POS project</strong>.</p><p>We didn’t just want a chatbot that summarizes text; we wanted an actionable Gateway for our customers. The challenge was orchestrating our hybrid API ecosystem to support these natural language requests. We have a comprehensive GraphQL API for mutations (complex business operations like adding a new revenue center or updating menu items) and a REST API for rapid data retrieval.</p><p>I engineered the MCP to act as an intelligent router. Based on the customer’s prompt, the system detects the intent:</p><ul><li><em>Is the user trying to change the state?</em> -&gt; <strong>Route to GraphQL.</strong></li><li><em>Is the user analyzing data?</em> -&gt; <strong>Route to REST.</strong></li></ul><p>This project transformed the user experience, allowing customers to handle complex back-office tasks simply by asking, rather than navigating through multiple menus.</p><h3>Open Source Contribution: toon-format</h3><p>Working with LLMs brings a new constraint: <strong>Token Limits.</strong></p><p>Sending massive JSON payloads to an AI model is expensive and slow. The verbose syntax of JSON ({ &quot;key&quot;: &quot;value&quot; }) eats up valuable context windows.</p><p>We needed a leaner format. Inspired by a JavaScript implementation, I developed and open-sourced <a href="https://github.com/osmanok/toon-format">toon-format</a>, a Ruby gem designed to parse and format JSON into a token-efficient structure.</p><p>By using toon-format in our pos-mcp project, we significantly reduced the payload size sent to the LLM. It was a perfect example of solving a specific business problem (cost &amp; latency) and sharing the solution back to the community.</p><h3>My Greatest Promotion: Fatherhood</h3><p>While 2025 was full of code, commits, and configurations, the most significant deployment didn’t happen on a server.</p><p>On <strong>December 23rd</strong>, my daughter was born. Holding her for the first time was the perfect finale to a chaotic but rewarding year. It puts all the outages and deadlines into perspective.</p><h3>Hello, 2026</h3><p>If 2025 was about stepping up, 2026 will be about <strong>deepening</strong>.</p><p>My goal for the upcoming year is to master <strong>System Design</strong>. I want to move beyond just implementing patterns and start architecting resilient systems from the ground up.</p><p>I’m ready for more responsibility, harder problems, and hopefully, mastering the art of sleeping in 90-minute increments.</p><p>Happy New Year!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25b28cb46e78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use AWS Assume Role Credentials in Ruby]]></title>
            <link>https://blog.simprasuite.com/how-to-use-aws-assume-role-credentials-in-ruby-4a8772611d5a?source=rss-3b92e2513f9e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a8772611d5a</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[assume-role]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Osman Okuyan]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 12:37:11 GMT</pubDate>
            <atom:updated>2025-01-10T12:37:11.590Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Written by </em><a href="https://medium.com/u/3b92e2513f9e"><em>Osman Okuyan</em></a><em> &amp; </em><a href="https://medium.com/u/59f8bf87efcc"><em>Hasan Umut Yağcı</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X7Y7UGzRGWrLwpYEW58MhQ.png" /></figure><h4>Introduction</h4><p>In this blog post, we’ll explore how to use AWS Assume Role credentials in Ruby. Assuming roles in AWS allows you to temporarily gain access to different AWS accounts or services with the necessary permissions. This can be particularly useful for managing access control and improving security in multi-account environments.</p><h4>Prerequisites</h4><p>Before we dive into the code, make sure you have the following prerequisites:</p><ol><li>An AWS account with IAM roles set up.</li><li>Ruby installed on your system.</li><li>The aws-sdk gem installed.</li></ol><h4><strong>Setting Up IAM Roles</strong></h4><p>You would need two roles on this setup. One role will be attached to the compute resource itself (ECS, EC2, etc.) and the other role will have the necessary permissions for the required operations.</p><h4>Trust relationships (Resource role)</h4><p>The resource role should have a trust policy similar to the one below.</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>                &quot;Service&quot;: &quot;ecs-tasks.amazonaws.com&quot;<br>            },<br>            &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>        }<br>    ]<br>}</pre><p>This will allow the ECS service to assume another role. You may need to modify “Service” depending on the compute resource. If you attach the role to an EC2 Instance, the value should be “ec2.amazonaws.com”.</p><h4>Permissions (Resource role)</h4><p>Resource role also requires a permission policy to allow assuming the target role.</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: &quot;sts:AssumeRole&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:iam::123456789123:role/target-role-name&quot;<br>        }<br>    ]<br>}</pre><p>Now that we set up the IAM role on the compute resource we need to set a secondary role with necessary permissions.</p><h4>Trust relationships (Target role)</h4><p>The target role should trust the resource role. You may extend this trust policy with additional security measures like external ID.</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: {<br>                &quot;AWS&quot;: [<br>                    &quot;arn:aws:iam::123456789123:role/resource-role-name&quot;<br>                ]<br>            },<br>            &quot;Action&quot;: &quot;sts:AssumeRole&quot;,<br>            &quot;Condition&quot;: {<br>                &quot;StringEquals&quot;: {<br>                    &quot;sts:ExternalId&quot;: &quot;given-external-id&quot;<br>                }<br>            }<br>        }<br>    ]<br>}</pre><h4>Permissions (Target role)</h4><p>This permission policy attached to the target role should have the required permissions for the related AWS service e.g. an S3 bucket.</p><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;s3:ListAllMyBuckets&quot;<br>            ],<br>            &quot;Resource&quot;: &quot;*&quot;<br>        },<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;s3:ListBucket&quot;<br>            ],<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::your-bucket-name&quot;<br>        },<br>        {<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Action&quot;: [<br>                &quot;s3:GetObject&quot;,<br>                &quot;s3:PutObject&quot;,<br>                &quot;s3:DeleteObject&quot;<br>            ],<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::your-bucket-name/*&quot;<br>        }<br>    ]<br>}</pre><h4><strong>How to Get the Role ARN</strong></h4><p>After creating the role, you can get the role ARN from the IAM page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtlw7fz3PUFBUYraOSiW4A.png" /></figure><h4><strong>Set Up AWS Client and Assume Role:</strong></h4><pre>require &#39;aws-sdk-sts&#39;<br><br>sts_client = Aws::STS::Client.new(<br>  region: &#39;eu-west-1&#39; # Change to your desired region<br>)<br><br>role_arn = &#39;arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME&#39;<br>role_session_name = &#39;my_session&#39;<br><br>assumed_role = sts_client.assume_role(<br>  role_arn: role_arn,<br>  role_session_name: role_session_name<br>)<br><br>credentials = assumed_role.credentials</pre><h4><strong>Use the Assumed Role Credentials:</strong></h4><pre>require &#39;aws-sdk-s3&#39;<br><br># Initialize the S3 client with given credentials<br>s3_client = Aws::S3::Client.new(<br>  region: &#39;eu-west-1&#39;, # Change to your desired region<br>  access_key_id: credentials.access_key_id,<br>  secret_access_key: credentials.secret_access_key,<br>  session_token: credentials.session_token<br>)<br><br># Specify bucket name and object key<br>bucket_name = &#39;your-bucket-name&#39;<br>object_key = &#39;your-object-key&#39;<br><br># Fetch the object from S3<br>resp = s3_client.get_object(<br>  bucket: bucket_name,<br>  key: object_key<br>)<br><br>puts resp.body.read</pre><pre>const AWS = require(&#39;aws-sdk&#39;);<br><br>// Initialize the S3 client with given credentials<br>const s3 = new AWS.S3({<br>  region: &#39;eu-west-1&#39;, // Change to your desired region<br>  accessKeyId: credentials.access_key_id,<br>  secretAccessKey: credentials.secret_access_key,<br>  sessionToken: credentials.session_token<br>});<br><br>// Specify bucket name and object key<br>const bucketName = &#39;your-bucket-name&#39;;<br>const objectKey = &#39;your-object-key&#39;;<br><br>// Fetch the object from S3<br>s3.getObject({ Bucket: bucketName, Key: objectKey }, (err, data) =&gt; {<br>  if (err) {<br>    console.error(&#39;Error fetching object:&#39;, err);<br>  } else {<br>    console.log(&#39;Object Content:&#39;, data.Body.toString());<br>  }<br>});</pre><h3>Benefits of Using Session Credentials</h3><h4>Enhanced Security</h4><p>By using session credentials, you significantly reduce the risk associated with long-term credentials. Temporary credentials are valid only for a limited time and are automatically invalidated after the session duration expires. This minimizes the impact if credentials are compromised.</p><h4>Avoid Hard-Coding Access Keys</h4><p>With session credentials, you avoid the need to hard-code access keys and secret access keys in your codebase. Hard-coding credentials is a security risk, as they can be accidentally exposed through code repositories or logs. Instead, you dynamically generate temporary credentials at runtime.</p><h3>Conclusion</h3><p>Using AWS Assume Role credentials in Ruby can greatly enhance the security and flexibility of your applications. By assuming roles, you can manage permissions more effectively and ensure that your applications have the right level of access to AWS resources without hard-coding long-term credentials.</p><p>Make sure to handle session expiration gracefully in your application to maintain seamless access to AWS resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kRCPmhXMsE5LHOYHGTX3gw.png" /></figure><h3>Additional Tips</h3><ul><li><strong>Environment Variables:</strong> Consider storing your AWS credentials in environment variables to keep them secure.</li><li><strong>Session Duration:</strong> You can specify the duration for the assumed role session by adding the duration_seconds parameter to the assume_role method.</li></ul><h3>References</h3><ul><li><a href="https://docs.aws.amazon.com/sdk-for-ruby/">AWS SDK for Ruby Documentation</a></li><li><a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AWS STS AssumeRole API</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a8772611d5a" width="1" height="1" alt=""><hr><p><a href="https://blog.simprasuite.com/how-to-use-aws-assume-role-credentials-in-ruby-4a8772611d5a">How to Use AWS Assume Role Credentials in Ruby</a> was originally published in <a href="https://blog.simprasuite.com/">Simpra Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>