<?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 Anılcan Yurtbay on Medium]]></title>
        <description><![CDATA[Stories by Anılcan Yurtbay on Medium]]></description>
        <link>https://medium.com/@a.yurtbay?source=rss-e3c9a9596502------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8NR2YqiZFIOTLag49OnXsQ.png</url>
            <title>Stories by Anılcan Yurtbay on Medium</title>
            <link>https://medium.com/@a.yurtbay?source=rss-e3c9a9596502------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:08:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a.yurtbay/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[Securing User Management in SaaS and Call Center Platforms]]></title>
            <link>https://medium.com/call-center-studio/securing-user-management-in-saas-and-call-center-platforms-adb2abc9dac4?source=rss-e3c9a9596502------2</link>
            <guid isPermaLink="false">https://medium.com/p/adb2abc9dac4</guid>
            <category><![CDATA[saas]]></category>
            <category><![CDATA[maker-checker-concept]]></category>
            <category><![CDATA[call-center-services]]></category>
            <dc:creator><![CDATA[Anılcan Yurtbay]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 06:39:29 GMT</pubDate>
            <atom:updated>2025-12-31T07:30:29.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OpNWbTBiWKMZ1rp_t4-3HA.png" /></figure><h4>Implementing a Maker–Checker Approval Workflow for Critical User Operations</h4><h3>Abstract</h3><p>User management is a critical security domain in modern SaaS and call center platforms. Misconfigured permissions, unauthorized activations, or uncontrolled deletions can introduce serious security, compliance, and operational risks. This paper presents a production-grade Maker–Checker (Approval Request) system designed to secure critical user lifecycle operations through a two-step approval workflow. The proposed architecture enforces separation of duties, prevents unsafe state transitions, and provides full auditability while remaining compatible with real-time operational systems such as call center software.</p><h3>1. Introduction</h3><p>In SaaS and call center platforms, user-related operations directly affect security posture, compliance boundaries, and system stability. Activating a user may instantly grant access to sensitive customer data, dashboards, or live operational systems. Deactivating or deleting a user can disrupt active workflows, invalidate permissions, or impact historical reporting.</p><p>Unverified execution of critical user operations can result in:</p><ul><li>Privilege escalation attacks</li><li>Data leakage and unauthorized access</li><li>Regulatory violations (GDPR, SOX, HIPAA)</li><li>Operational disruptions affecting customer experience</li></ul><p>The Maker–Checker pattern, widely adopted in financial and mission-critical systems, introduces a two-step verification mechanism. By separating the role that <strong>requests</strong> an operation (Maker) from the role that <strong>approves and executes</strong> it (Checker), the system reduces risks associated with human error, insider threats, and automation misuse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-pkqAagi9aZG3b3odXhkIg.png" /></figure><h3>2. System Design and Architecture</h3><h3>2.1 Architectural Overview</h3><p>The Maker–Checker system is implemented as an <strong>approval-first execution layer</strong> embedded directly into the user management domain.</p><p>Key architectural principles:</p><ul><li><strong>Request-Based State Management</strong><br>No critical operation mutates user state immediately. Each action generates an immutable ApprovalRequest.</li><li><strong>Asynchronous Approval Workflow</strong><br>Makers submit requests; Checkers review and approve or reject them before execution.</li><li><strong>Configurable Enforcement</strong><br>Approval enforcement can be toggled per organization or tenant via a configuration flag (e.g. require_approval_for_user_operations).</li></ul><p>This design allows strict security enforcement without blocking operational flexibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tl8axeax7rqGFkjoiaMVtg.png" /></figure><h3>2.2 Core Components</h3><h4>Model</h4><ul><li><strong>TargetResource</strong>: The type of resource the action applies to (e.g., “User”)</li><li><strong>ResourceID</strong>: Unique identifier of the resource</li><li><strong>ActionType</strong>: Type of action (activate, deactivate, delete, permission_update)</li><li><strong>ChangeDetails</strong>: JSON snapshot of the requested changes</li><li><strong>PreviousState</strong>: Snapshot of the resource before the change</li><li><strong>CurrentStatus</strong>: Request status (pending, approved, rejected)</li><li><strong>Initiator</strong>: User who initiated the action</li><li><strong>SourceIP</strong>: Client IP address of the request</li><li><strong>SourceAgent</strong>: Client User-Agent information</li></ul><h4>Maker and Checker Roles</h4><ul><li><strong>Maker</strong><br>Initiates a request but cannot execute it.</li><li><strong>Checker</strong><br>Reviews pending requests and performs approval or rejection.<br>Checkers are selected via a default permission profile to ensure centralized control.</li></ul><p>A strict rule is enforced: <strong>a user cannot approve their own request</strong>.</p><h4>Notification and Audit Systems</h4><ul><li><strong>Notification Layer</strong><br>All active Checkers receive notifications (email or in-app) containing request metadata and timestamps.</li><li><strong>Audit Logging</strong><br>Every stage is logged to:</li><li>SIEM systems</li><li>Administrative activity feeds</li></ul><p>No approval or execution occurs without generating a corresponding audit event.</p><h3>3. Supported User Operations</h3><p>The approval workflow protects the following critical operations:</p><ul><li><strong>activate</strong><br>Grants system access and permissions.</li><li><strong>deactivate</strong><br>Revokes access and integrates with dependent services.</li><li><strong>delete</strong><br>Permanently removes a user (soft delete recommended); may require double approval.</li><li><strong>permission_change</strong><br>Modifies permission profiles and invalidates cached permissions immediately.</li></ul><p>Each operation is domain-aware and validated before execution.</p><h3>4. Technical Implementation Details</h3><h3>4.1 Preventing Concurrent Requests</h3><p>To avoid inconsistent state transitions, the system enforces a <strong>single pending request per user</strong>.</p><pre>def has_pending_request(user_id):<br>    return ApprovalRequest.exists(<br>        resource_type=&quot;User&quot;,<br>        resource_id=user_id,<br>        status=&quot;pending&quot;<br>    )</pre><p>The user entity is flagged with approval_pending = true until resolution.</p><h3>4.2 Creating an Approval Request</h3><pre>def request_user_operation(user_id, operation, changes, actor):<br>    if has_pending_request(user_id):<br>        raise ConflictError(&quot;Pending approval exists&quot;)<br>    approval = ApprovalRequest(<br>        resource_type=&quot;User&quot;,<br>        resource_id=user_id,<br>        operation=operation,<br>        requested_changes=changes,<br>        old_values=get_user_snapshot(user_id),<br>        status=&quot;pending&quot;,<br>        requested_by=actor.id,<br>        source_ip=actor.ip,<br>        source_user_agent=actor.user_agent<br>    )<br>    approval.save()<br>    mark_user_pending(user_id)<br>    notify_checkers(approval)</pre><p>No user state is mutated at this stage.</p><h3>4.3 Approval Execution with Distributed Locking</h3><p>Approval execution is serialized using Redis-based distributed locks.</p><pre>def approve_request(request_id, checker):<br>    with distributed_lock(f&quot;approval:{request_id}&quot;):<br>        request = ApprovalRequest.get(request_id)<br><br>        if request.status != &quot;pending&quot;:<br>            raise InvalidStateError()<br>        apply_operation(request)<br>        request.status = &quot;approved&quot;<br>        request.approved_by = checker.id<br>        request.save()<br>        clear_user_pending(request.resource_id)<br>        write_audit_event(request)</pre><p>This guarantees atomicity under concurrent administrative load.</p><h3>5. Domain-Specific Safeguards</h3><h3>5.1 Live Operation Protection (Call Center Example)</h3><p>Before deactivation, the system verifies that the agent is not handling an active call.</p><pre>def is_user_on_active_call(user_id):<br>    return CallSession.exists(<br>        agent_id=user_id,<br>        status=&quot;active&quot;<br>    )</pre><pre>def apply_deactivation(request):<br>    if is_user_on_active_call(request.resource_id):<br>        raise ConflictError(&quot;User is on an active call&quot;)<br>    remove_from_queues(request.resource_id)<br>    deactivate_user(request.resource_id)</pre><p>This prevents service disruption.</p><h3>5.2 Permission Change Consistency</h3><p>Permission updates invalidate all cached permission data immediately.</p><pre>def apply_permission_change(request):<br>    update_permissions(<br>        request.resource_id,<br>        request.requested_changes<br>    )<br>    invalidate_permission_cache(request.resource_id)</pre><h3>6. Security and Compliance Considerations</h3><p>The system enforces best practices through:</p><ul><li>IP and User-Agent tracking</li><li>Full before/after state snapshots</li><li>Immutable audit trails</li><li>Tenant isolation in multi-tenant deployments</li><li>Centralized Checker selection</li></ul><p>These mechanisms collectively satisfy regulatory requirements by answering:</p><p><strong>Who did what, when, where, and why?</strong></p><h3>7. Extensibility and Operational Fit</h3><p>Although implemented for user management, the same approval framework can secure:</p><ul><li>API key lifecycle operations</li><li>Configuration changes</li><li>Billing or subscription updates</li></ul><p>The architecture remains lightweight, asynchronous, and compatible with high-traffic SaaS and real-time platforms.</p><h3>8. Trade-offs and Design Considerations</h3><p>While the Maker–Checker pattern significantly improves security and auditability, it also introduces deliberate trade-offs that must be considered at design time. Approval-based workflows inherently add <strong>latency</strong> to critical operations, which may be undesirable in low-risk or highly automated environments. They also introduce <strong>operational overhead</strong>, requiring additional logic for request tracking, notifications, and state management. Furthermore, system availability becomes partially dependent on <strong>Checker responsiveness</strong>, which can delay execution during off-hours or incidents. For these reasons, Maker–Checker workflows are best applied selectively to high-impact operations where security, compliance, and traceability outweigh the cost of delayed execution.</p><h3>9. Conclusion</h3><p>Critical user operations represent one of the highest-risk surfaces in SaaS and call center platforms. By introducing a Maker–Checker approval workflow at the architectural level, organizations can enforce separation of duties, prevent unsafe state transitions, and maintain full auditability without sacrificing operational efficiency.</p><p>This work demonstrates that approval-driven user management is not merely a compliance requirement, but a foundational security pattern for modern production systems.</p><h3>References</h3><ul><li>Four-Eyes Principle (Maker–Checker Model)<br><a href="https://en.wikipedia.org/wiki/Four-eyes_principle">https://en.wikipedia.org/wiki/Four-eyes_principle</a></li><li>NIST SP 800–53 Rev. 5 — Security and Privacy Controls<br><a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf">https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf</a></li><li>OWASP Logging Cheat Sheet<br><a href="https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html</a></li><li>Redis Distributed Locks<br><a href="https://redis.io/docs/latest/develop/use/patterns/distributed-locks/">https://redis.io/docs/latest/develop/use/patterns/distributed-locks/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adb2abc9dac4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/securing-user-management-in-saas-and-call-center-platforms-adb2abc9dac4">Securing User Management in SaaS and Call Center Platforms</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Designing a Scalable Architecture for Telephony-Class Text-to-Speech Systems]]></title>
            <link>https://medium.com/call-center-studio/designing-a-scalable-architecture-for-telephony-class-text-to-speech-systems-789595b579c6?source=rss-e3c9a9596502------2</link>
            <guid isPermaLink="false">https://medium.com/p/789595b579c6</guid>
            <category><![CDATA[text-to-speech]]></category>
            <category><![CDATA[call-center]]></category>
            <dc:creator><![CDATA[Anılcan Yurtbay]]></dc:creator>
            <pubDate>Fri, 26 Dec 2025 15:29:00 GMT</pubDate>
            <atom:updated>2025-12-29T07:10:32.930Z</atom:updated>
            <content:encoded><![CDATA[<h4>Dynamic Voice Generation, Caching, and Cost Optimization</h4><p>I’m <strong>Anılcan Yurtbay</strong>, a <strong>Backend Developer at Call Center Studio</strong>. In this article, I’ll explain <strong>how a vendor-neutral, telephony-optimized Text-to-Speech system can be implemented</strong>, featuring <strong>Redis caching</strong> and <strong>BigQuery analytics</strong>. The discussion focuses on the technical challenges typically encountered — such as optimizing audio for telephony networks, selecting voices for multiple languages, and implementing cost-efficient caching — and outlines solutions that enable a <strong>scalable, real-time voice system</strong> suitable for call center and IVR environments.</p><h3>Abstract</h3><p>In modern call center and IVR (Interactive Voice Response) platforms, delivering <strong>dynamic content to customers in real time through synthesized speech</strong> has become essential. Information such as queue position, estimated waiting time, personalized announcements, and multilingual IVR menus cannot be efficiently handled using static audio files. As a result, Text-to-Speech (TTS) technologies are a core component of contemporary telephony systems.</p><p>This paper presents the design and implementation considerations of a <strong>telephony-optimized Text-to-Speech architecture</strong>, featuring a <strong>cloud-based TTS service</strong>, enhanced with <strong>Redis caching</strong> for performance and cost optimization, and <strong>BigQuery-based analytics</strong> for usage and billing insights. The architecture ensures compatibility with PSTN and VoIP networks using an <strong>8 kHz sampling rate</strong>, <strong>LINEAR16 audio encoding</strong>, and <strong>telephony-class audio effects</strong>.</p><h3>1. Introduction: The Need for Dynamic TTS in Telephony Systems</h3><p>Traditional call center systems often rely on pre-recorded audio files to deliver announcements. While sufficient for static prompts, this approach fails in scenarios requiring:</p><ul><li>Dynamic queue information</li><li>Real-time operational data</li><li>Multilingual IVR flows</li><li>Personalized customer interactions</li></ul><p>For example, a message such as:</p><blockquote>“You are currently number four in the queue. Your estimated waiting time is two minutes.”</blockquote><p>requires <strong>real-time processing combined with on-demand speech synthesis</strong>.</p><p>Although general-purpose TTS systems can generate speech from text, default configurations often lead to <strong>audio distortion, sampling mismatches, or reduced intelligibility</strong> in telephony environments. Therefore, telephony-specific optimization is necessary.</p><h3>2. Methodology: Telephony-Optimized TTS Architecture</h3><h3>2.1 Architectural Overview</h3><p>The architecture consists of the following components:</p><pre>[IVR / Call Engine]<br>        |<br>        v<br>[TTS Service Layer]<br>        |<br>        +--&gt; [Redis Cache]<br>        |<br>        +--&gt; [Cloud-based TTS Engine]<br>        |<br>        v<br>[Telephony Media Engine]<br>        |<br>        v<br>[BigQuery Analytics]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5pAP5HYciRAOo-khNYvr4A.png" /></figure><p>The design minimizes latency, reduces redundant TTS requests, and provides measurable insights into usage and.</p><h3>2.2 Cloud-Based Text-to-Speech Integration</h3><p>Speech synthesis is performed through a <strong>generic cloud-based TTS service</strong>. To ensure telephony compatibility, the service can be configured with the following abstract parameters:</p><pre># Vendor-neutral TTS request<br>tts_response = tts_service.synthesize(<br>    text=tts_text,<br>    language=language_code,<br>    voice=voice_name,<br>    audio_config={<br>        &quot;encoding&quot;: &quot;LINEAR16&quot;,<br>        &quot;sample_rate_hertz&quot;: 8000,<br>        &quot;effects_profile&quot;: [&quot;telephony-class&quot;]<br>    }<br>)</pre><h4>Parameter Rationale</h4><ul><li><strong>LINEAR16 (PCM):</strong> Compatible with PSTN and VoIP, eliminates the need for additional transcoding.</li><li><strong>8 kHz Sampling Rate:</strong> Standard for telephony networks.</li><li><strong>Telephony-Class Audio Effects:</strong> Optimized for clarity and intelligibility over narrowband channels.</li><li><strong>Speaking Rate &amp; Pitch:</strong> Provides natural-sounding voice output while remaining platform-independent.</li></ul><h3>2.3 Language and Voice Selection Strategy</h3><p>Multi-language support is handled by mapping languages to suitable voice configurations:</p><pre>def tts_language_details(language):<br>    mapping = {<br>        &quot;tr&quot;: (&quot;tr-TR&quot;, &quot;tr-TR-Standard-A&quot;),<br>        &quot;en&quot;: (&quot;en-US&quot;, &quot;en-US-Standard-B&quot;),<br>        &quot;fr&quot;: (&quot;fr-FR&quot;, &quot;fr-FR-Standard-A&quot;),<br>        &quot;es&quot;: (&quot;es-ES&quot;, &quot;es-ES-Standard-A&quot;),<br>        &quot;pt&quot;: (&quot;pt-PT&quot;, &quot;pt-PT-Standard-A&quot;)<br>    }<br>    return mapping.get(language, mapping[&quot;tr&quot;])</pre><p>This allows <strong>scalable support for new languages</strong> without modifying the core architecture.</p><h3>2.4 Redis-Based Caching Using ‘tts_content_key&#39;</h3><p>Repeated synthesis of the same text can be costly. A <strong>product-agnostic caching strategy</strong> is used to mitigate this.</p><h4>Cache Key Design</h4><pre>tts_cache:{language_code}:{tts_content_key}</pre><p>The tts_content_key is derived by hashing the normalized TTS input along with relevant voice parameters:</p><pre>tts_content_key = hashlib.sha1(<br>    f&quot;{language}:{voice}:{text}&quot;.encode(&quot;utf-8&quot;)<br>).hexdigest()</pre><h4>Benefits</h4><ul><li>Independent of IVR or queue identifiers</li><li>Enables text reuse across multiple call flows</li><li>Multi-tenant and multilingual friendly</li><li>Reduces latency and service cost</li></ul><figure><img alt="TTS Cache Key Derivation Flow" src="https://cdn-images-1.medium.com/max/1024/1*yTT13b7YzcPy_dcMaCxB7w.png" /></figure><h3>2.5 IVR and Attendant Step Integration</h3><p>TTS is implemented as a discrete step in IVR flows. Each step includes:</p><ul><li>announcement: The text to be synthesized</li><li>speaking_rate: Optional speech speed control</li><li>next_step: Flow continuation logic</li></ul><p>This allows dynamic IVR menus and announcements without pre-recorded audio.</p><h3>2.6 Usage and Cost Analytics with BigQuery</h3><p>Each TTS invocation can be logged for operational insights:</p><ul><li>Duration of synthesized speech</li><li>Step type</li><li>Language and voice configuration</li><li>Call identifiers</li></ul><p>Example BigQuery-style query:</p><pre>SELECT<br>  calldate,<br>  COUNT(*) AS tts_count,<br>  SUM(text_to_speech_log.duration) AS total_duration,<br>  CEIL(SUM(text_to_speech_log.duration) / 15) / 4 AS estimated_cost<br>FROM CALL, UNNEST(text_to_speech_log) AS text_to_speech_log<br>WHERE text_to_speech_log.step_type = &#39;TTS&#39;<br>GROUP BY calldate</pre><p>This approach enables <strong>real-time monitoring and cost management</strong> in a provider-agnostic way.</p><h3>3. Findings and Implementation Results</h3><h3>3.1 Performance Metrics</h3><ul><li><strong>Cache hit latency:</strong> 2–5 ms</li><li><strong>Cache miss latency (API call):</strong> 200–500 ms</li></ul><p>Redis caching significantly improves response times for frequently used announcements.</p><h3>3.2 Cost Efficiency</h3><ul><li><strong>60–80% reduction</strong> in cloud TTS requests</li><li>Considerable savings for dynamic IVR prompts and queue announcements</li></ul><h3>3.3 Audio Quality and Telephony Compatibility</h3><ul><li>Compatible with PSTN and VoIP networks</li><li>No codec or sampling mismatches observed</li><li>Intelligibility consistently above 95% in user testing</li></ul><h3>4. Conclusion</h3><p>Telephony-class TTS systems require careful attention to <strong>audio optimization, caching, multi-language support, and analytics</strong>. Key takeaways:</p><ol><li>Optimized parameters (8 kHz, LINEAR16, telephony-class effects) are critical for telephony networks</li><li>Text-based caching reduces latency and costs</li><li>Analytics-driven monitoring ensures scalable operation</li><li>Vendor-neutral design ensures adaptability to different TTS engines</li></ol><h3>References</h3><ol><li><strong>ITU-T Recommendation G.711 — Pulse Code Modulation (PCM) of Voice Frequencies</strong><br> <a href="https://www.itu.int/rec/T-REC-G.711/en">https://www.itu.int/rec/T-REC-G.711/en</a></li><li><strong>Redis Documentation — Caching Strategies</strong><br> <a href="https://redis.io/docs/latest/">https://redis.io/docs/latest/</a></li><li><strong>Google BigQuery Documentation</strong><br> <a href="https://cloud.google.com/bigquery/docs">https://cloud.google.com/bigquery/docs</a></li><li><strong>Asterisk Telephony Framework Documentation</strong><br> <a href="https://docs.asterisk.org/">https://docs.asterisk.org/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=789595b579c6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/call-center-studio/designing-a-scalable-architecture-for-telephony-class-text-to-speech-systems-789595b579c6">Designing a Scalable Architecture for Telephony-Class Text-to-Speech Systems</a> was originally published in <a href="https://medium.com/call-center-studio">Call Center Studio</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.JS ’de Rate Limit Nasıl Oluşturulur?]]></title>
            <link>https://medium.com/@a.yurtbay/node-js-de-rate-limit-nas%C4%B1l-olu%C5%9Fturulur-bdf90ce4f61e?source=rss-e3c9a9596502------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdf90ce4f61e</guid>
            <category><![CDATA[rate-limit]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Anılcan Yurtbay]]></dc:creator>
            <pubDate>Wed, 10 Nov 2021 14:21:23 GMT</pubDate>
            <atom:updated>2021-11-10T14:25:38.092Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*2u86j8u6Lp4n4p2Q93zIdw.png" /></figure><p>Rate Limit, ağ trafiğinizi yönetir ve belirli bir süre içinde yapılan işlem sayısını sınırlar. Genel olarak API’ lerde tekrarlanan istekleri sınırlandırmak için kullanılır.</p><p>Örneğin bir API hizmetiniz var ve kötü niyetli saldırılar alıyorsunuz. Bu saldırılar sonucu bir aşırı yüklenme oluşur ve uygulamalarınız düzgün çalışmaz. Rate Limit buradaki aşırı yüklenmeyi önleme amacıyla oluşturacağımız bir güvenlik katmanıdır.</p><h3><strong>Proje Kurulumu</strong></h3><ol><li>rate-limit adında yeni bir klasör oluşturun.</li><li>Varsayılan bir package.json dosyası oluşturmak için şu kodu çalıştırın:</li></ol><pre>$ npm init -y</pre><p>3. Uygulamamız için gerekli paketleri yükleyelim:</p><pre>$ npm install express --save<br>$ npm install express-rate-limit --save</pre><p>4. Klasörümüze yeni bir app.js dosyası oluşturalım ve express başlangıç kodunu yazalım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*dWez5pWIV271Rqgby911Gw.png" /></figure><p>5. Uygulamamız çalışıyor mu test edelim, bunun için $ node app.js komutunu çalıştıralım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*0DkQIxIJWY7pFLVHoeYiFQ.png" /></figure><p>6. Uygulamamız sorunsuz çalışıyor. Şimdi rate limit ekleyebiliriz. Bunun için proje başlangıcında express-rate-limit paketini kurmuştuk. express-rate-limit bir middleware olduğu için tüm uygulamada (route ve sub-route’larda) kullanabiliriz.</p><p>Detaylı incelemek isterseniz; <a href="https://www.npmjs.com/package/express-rate-limit">https://www.npmjs.com/package/express-rate-limit</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*E_JBP7LUN5OvNtxTn7Y7WQ.jpeg" /></figure><p>Resimde kırmızı ok ile işaretli yerlere express-rate-limit için gerekli tanımları ve kod bloklarını yazdık.</p><blockquote>İlk kırmızı ok, express-rate-limit paketimizin tanımı.<br>İkinci kırmızı ok, rate limit için gerekli parametrelerimiz;</blockquote><blockquote>-windowMs : Gelen isteklerin kontrol edildiği zaman dilimi.<br>- max : windowMs de tanımlı olan zamandaki maksimum bağlantı sayısı.<br>- message : Maksimum bağlantı aşıldığı zaman gösterilecek olan mesaj.</blockquote><blockquote>Üçüncü kırmızı ok, Rate Limit middleware tanımımız.</blockquote><h3>Proje Test</h3><p>7. Eğer uygulamanız hala açık ise ctrl+c yaparak veya terminali komple kapatarak sonlandıralım. En son yaptığımız ayarlar ile tekrar uygulamamızı başlatalım. ($ node app.js)</p><p>8. Uygulamamız çalıştıktan sonra tekrardan <a href="http://localhost:4000/">http://localhost:4000/</a> adresine gidelim. Sizi yine aşağıdaki ekran karşılayacak:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*Fwm1nxESS_xA0pNRcLGW4Q.png" /></figure><p>Şimdi tarayıcı penceresine gelip seri bir şekilde F5 tuşuna basalım ve sonucu görelim:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*dZmd6pwg8lJaS4aLmkc5kQ.png" /></figure><p>Gördüğünüz gibi Rate Limit başarılı bir şekilde çalıştı.</p><p>Okuduğunuz için teşekkür ederim.</p><p>Bir sonraki yazımda Rate Limit için Cloudflare Entegrasyonu’nu anlatacağım. Beni takip etmeyi unutmayın !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdf90ce4f61e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>