<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tuçe Sarı Tekkalmaz</title>
    <description>The latest articles on DEV Community by Tuçe Sarı Tekkalmaz (@tuce_saritekkalmaz).</description>
    <link>https://dev.to/tuce_saritekkalmaz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1585447%2F3ff264b1-7262-4a79-8afb-7a3ca09ec899.jpg</url>
      <title>DEV Community: Tuçe Sarı Tekkalmaz</title>
      <link>https://dev.to/tuce_saritekkalmaz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tuce_saritekkalmaz"/>
    <language>en</language>
    <item>
      <title>Redis Replica or Cluster. Sentinels is not even a part of the differentiation</title>
      <dc:creator>Tuçe Sarı Tekkalmaz</dc:creator>
      <pubDate>Sun, 08 Jun 2025 13:11:18 +0000</pubDate>
      <link>https://dev.to/tuce_saritekkalmaz/redis-replica-or-cluster-sentinels-is-not-even-a-part-of-the-differentiation-3ki1</link>
      <guid>https://dev.to/tuce_saritekkalmaz/redis-replica-or-cluster-sentinels-is-not-even-a-part-of-the-differentiation-3ki1</guid>
      <description>&lt;p&gt;Last month I came across someone explaining Redis Sentinel as &lt;em&gt;the&lt;/em&gt; magic behind Redis replication. According to them, Sentinel is what makes Redis work “under the hood” in all cases.&lt;br&gt;
No. Just—no.&lt;/p&gt;

&lt;p&gt;There’s a fundamental misconception here. Redis offers two distinct setup modes: &lt;strong&gt;Replica mode&lt;/strong&gt; and &lt;strong&gt;Cluster mode&lt;/strong&gt;. And Sentinels? They &lt;em&gt;might&lt;/em&gt; show up in one of them—but they’re not part of the core differentiation. Let’s break this down properly.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Redis Replica Mode
&lt;/h2&gt;

&lt;p&gt;This is the traditional master-replica setup. It’s simple and suits many common caching and read-scaling use cases.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One primary/master&lt;/strong&gt; handles all writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One or more replicas/slaves&lt;/strong&gt; sync data from the master.&lt;/li&gt;
&lt;li&gt;Replicas can serve read traffic to reduce the load on the master.&lt;/li&gt;
&lt;li&gt;Data is replicated asynchronously.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the master fails, &lt;strong&gt;Redis Sentinel&lt;/strong&gt; can help. Sentinel is a separate service that monitors Redis instances, elects a new master, and helps your application reconnect to the new topology. But again—Sentinel is &lt;em&gt;optional&lt;/em&gt;. You could use your own failover mechanism.&lt;/p&gt;

&lt;p&gt;So when to use Replica Mode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you want simplicity.&lt;/li&gt;
&lt;li&gt;If you mostly care about caching, not partitioned data.&lt;/li&gt;
&lt;li&gt;If you need basic high availability with optional Sentinel.&lt;/li&gt;
&lt;li&gt;If you can tolerate eventual consistency in failover.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Redis Cluster Mode
&lt;/h2&gt;

&lt;p&gt;Redis Cluster is different. It adds &lt;strong&gt;automatic data sharding&lt;/strong&gt; and &lt;strong&gt;built-in failover&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data is split across &lt;strong&gt;multiple masters&lt;/strong&gt; using hash slots (16,384 slots in total).&lt;/li&gt;
&lt;li&gt;Each master can have one or more replicas.&lt;/li&gt;
&lt;li&gt;If one master fails, a replica is promoted automatically.&lt;/li&gt;
&lt;li&gt;Clients are cluster-aware and know where to send requests based on key hash slots.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No Sentinel is used here. Redis Cluster has its own failure detection and promotion mechanism built in. Sentinels are completely irrelevant in this context.&lt;/p&gt;

&lt;p&gt;So when to use Cluster Mode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you need &lt;strong&gt;horizontal scaling&lt;/strong&gt; across multiple nodes.&lt;/li&gt;
&lt;li&gt;If you want &lt;strong&gt;high availability without external tools&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If your dataset no longer fits on a single machine.&lt;/li&gt;
&lt;li&gt;If you’re OK with the complexity of partitioned keys and client-side awareness.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What’s Sentinel Then?
&lt;/h2&gt;

&lt;p&gt;Redis Sentinel is a monitoring and failover tool &lt;em&gt;only for Replica mode&lt;/em&gt;. It:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Watches Redis masters and replicas.&lt;/li&gt;
&lt;li&gt;Detects failures.&lt;/li&gt;
&lt;li&gt;Elects a new master when needed.&lt;/li&gt;
&lt;li&gt;Notifies clients of topology changes.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Redis is becoming more powerful with every release. It offers a wide range of features, and I’ll be sharing code examples in upcoming posts.&lt;/p&gt;

