<?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 Kaan Küçük on Medium]]></title>
        <description><![CDATA[Stories by Kaan Küçük on Medium]]></description>
        <link>https://medium.com/@kagann?source=rss-985e467612a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Pi9vzNuyzH2BsoZXsATPwg.png</url>
            <title>Stories by Kaan Küçük on Medium</title>
            <link>https://medium.com/@kagann?source=rss-985e467612a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 14:32:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kagann/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[Optimizing Supply Chain Management with AWS Neptune, Gremlin, Go, and Kafka]]></title>
            <link>https://medium.com/@kagann/optimizing-supply-chain-management-with-aws-neptune-gremlin-go-and-kafka-abdf0c1b0f79?source=rss-985e467612a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/abdf0c1b0f79</guid>
            <category><![CDATA[supply-chain]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[aws-neptune]]></category>
            <category><![CDATA[graph-database]]></category>
            <dc:creator><![CDATA[Kaan Küçük]]></dc:creator>
            <pubDate>Wed, 23 Apr 2025 20:28:59 GMT</pubDate>
            <atom:updated>2025-04-24T16:25:54.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4bk-0c6GVSRirITf_5D7-g@2x.jpeg" /><figcaption>Photo by <a href="http://jefffinley.org/">Jeff Finley</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>Supply chain management today is a complex web of suppliers, warehouses, and distribution routes. Even minor disruptions can have huge impacts — <a href="https://aws.amazon.com/blogs/database/supply-chain-data-analysis-and-visualization-using-amazon-neptune-and-the-neptune-workbench/#:~:text=customer%20and%20supplier%20needs,end">one study found significant production disruptions now occur every 3.7 years on average and could cost up to 45% of a year’s earnings over a decade</a> . To build resilience and efficiency, companies need full visibility into product movements and inventory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SH5n0-Fp-cBhHZSL8rLpsQ.png" /></figure><p>This is where modern graph database technology comes into play.<strong> </strong><a href="https://aws.amazon.com/neptune/"><strong>Amazon AWS Neptune</strong></a><strong>,</strong> a <strong>fully-managed graph database </strong>service, allows organizations to model their supply network as a graph of interconnected nodes, enabling rich, real-time queries across complex relationships. When combined with the <strong>Gremlin query language</strong> for graph traversal, a performant backend language like <strong>Go</strong>, and a streaming platform such as Apache <strong>Kafka</strong> for real-time data, we get a powerful toolkit for optimizing product distribution and warehouse availability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CzV-0eIcx6M1TzlGEuMcTg.png" /></figure><p>In this article, we’ll explore how these technologies interact in a <strong>supply chain context.</strong> We’ll see why Neptune’s graph database approach is well-suited for modeling supply chains, walk through an example use case of product distribution and warehouse optimization, illustrate some <strong>Gremlin queries</strong> for common supply chain analyses, and discuss how a <strong>Go</strong> application and <strong>Kafka</strong> streaming come together to deliver real-time insights. The goal is a high-level but informative look at leveraging <strong>Neptune, Gremlin, Go, and Kafka</strong> to make supply chains smarter and more efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*lLBX9k-zZ-IQZYHhqXG5BQ@2x.jpeg" /></figure><h3><strong>AWS Neptune: The Power of Graph Databases</strong></h3><p><strong>Amazon Neptune</strong> is AWS’s fast, <strong>fully-managed graph database</strong> service for highly connected data. Unlike traditional relational databases, which store data in tables and require costly <strong>JOIN</strong> operations to connect related records, Neptune stores data as nodes (vertices) and relationships (edges) in a graph structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*2kr_lpi-fwcA8zKUe3XrMg@2x.jpeg" /></figure><p>This means relationships are <strong>first-class citizens</strong> — you can traverse connections directly without expensive multi-table joins. In scenarios with many interrelated entities (like products moving through various locations), graph databases excel. <a href="https://aws.amazon.com/blogs/database/supply-chain-data-analysis-and-visualization-using-amazon-neptune-and-the-neptune-workbench/#:~:text=Relational%20databases%20aren%E2%80%99t%20optimized%20for,cooperating%20links%20in%20the%20chain">In fact, relational databases aren’t optimized for very complex queries involving lots of joins or frequent schema changes, whereas graph databases directly represent networks and easily evolve with new relationship types</a>. Neptune lets you <strong>ask deep and complex questions</strong> about your supply chain data by leveraging these relationships — <a href="https://aws.amazon.com/blogs/database/supply-chain-data-analysis-and-visualization-using-amazon-neptune-and-the-neptune-workbench/#:~:text=Graph%20analytics%20on%20Amazon%20Neptune,cooperating%20links%20in%20the%20chain">not just about individual data points, but how all the links in the chain interact</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*mFzBzIp0aMFzu7_ZII_ajA@2x.jpeg" /></figure><p>Neptune’s key features make it ideal for supply chain applications. It supports both the <strong>property graph model</strong> (queried with Gremlin or openCypher) and RDF model (queried with SPARQL), giving flexibility in how you model data. It’s ACID-compliant and highly available, with replication across multiple AZs and point-in-time recovery for reliability. In terms of performance and scale, Neptune can handle graphs with <strong>billions of relationships</strong> and execute over <strong>100,000 queries per second</strong>, scaling storage up to 128 TiB and supporting up to <a href="https://aws.amazon.com/neptune/#:~:text=Scale%20your%20graphs%20with%20unlimited,to%2015%20replicas%20per%20cluster">15 read replicas for heavy workloads</a>. This means even a vast supply network (thousands of products, warehouses, routes, etc.) can be stored and queried with low latency. Neptune also continually improves — for example, it introduced a <strong>Serverless</strong> option that auto-scales capacity based on demand, making it easier and cost-effective to handle spiky <a href="https://aws.amazon.com/about-aws/whats-new/2022/10/amazon-neptune-serverless-generally-available/#:~:text=If%20you%20have%20unpredictable%20and,TinkerPop%20Gremlin%2C%20openCypher%2C%20and%20SPARQL">workloads without manual</a> <a href="https://aws.amazon.com/about-aws/whats-new/2022/10/amazon-neptune-serverless-generally-available/#:~:text=Amazon%20Neptune%20Serverless%20is%20a,to%20meet%20your%20application%E2%80%99s%20needs">capacity planning</a>. In short, Neptune provides the power of graph queries with the convenience of a managed service, which is a strong foundation for modern supply chain management systems.</p><h3><strong>Use Case: Product Distribution and Warehouse Optimization</strong></h3><p>To understand the benefits, imagine a company with dozens of warehouses and distribution centers globally. Products flow from manufacturers to regional warehouses, then to local fulfillment centers, and finally to retail stores or customers. Key challenges include:</p><p>• <strong>Tracking product movement across multiple warehouses:</strong> If a product needs to go from Warehouse A to Store Z, what path (through which distribution centers) should it take?</p><p>• <strong>Evaluating product availability in real time:</strong> Can we quickly find which warehouse has stock of a particular product when an order comes in, and how much?</p><p>• <strong>Identifying bottlenecks:</strong> Are there single points of failure (like one warehouse or route that many products depend on) that could cause delays if disrupted?</p><figure><img alt="Example graph model linking organizations, locations, warehouses, and products in a supply chain." src="https://cdn-images-1.medium.com/max/1000/1*JwsYW15cFkdlgycD3leCFw.png" /><figcaption><em>Figure: Example graph model linking organizations, locations, warehouses, and products in a supply chain.</em></figcaption></figure><p>Traditional systems might use relational databases with separate tables for warehouses, inventory, routes, etc., making these queries complex (multiple joins) and not truly real-time. By contrast, using a <strong>graph database</strong> model, we represent warehouses, hubs, and products as nodes, and the relationships (stock levels, transit routes, etc.) as edges. This allows us to query the network of connections directly. For example, a “Warehouse” node can have an edge to a “Product” node indicating it <em>stocks</em> that product, and edges between warehouse nodes can indicate direct <em>shipping routes</em> or <em>transfers</em>. A product moving through the supply chain is then like a packet traveling through a network — and Neptune can find optimal paths or connected components of that network efficiently.</p><p>In the graph model (as illustrated above), each entity in the supply chain is a vertex: Organizations, Locations, Warehouses, Factories, Products, etc. Edges capture relationships like <em>owns</em>, <em>has_location</em>, <em>has_stock</em>, <em>delivers_to</em>, or <em>is_made_of</em> (for components in a product bill of materials). This holistic view means we can trace a product’s journey or dependencies easily. For instance, to evaluate product availability, we can traverse from a Product node to all Warehouse nodes that have it in stock. To optimize distribution, we can query possible routes between locations and choose the shortest or fastest path. And to find bottlenecks, we might look for nodes with an unusually high number of dependencies (e.g. a single supplier providing a critical component to many products, or one warehouse that feeds many regions).</p><p>Graph databases solve these problems efficiently by treating the supply chain as a <em>graph of nodes and edges</em>, matching the real-world structure. This provides <strong>increased visibility</strong> into the supply network and helps in <strong>bottleneck identification</strong> — <a href="https://aws.amazon.com/blogs/database/supply-chain-data-analysis-and-visualization-using-amazon-neptune-and-the-neptune-workbench/#:~:text=Therefore%2C%20with%20full%20supply%20chain,depth%20understanding%20of%20the%20suppliers">for example, quickly spotting if a single warehouse is central to many products</a>. Because Neptune can handle complex traversals with ease, the system can evaluate queries like “find the nearest warehouse with product X in stock” or “what other shipments would be delayed if Warehouse Y went down?” in <strong>real time</strong>. And by updating the graph continuously (with streaming data, as we’ll discuss), the information is always up-to-date. Overall, modeling the supply chain in Neptune allows for smarter product distribution strategies and proactive inventory management that would be hard to achieve with siloed or relational data alone.</p><h3><strong>Gremlin Queries for Supply Chain Analysis</strong></h3><p>The Gremlin query language, part of Apache TinkerPop, is used to navigate and query graph data in Neptune. Gremlin queries are expressed as traversals — you start at certain vertices and then “walk” along edges to find related vertices, filtering or aggregating as you go. Let’s look at a few simple Gremlin query examples that illustrate common supply chain questions:</p><p><strong>Example 1: Finding the shortest path from a product’s origin to destination</strong></p><p>Imagine you want to find how a product can travel from its origin warehouse to a destination (perhaps a customer’s region or a specific store’s warehouse). In graph terms, this is a pathfinding query. With Gremlin, you can perform a traversal that explores the <em>connected_to</em> (or <em>delivers_to</em>) edges between warehouses until it reaches the target. For example:</p><pre>// Find one path from Warehouse A to Warehouse Z<br>g.V(&#39;WarehouseA&#39;).repeat(out(&#39;connected_to&#39;)).until(has(&#39;name&#39;, &#39;WarehouseZ&#39;)).path().limit(1)</pre><p>This traversal starts at the vertex with ID or name “WarehouseA”, then repeatedly follows outgoing connected_to edges (which represent direct routes between facilities) until it reaches a vertex with name “WarehouseZ”. The result is a path — essentially the sequence of hops from A to Z. By limiting to 1, we get one of the shortest paths (Gremlin traversals naturally expand in breadth-first order unless specified otherwise). In a supply chain app, such a query could be used to quickly determine how to route a shipment. If multiple paths exist, you could drop the limit(1) to get all possible routes, or use algorithms (Neptune has built-in graph algorithms) to specifically compute the shortest/lowest-cost path. The key is that traversing relationships in Gremlin is straightforward, whereas doing this in a relational model would require recursive joins or complex SQL.</p><h4><strong>Example 2: Querying available stock across different warehouses</strong></h4><p>For inventory management, you often need to know <em>where</em> a product is available and in what quantity. In our graph, suppose <strong>Product</strong> vertices are connected to <strong>Warehouse</strong> vertices by an edge (say, has_stock) that carries a property for the quantity. We can query the graph to find all warehouses stocking a particular product and even sum up the total availability. For instance:</p><pre>// List warehouses that have Widget in stock and the quantities<br>g.V().has(&#39;product&#39;, &#39;name&#39;, &#39;Widget&#39;)<br>     .inE(&#39;has_stock&#39;).as(&#39;stockEdge&#39;)<br>     .outV().as(&#39;warehouse&#39;)<br>     .select(&#39;warehouse&#39;, &#39;stockEdge&#39;).by(&#39;name&#39;).by(&#39;quantity&#39;)</pre><p>In this example, we first find the product vertex with name <strong>“Widget”</strong>. Then <em>.inE(‘has_stock’)</em> moves along incoming stock edges (i.e., edges coming into the product from warehouses) — this finds all the has_stock relationships linking warehouses to that product. We mark that edge as stockEdge and then use .outV() to get back to the warehouse vertex on the other end of each edge (marking it as warehouse). The final select step retrieves the warehouse name and the quantity property from the edge, giving us a list of warehouses and how many “Widget” units each has. We could easily extend this to filter only warehouses above or below a certain stock threshold, or sum the quantities across all warehouses using .values(‘quantity’).sum(). Gremlin makes it easy to express these needs declaratively. In a live system, a query like this could be triggered whenever a customer searches for a product, to instantly show which locations have availability.</p><h4>Example 3: Identifying potential bottlenecks in distribution</h4><p>Graph queries can also help reveal structural bottlenecks in the supply chain network. One sign of a bottleneck could be a <strong>hub</strong> through which many routes pass or a supplier on which many products depend. As a simple example, suppose we want to find a warehouse that is heavily utilized in distribution (maybe it connects to many other warehouses or stores). We could query for the warehouse with the highest number of outgoing routes:</p><pre>// Find the warehouse that delivers to the most other locations<br>g.V().hasLabel(&#39;Warehouse&#39;)<br>     .order().by(out(&#39;connected_to&#39;).count(), decr).limit(1)<br>     .values(&#39;name&#39;)</pre><p>This traversal looks at all vertices with label “Warehouse”, orders them by the count of their outgoing connected_to edges (in descending order), and then picks the top one, returning its name. The result is the warehouse that ships to the largest number of other nodes — a potential central hub in the network. If such a node is overly critical, it might be a distribution bottleneck (or a single point of failure if something goes wrong there). Similarly, you could flip this to look at incoming edges (who receives from the most sources) or use other relationship types.</p><p>Another bottleneck scenario is on the supply side: identifying if a certain <strong>Supplier</strong> provides a component with no alternate sources. A Gremlin query like g.V().hasLabel(‘Product’).filter(in(‘supplies’).count().is(1)) could list products that have only one supplier. Those products are at risk if that lone supplier has issues. By traversing the graph, we can pinpoint such vulnerabilities and take action (e.g., qualify a second supplier) before they become actual breakpoints.</p><p>These examples barely scratch the surface, but they show how Gremlin queries on Neptune can answer practical questions. The graph approach allows asking things like “show me the web of dependencies” or “find critical connections” in a way that’s much more natural and efficient than relational queries. In Neptune’s managed environment, these traversals are optimized and can run in milliseconds even on large datasets, providing actionable insights for supply chain managers in real time.</p><h3>Integrating with Go and Kafka</h3><p>So far, we’ve focused on Neptune and Gremlin for data storage and querying. But to build a complete solution, we need application logic and data streaming. This is where <strong>Go</strong> and <strong>Kafka</strong> come into play.</p><p><strong>Why Go?</strong> Go (Golang) is a popular choice for building cloud services and microservices due to its performance, simplicity, and strong concurrency support. A Go service can act as the intermediary between Neptune and end-user interfaces or other systems in a supply chain application. For example, you might develop a Go web API that receives requests (like “find nearest warehouse with product X”) and, under the hood executes the appropriate Gremlin query on Neptune, then returns the result.</p><p>Go’s efficiency is a big plus here — it can handle numerous concurrent requests (leveraging goroutines and a lightweight thread model), making it well-suited for the high throughput demands of supply chain systems. Additionally, AWS provides an official <strong>Gremlin Go client</strong> (part of Apache TinkerPop) which allows Go applications to connect to Neptune’s Gremlin endpoint easily. For instance, with the Gremlin-Go driver, a Go program can open a WebSocket to Neptune and run traversals; a basic snippet looks like:</p><pre>// Connect to Neptune (Gremlin endpoint) and run a simple traversal in Go<br>driverRemoteConnection, _ := gremlingo.NewDriverRemoteConnection(<br>    &quot;wss://&lt;neptune-endpoint&gt;:8182/gremlin&quot;, func(settings *gremlingo.DriverRemoteConnectionSettings) {<br>        settings.TraversalSource = &quot;g&quot;<br>    })<br>defer driverRemoteConnection.Close()<br><br>g := gremlingo.Traversal_().WithRemote(driverRemoteConnection)<br>results, err := g.V().hasLabel(&quot;Warehouse&quot;).count().ToList()  // example query</pre><p>In this pseudo-code, we use the Neptune cluster’s endpoint to create a remote connection, then build a Gremlin traversal (g.V().hasLabel(“Warehouse”).count()) to count all warehouse vertices . The Gremlin query is constructed in Go using the driver’s fluent API, and the results can be handled natively in the Go program. This integration means your business logic (written in Go) can seamlessly query Neptune and use the responses to make decisions or feed into other processes. Go’s strong typing and simplicity also help maintain robust code for critical supply chain operations.</p><p>Now, consider <strong>Apache Kafka</strong> as the backbone for real-time data. Kafka is a distributed streaming platform often used for building data pipelines and event-driven systems. In a supply chain scenario, Kafka can ingest and propagate events such as inventory updates, shipment statuses, new orders, or delays. By integrating Kafka (for example using <strong>Amazon MSK</strong>, the managed Kafka service on AWS), you create a decoupled, real-time flow of information through the system. For instance, each time a product’s stock level changes in a warehouse, an event can be produced to a Kafka topic. The Go service can consume these events and update Neptune accordingly (e.g., decrement the stock count on one node and increment it on another if a transfer happens). Conversely, you might have a service that listens for certain graph query results and pushes notifications — there are many possibilities with an event-driven approach.</p><p>Kafka ensures that the different components of the supply chain platform remain loosely coupled. Warehouses, ordering systems, delivery tracking — all can publish events to Kafka without needing direct knowledge of the Neptune database. The Neptune-focused service (the Go application) consumes those events and keeps the graph up-to-date, or runs specific analytics. This design is robust and scalable: if the volume of events grows, you can scale out consumers, use partitioned topics, etc., to handle it. In fact, using Kafka as a <strong>pub-sub hub</strong> for Neptune integration is a pattern that AWS has showcased in other contexts (for example, streaming updates from one database into Neptune) . It’s proven to work for high volumes — companies like Walmart use Kafka as the central nervous system of their real-time inventory systems in supply chain operations . Kafka’s ability to buffer and stream data in real time complements Neptune’s real-time query capabilities, resulting in an always-fresh view of the supply chain state.</p><p>In summary, the role of Go and Kafka is to bring the graph database to life in an operational environment. Go provides the <em>glue</em> and logic — a speedy, concurrent service that can handle API requests and integrate with AWS services — while Kafka provides the <em>data pipeline</em>, feeding Neptune with a continuous stream of updates and ensuring all changes (new shipments, inventory adjustments, demand spikes) are reflected in the graph as they happen. Together, they enable a supply chain management system that is not only <strong>data-rich</strong> (thanks to Neptune’s graph model) but also <strong>real-time and reactive</strong> to changes (thanks to Kafka and a well-architected Go service).</p><h3>Conclusion</h3><p>Modern supply chain management benefits immensely from graph-based approaches and real-time data processing. By using AWS Neptune as a graph database, organizations gain the ability to model their entire supply network in a natural, connected way and query it for complex insights that traditional SQL databases struggle to deliver. Gremlin as a query language unlocks flexible traversals to find optimal paths, aggregate inventory information, and uncover hidden bottlenecks in the chain. When these capabilities are combined with a performant Go microservice (to interface with the database and external applications) and Apache Kafka for streaming updates, the result is a responsive, scalable system for supply chain optimization.</p><p>The <strong>benefits</strong> are clear: end-to-end visibility, faster decision-making, and improved agility in the face of disruptions. With Neptune, queries that once took minutes or hours can run in milliseconds, even as the dataset grows — enabling, for example, real-time inventory checks across dozens of warehouses or instant rerouting of shipments when a node goes down. The addition of Kafka means the data driving these decisions is always current, as events from the field flow in continuously rather than in batch updates. Go ties it all together with a clean, efficient codebase that can scale as needed to handle user demands and processing logic.</p><p>Looking ahead, graph-based supply chain systems can be extended with advanced analytics and machine learning. Neptune’s support for graph algorithms and even integration with ML (like Amazon Neptune ML for predictions) hints at future possibilities — such as predicting supply chain disruptions before they happen or automatically optimizing stock levels using AI on the graph. Moreover, the same stack can be expanded to incorporate more AWS services: imagine integrating IoT sensor data via Kafka for real-time tracking, or using AWS Lambda to trigger certain Gremlin queries on events. The combination of Neptune, Gremlin, Go, and Kafka provides a strong foundation today, and it opens the door to continuous improvement and innovation in supply chain management.</p><p>In conclusion, optimizing product distribution and warehouse availability is a challenging endeavor, but with the right tools it becomes significantly more manageable. AWS Neptune brings the power of graph databases to model the supply chain, Gremlin lets us extract insights from those connections, Go enables building high-performance services around the data, and Kafka ensures we react to the latest information instantly. Together, they form a modern, efficient approach to supply chain management that can help companies stay resilient, responsive, and a step ahead in delivering products to the right place at the right time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abdf0c1b0f79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Shifting Focus: Moving from Data Sharing to Behavior-Centric Events in E-Commerce]]></title>
            <link>https://medium.com/swlh/shifting-focus-moving-from-data-sharing-to-behavior-centric-events-in-e-commerce-d70dbf4200a4?source=rss-985e467612a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/d70dbf4200a4</guid>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[eda]]></category>
            <category><![CDATA[microservice-architecture]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[data-localization]]></category>
            <dc:creator><![CDATA[Kaan Küçük]]></dc:creator>
            <pubDate>Sat, 14 Oct 2023 19:20:01 GMT</pubDate>
            <atom:updated>2023-10-28T10:22:38.090Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*R0jzEM-BHSWPjt5t3wk3cw@2x.jpeg" /></figure><p>In the busy world of e-commerce, data flows non-stop across different microservices that make up the system, much like blood flowing through veins. Lately, the big idea has been to centralize data so that every service can get the info it needs easily. But, when we use Event-Driven Architecture (EDA) and focus mainly on data, we might be missing out on something more valuable: behavior-centric events.</p><h3>Understanding Data-Centric Events</h3><p>In a setup where data is the king, events are usually kicked off by basic data actions — creating, reading, updating, or deleting data (the CRUD operations). So, when a piece of data changes, an event is sent out to the system. This way of doing things looks more at the ‘what happened’ rather than the ‘why it happened.’ It’s like knowing a customer changed their shopping cart, but not getting why they did it.</p><h3>The Behavior-Centric Way</h3><p>On the flip side, behavior-centric events go a level deeper. They capture the business logic or the user actions that led to the data change. Taking the shopping cart example, a behavior-centric event would tell us that a customer added a new item to their cart because they got a discount offer. This approach gives us a clearer picture of user actions and business processes.</p><h3>Why It Matters in Microservices</h3><p>In a microservices setup, understanding the difference between these two approaches is crucial. Behavior-centric events give a richer understanding of user interactions, allowing services to respond to business processes, not just data changes. This way, services are better separated from each other, as each microservice responds to business events instead of just reacting to data changes elsewhere.</p><h3>Towards a Better User Experience</h3><p>For e-commerce platforms aiming to improve user experience and work efficiency, moving the focus from data to behavior-centric events can be a big deal. This change could give better insights into customer behavior, make workflows smoother, and create a more intuitive, responsive system.</p><h3>Making the Change</h3><p>Moving from data-centric to behavior-centric events requires a change in how engineers and architects think. It’s about going from just reacting to data changes to understanding and responding to user behaviors and business processes. Though it might be a tough shift, it can lead e-commerce platforms to more meaningful interactions, happier users, and a stronger place in the market.</p><p>As engineers in the ever-changing e-commerce scene, embracing behavior-centric events could be the key to discovering valuable insights and building a more responsive, user-friendly platform.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d70dbf4200a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/shifting-focus-moving-from-data-sharing-to-behavior-centric-events-in-e-commerce-d70dbf4200a4">Shifting Focus: Moving from Data Sharing to Behavior-Centric Events in E-Commerce</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling Your Microservices for High Performance and Availability]]></title>
            <link>https://medium.com/@kagann/scaling-your-microservices-for-high-performance-and-availability-4dcba8891774?source=rss-985e467612a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dcba8891774</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[scalability-in-cloud]]></category>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Kaan Küçük]]></dc:creator>
            <pubDate>Thu, 02 Mar 2023 06:40:48 GMT</pubDate>
            <atom:updated>2023-10-14T19:21:11.207Z</atom:updated>
            <content:encoded><![CDATA[<p>Scaling Your Microservices for High <strong>Performance</strong> and <strong>Availability</strong></p><p><strong>Microservices</strong> have become a popular way to build <strong>complex systems</strong> by breaking them down into smaller, <strong>independent services that work together</strong> to deliver the required functionality. However, as these systems grow and evolve, it becomes increasingly important to build them in a way that can scale with changing needs.</p><p>To achieve <strong>scalability in microservices</strong>, we need to design our microservices in a way that allows us to easily add or remove resources as needed. This means building our microservices with <strong>horizontal scalability</strong> in mind, which allows us to scale out by adding more instances of our services.</p><p>One of the most powerful tools for building scalable microservices is <strong>Kubernetes</strong>. Kubernetes is an open-source container orchestration platform that provides a way to manage, deploy, and scale containerized applications. By using <strong>Kubernetes to manage your microservices</strong>, you can easily add or remove resources as needed, without affecting the overall state of the system.</p><p>To get started with Kubernetes, you’ll need to <strong>first containerize your microservices</strong>. This means packaging your microservices and their dependencies into containers, which can be easily deployed and managed using Kubernetes. There are many containerization technologies available, but <strong>Docker is one of the most popular</strong> and widely used.</p><p>Once your microservices are containerized, you can deploy them to Kubernetes using a deployment. A deployment is a Kubernetes object that manages a set of replicas of your microservice. By defining a deployment, you can specify how many replicas of your microservice you want to run, and <strong>Kubernetes will automatically manage the deployment and scaling of your microservice.</strong></p><p>To ensure that your microservices are <strong>highly available</strong>, you can use a Kubernetes feature called a service. A service provides a stable IP address and DNS name for your microservice, allowing other services to easily connect to it. By using a service, you can ensure that your microservice is always available, even if individual instances of the microservice go down.</p><p>To scale your microservices, you can use Kubernetes’ built-in <strong>horizontal pod autoscaler (HPA)</strong> feature. An HPA automatically scales the number of replicas of your microservice based on resource usage. For example, if CPU usage on your microservice goes above a certain threshold, Kubernetes can automatically add more replicas of your microservice to handle the increased load.</p><p>In addition to using Kubernetes to manage your microservices, there are <strong>several other best practices to keep in mind </strong>when building scalable microservices:</p><ol><li><strong><em>Use a stateless architecture</em></strong>: Stateless microservices do not store any data locally, instead relying on a shared data store or database. This makes it easier to add or remove resources as needed.</li><li><strong><em>Use asynchronous communication:</em></strong> Asynchronous communication can help improve performance and scalability by decoupling microservices and allowing them to operate independently.</li></ol><p>By following these best practices and using Kubernetes to manage your microservices, you can build a highly available and scalable microservice system that can handle even the most demanding workloads. Furthermore, it’s important to keep in mind the <a href="https://medium.com/@kagann/navigating-the-high-seas-of-microservice-system-design-a-cap-theorem-adventure-for-beginners-3b0bf6a1873e">principles of the CAP theorem when designing your microservices</a>, as discussed in our previous article. So, start exploring Kubernetes and take your microservices to the next level!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dcba8891774" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the High Seas of Microservice System Design: A CAP Theorem Adventure for Beginners]]></title>
            <link>https://medium.com/@kagann/navigating-the-high-seas-of-microservice-system-design-a-cap-theorem-adventure-for-beginners-3b0bf6a1873e?source=rss-985e467612a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b0bf6a1873e</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[cap-theorem]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[Kaan Küçük]]></dc:creator>
            <pubDate>Tue, 28 Feb 2023 08:13:00 GMT</pubDate>
            <atom:updated>2023-02-28T08:13:00.285Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s talk about the CAP theorem and how it relates to building a reliable microservice system design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_TZhJ2vlctAlGxYHHDStA.png" /></figure><p>Imagine you’re a pirate captain, sailing the high seas in search of treasure. Your ship is your microservice system, and each crew member represents a different microservice. Your goal is to build a system that can weather any storm and come out victorious.</p><p>The CAP theorem is like your trusty compass, guiding you on your journey. It has three points: Consistency, Availability, and Partition tolerance. Let’s break it down and see how it can help you build a better microservice system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NV6urGx3QU93VfHT43Bi-w.png" /></figure><p>Consistency means that all your crew members see the same treasure map at the same time. If one crew member updates the map, all other crew members should see that change immediately. This is like a microservice that handles user data. You want all your crew members to have the same information so they can work together effectively.</p><p>Availability means that your ship stays afloat even if some of your crew members fall overboard. If one part of your ship goes down, the rest of your crew members should still be able to work together to find the treasure. This is like a microservice that handles product recommendations. If one part of your system goes down, you want the rest of your system to keep functioning and providing recommendations to your users.</p><p>Partition tolerance means that your ship can handle storms and rough waters. Even if your ship gets split in two, you want each part to keep functioning and working towards the same goal. This is like a microservice that handles shipping and logistics. Even if some of your crew members are stuck in a storm, you want the rest of your system to keep functioning and delivering packages to your customers.</p><p>So, how can you use the CAP theorem to build a reliable microservice system design? Well, let’s look at some real-world examples.</p><p>For example, imagine you’re running an online store. You have a microservice that handles user authentication and a microservice that handles product recommendations. You want your authentication microservice to prioritize consistency so that all your crew members have the same information about your users. You want your recommendation microservice to prioritize availability so that even if one part of your system goes down, the rest of your crew can keep working to provide recommendations to your users.</p><p>You also have a microservice that handles shipping and logistics. This microservice needs to prioritize partition tolerance so that even if parts of your system are temporarily disconnected from each other, your crew can still work together to get your packages to your customers.</p><p>By using replication and sharding to improve consistency and availability, and by using monitoring and alerting to quickly identify and respond to any issues that arise, you can build a microservice system that can weather any storm and find the treasure you’re looking for.</p><p>In conclusion, the CAP theorem is an important concept to keep in mind when building a microservice system. By prioritizing consistency, availability, and partition tolerance, you can build a system that is reliable, flexible, and ready to take on any challenge.</p><p>Thanks for joining me on this adventure, and happy designing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b0bf6a1873e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WebPack 5 Configuration File Exclusives]]></title>
            <link>https://medium.com/@kagann/webpack-5-configuration-file-exclusives-6636a9e8427?source=rss-985e467612a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6636a9e8427</guid>
            <category><![CDATA[webpack-5]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[webpack]]></category>
            <dc:creator><![CDATA[Kaan Küçük]]></dc:creator>
            <pubDate>Sun, 18 Oct 2020 12:33:46 GMT</pubDate>
            <atom:updated>2020-10-18T12:33:46.367Z</atom:updated>
            <content:encoded><![CDATA[<p>If you provide —-mode flag to <strong>webpack</strong> from package.json, it automatically checks for the provided value on the files extension --mode development</p><pre>&#39;webpack.config&#39;,<br>&#39;webpack.config.dev&#39;,<br>&#39;webpack.config.development&#39;,<br>&#39;webpack.config.prod&#39;,<br>&#39;webpack.config.production&#39;,<br>&#39;.webpack/webpack.config&#39;,<br>&#39;.webpack/webpack.config.none&#39;,<br>&#39;.webpack/webpack.config.dev&#39;,<br>&#39;.webpack/webpack.config.development&#39;,<br>&#39;.webpack/webpack.config.prod&#39;,<br>&#39;.webpack/webpack.config.production&#39;,<br>&#39;.webpack/webpackfile&#39;,</pre><p>So the processed file is &#39;webpack.config.development&#39;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6636a9e8427" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Service Error Handling With Redux-Saga]]></title>
            <link>https://medium.com/swlh/service-error-handling-with-redux-saga-b173f347251d?source=rss-985e467612a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/b173f347251d</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[redux-saga]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[services]]></category>
            <dc:creator><![CDATA[Kaan Küçük]]></dc:creator>
            <pubDate>Fri, 25 Sep 2020 22:41:53 GMT</pubDate>
            <atom:updated>2020-10-11T05:39:42.270Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-72Ya-cOaU9lj_rC7Q-cOA.jpeg" /></figure><p>We have been talking about <strong>Service Error Handling with </strong><a href="https://redux-saga.js.org/"><strong>Redux-Saga</strong></a><strong> </strong>which is a cool way yet not only for error handling but the application itself with side effects.</p><p><a href="https://www.npmjs.com/package/redux-saga-service-wrapper">redux-saga-service-wrapper</a></p><p>Redux-Saga is a library that makes it very easy to control the application and easily adapts to the <strong>application architecture</strong>.</p><p>If you don’t know what <strong>Redux-Saga yet! Keep reading… </strong><em>Redux-saga is a </em><strong><em>redux middleware</em></strong><em> and allows you to take actions by listening to </em><a href="https://redux.js.org/basics/actions"><strong><em>redux actions</em></strong></a>. We can run, stop and cancel it by an action <strong>dispatch</strong>.</p><p>Yes by only dispatching an action will make you control your application outside of your components! And you will have the chance to manipulate/transform your data in SAGAS!! Very concise.</p><blockquote>Regarding cancellation, I desire to share that it attracts our attention more besides starting and stopping actions that can be cancelled.</blockquote><p>With the help of Redux-Saga and <strong>try{}catch{}</strong>block, We will read the <a href="https://restfulapi.net/http-status-codes/">status codes of the services</a> “<strong>200, 300, 400, 500</strong>” instead of <strong>exceptions thrown by functions</strong>, and briefly talk about <strong>how our applications take advantage of this call management</strong>.</p><pre>try {</pre><pre>} catch {</pre><pre>}</pre><p>This is an approach that allows you to manage your services with <strong>only one Saga</strong> and take action accordingly, the rest is under your control! Perform anything you desire. Now! We will proceed with handling error responses returned from services.</p><p>The example may or may not meet your expectations, so bits of advice are welcome :)</p><h4>Let’s Go:</h4><p>For a user who logs into your application, you can listen to the login service and dispatch an action you want when this service resolves (async).</p><h4>So what would you do when the service resolves?</h4><ul><li>You can allow the user to login to your application and redirect her to another path.</li><li>You can show users an informative modal/flag/notification about the ERROR returned from the service … “* <em>Your password is Wrong. Etc</em> *”</li><li>You can manage the <strong>side effects</strong> “* <em>accessing local storage, calling a different API. Etc</em>. *”</li></ul><p>Undoubtedly, it is difficult to establish such a comfortable reactive structure without using Redux-Saga. There are many ways to manage Service <strong>Error Handling</strong> without Redux-Saga. However, these methods quickly become <strong>complex </strong>and lose their scalability.</p><p>File structures and global objects, unfortunately, those approaches lose control as the application grows. There are also situations where you may have to disrupt a singleton structure.</p><p>Since the end of 2017 and starting in 2018, we have been generating all our applications with this architecture. Calling services and<strong> managing service status codes</strong> with a single Redux-Saga generator is now enrolling from the first row at each projects planning stage.</p><p>Generally, we use <a href="https://github.com/axios/axios#features"><strong>Axios </strong></a>to call services. The reason we chose <strong>Axios </strong>over browsers <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API"><strong>Fetch API</strong></a> is that it parses the response and can <strong>cancel the service on the fly</strong>. As far as I know, these two features can now be made with the <strong>Feth API</strong>.</p><p>When we evaluate the above conditions, I think that handling service status codes with Redux-Saga have a very important value both in terms of architecture and<strong> continuity of the project</strong>. You will manage your services without leaving React and you will be using a decoupled architecture.</p><p>The most important reason for using Redux-Saga is that it can be easily added, modified, scaled (managed) and even extracted in an already growing project!</p><h4>One Saga For All Services</h4><p>Even though the statement of a “<em>single Saga that will rule all services </em>” seems a bit pretentious and cool at first glance, but it should be given its due. It works very well.</p><p>We will be able to manage the error codes. By calling methods such as <strong>GET</strong>, <strong>POST</strong>, <strong>DELETE</strong>, <strong>UPDATE </strong>from the library (<strong>Axios</strong>) you used to call services in Redux-Saga</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/694/1*Ei-sQ_AOpFoBPkTWnWhDtA.png" /></figure><p>The <strong>call()</strong> method we use in <strong>callWrapperSaga()</strong> should return a <strong>yield</strong> using the <strong>fn</strong> and <strong>…args</strong>parameters that we have given to <strong>callWrapperSaga()</strong> so In the generator where <strong>callWrapperSaga() </strong>is called, we will be able to read the data returned from the services.</p><figure><img alt="Service and Error Handling with Redux-Saga call()" src="https://cdn-images-1.medium.com/max/1024/1*plu-LBJPw6c1uVgL0cvePg.png" /><figcaption>Service and Error Handling with Redux=Saga</figcaption></figure><p>So, with <strong>callWrapperSaga()</strong> we now have the ability to manage all service calls over this generator function.</p><ul><li><strong>fn </strong>is the service caller function</li><li><strong>...args </strong>are the parameters you want to send with the service call. As you know <a href="https://redux-saga.js.org/docs/api/"><strong>call()</strong></a><strong> </strong>method <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax">spread</a>s parameters to the <strong>fn</strong></li></ul><h4>Service Error Handling with Redux-Saga</h4><p>We called it a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator"><strong>JavaScript Generator</strong></a> that rules all services. It takes the service instance and the values we want to send in the body of this service function as parameters</p><p>Below, you can find <strong>GET </strong>and <strong>POST </strong>generators demonstrating service calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CGXw8Ha895cGxmlYnzmDEA.png" /></figure><p>So let&#39;s handle errors inside <strong>callWrapperSaga() </strong>it is the easiest thing :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0c_yzWi9WWPKVq4Z5dMxYA.png" /></figure><p>inside <strong>catch{} </strong>block you can access any exception thrown from services. So in the example, I demonstrate it as a forbidden route, so you can add your conditions and act accordingly.</p><p>We covered Service Call Management and Service Error Handling with Redux-Saga.</p><p>With the help of <strong>callWrapperSaga() </strong>we had our service calls centralized.</p><p>Hope you find this helpful.</p><p>Thank you!</p><p>Follow me on Twitter!<br><a href="http://www.twitter.com/kaankucukx">www.twitter.com/kaankucukx</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b173f347251d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/service-error-handling-with-redux-saga-b173f347251d">Service Error Handling With Redux-Saga</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mobile/PWA CSS Properties]]></title>
            <link>https://medium.com/@kagann/mobile-pwa-css-properties-5952de6e4529?source=rss-985e467612a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5952de6e4529</guid>
            <category><![CDATA[css3]]></category>
            <category><![CDATA[mobile-browser]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[pwa]]></category>
            <category><![CDATA[best-practices]]></category>
            <dc:creator><![CDATA[Kaan Küçük]]></dc:creator>
            <pubDate>Sun, 30 Sep 2018 03:41:06 GMT</pubDate>
            <atom:updated>2020-09-13T14:08:34.940Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>CSS Properties for Mobile browsers</strong> like (Safari, Chrome, Opera vs) and PWA architecture to make user experience feels like native application level.</p><p><strong>CSS for Mobile and PWA</strong> is a must-have topic for a developer since Mobile usage is rising day by day and clients asking for more quality on it.</p><p>I am making a list here for Mandatory CSS Properties for Mobile Browser to make them high quality.</p><p><strong>CSS Properties</strong> will be updated often, so please keep in touch.</p><ul><li><em>-webkit-tap-highlight-color: rgba(0, 0, 0, 0);</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/274/1*Noe2CJk24iYZ1TRn7p2Ifg.png" /></figure><p>On <strong>mobile browsers</strong> when the user <em>taps on the screen</em>, any clickable element will flash like follows. To prevent colour highlighting you can set its colour as <strong>transparent</strong>. You can set this on root element &lt;html&gt;</p><ul><li><em>height: 100%</em></li></ul><p>height property on <strong>&lt;html&gt;</strong> for mobile is mandatory. Use <strong>“</strong>%<strong>”</strong> instead of “<strong>vh</strong>”. <strong>VH stands for view height </strong>and makes your <em>element liquid responsive</em>. If you <strong>scroll </strong>down and up you can see a <em>janky/crazy</em> height scales. Because Mobile browsers don’t have a <strong>standalone</strong> view yet and will scale according to your window height.</p><ul><li><em>overflow-x: hidden</em></li><li><em>-webkit-overflow-scrolling: auto</em></li><li><em>-webkit-overscroll-behavior: contain</em></li><li>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no&quot; /&gt;</li></ul><p>You should add this code snippet to the <strong>&lt;head&gt;&lt;/head&gt;</strong> of your index.html. To disable zoom event on mobile views, especially on input focus.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5952de6e4529" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>