&lt;p&gt;One common source of confusion is the difference between hash slots and keys when using Cluster mode. This concept plays a critical role in data distribution and routing. I’ll dive deeper into hash slot behavior and its relationship with keys in a dedicated follow-up post. &lt;/p&gt;




</description>
    </item>
    <item>
      <title>Are You Underestimating Your API Gateway?</title>
      <dc:creator>Tuçe Sarı Tekkalmaz</dc:creator>
      <pubDate>Sun, 25 May 2025 19:23:51 +0000</pubDate>
      <link>https://dev.to/tuce_saritekkalmaz/are-you-underestimating-your-api-gateway-4hk7</link>
      <guid>https://dev.to/tuce_saritekkalmaz/are-you-underestimating-your-api-gateway-4hk7</guid>
      <description>&lt;p&gt;&lt;em&gt;Make the most of Spring Cloud Gateway (Spring Boot 3.3, Spring Cloud 2023.x)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;br&gt;
Spring Cloud Gateway (2023.x) is not just a router. It’s a powerful tool that can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplify your architecture&lt;/li&gt;
&lt;li&gt;Boost performance with non-blocking I/O&lt;/li&gt;
&lt;li&gt;Enforce security and consistency&lt;/li&gt;
&lt;li&gt;Reduce code duplication across microservices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're using Spring Boot 3.3 and Spring Cloud 2023.x, don’t underuse this tool. Make it work for you—securely, efficiently, and smartly.&lt;/p&gt;



&lt;p&gt;In a microservices setup, the API Gateway is the first stop for all client requests. It sits in front of your services and plays the role of traffic cop—routing, filtering, and sometimes even transforming requests. But are we giving it enough responsibility?&lt;/p&gt;

&lt;p&gt;With Spring Cloud Gateway (SCG), especially the recent versions like 2023.0.x (paired with Spring Boot 3.3.x), you can do so much more than basic routing. It’s time to move beyond minimal usage and unlock its full potential.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why Spring Cloud Gateway Instead of Zuul?
&lt;/h2&gt;

&lt;p&gt;Older projects may still use Netflix Zuul, but that library was built for synchronous, blocking applications. Spring Cloud Gateway, on the other hand, is built on Netty, a non-blocking, reactive networking library. This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster request handling under load&lt;/li&gt;
&lt;li&gt;Lower resource usage&lt;/li&gt;
&lt;li&gt;Support for modern async microservices&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re already using Spring Boot 3+ and Spring Cloud 2023.x, you’re in a great spot to fully embrace these benefits.&lt;/p&gt;


&lt;h2&gt;
  
  
  But Here's the Catch...
&lt;/h2&gt;

&lt;p&gt;Some teams try to "keep the gateway lightweight." That sounds good on paper, but it often means missing out on key features that belong at the gateway level—not inside each microservice.&lt;/p&gt;

&lt;p&gt;By pushing too much logic downstream, you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Duplicate code (e.g., for auth, rate limiting)&lt;/li&gt;
&lt;li&gt;Lose consistency in security policies&lt;/li&gt;
&lt;li&gt;Increase maintenance effort&lt;/li&gt;
&lt;li&gt;Slow down requests by repeating work&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  What Should the Gateway Handle?
&lt;/h2&gt;

&lt;p&gt;Here are four powerful use cases where Spring Cloud Gateway shines:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Centralized Authentication &amp;amp; Authorization&lt;/strong&gt;&lt;br&gt;
Don’t let every microservice handle tokens and roles. Let the gateway validate access once, pass the result downstream, and keep your services focused on business logic.&lt;/p&gt;

&lt;p&gt;Use spring-cloud-starter-gateway and plug in Spring Security filters to handle JWT or OAuth2 at the edge.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Rate Limiting &amp;amp; Caching&lt;/strong&gt;&lt;br&gt;
Protect your services from abuse by enforcing limits at the entry point. SCG supports Redis-backed rate limiting, which scales well and is easy to set up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;spring:
  cloud:
    gateway:
      routes:
        - id: my-route
          uri: http://my-service
          predicates:
            - Path=/api/**
          filters:
            - name: RequestRateLimiter
              args:
                redis-rate-limiter.replenishRate: 10
                redis-rate-limiter.burstCapacity: 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Protocol Translation&lt;/strong&gt;&lt;br&gt;
Want to expose REST endpoints to clients but use gRPC or WebSockets internally? Let the gateway handle protocol translation. That way, your services don’t need to care about how the client talks to them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Aggregation &amp;amp; Filtering&lt;/strong&gt;&lt;br&gt;
You can use Spring Cloud Gateway to gather data from multiple services and build composite responses. This is useful for mobile or frontend apps that prefer fewer round trips.&lt;/p&gt;

&lt;p&gt;Plus, with filters, you can log, validate, or transform requests once at the edge, not in every service.&lt;/p&gt;

</description>
      <category>springcloudgateway</category>
      <category>apigateway</category>
      <category>microservices</category>
      <category>java</category>
    </item>
  </channel>
</rss>
