<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Berkay Doğukan Urhan on Medium]]></title>
        <description><![CDATA[Stories by Berkay Doğukan Urhan on Medium]]></description>
        <link>https://medium.com/@dogukanuhn?source=rss-512226dacaeb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*j-yrSV5YW4zcBYNyR0VsCQ.jpeg</url>
            <title>Stories by Berkay Doğukan Urhan on Medium</title>
            <link>https://medium.com/@dogukanuhn?source=rss-512226dacaeb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:32:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dogukanuhn/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[Stream Proccesing: Producer ve Consumer Kavramları]]></title>
            <link>https://dogukanuhn.medium.com/stream-proccesing-producer-ve-consumer-kavramlar%C4%B1-cb7e99a1c8fd?source=rss-512226dacaeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb7e99a1c8fd</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Berkay Doğukan Urhan]]></dc:creator>
            <pubDate>Sat, 26 Oct 2024 14:03:19 GMT</pubDate>
            <atom:updated>2024-10-26T14:03:19.012Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data-Intensive Stream Proccesing</h3><h4>Yüksek performanslı sistemlerde akış işleme ve mesajlaşma mimarileri: Producer ve Consumer kavramlarıyla event yönetimi.</h4><p><a href="https://amzn.eu/d/bNasLW6">Designing Data Intensive Applications</a> kitabında karşılaştığım ve günümüzde yük altında çalışan sistemlerde aktif olarak kullanılan bir yapıdan bahsetmek istiyorum.</p><p><strong>Stream</strong> dediğimiz zaman, aklımıza sistemimiz içerisinde sürekli akan ve zaman içinde artıp azalan bir veri akışı geliyor. Gelen bu verileri sürekli olarak işlediğimiz süreçlere <strong>Stream Processing</strong> adını veriyoruz.</p><p>Stream Processing içerisinde aktardığımız verilere <strong>event</strong> adını veriyoruz. Ancak bu event kavramı, yazılım hayatımızda kullandığımızdan çok farklı bir kavram değil. Event kavramı, bir T anında yaşanmış olaya dair bilgilerin bulunduğu bir bilgi kümesinden oluşur. Bu bilgiler, o anki olaya dair bilgilerin yanı sıra genellikle ne zaman gerçekleştiğine dair zaman bilgisini de barındırır.</p><p>Örneğin, kullanıcının sistem üzerinde yapmış olduğu bir satın alma işlemi veya CPU’nun sıcaklığının anlık olarak aktarılması olayını bir event olarak adlandırabiliriz.</p><h4>Producer ve Consumer Kavramı</h4><p>Streaming terminolojisi içerisinde oluşturulan event’lerin, <strong>Producer</strong> (publisher veya sender) olarak adlandırdığımız bir servis tarafından üretildiğini görüyoruz.</p><p>Bu üretilen mesajları dinleyen birden fazla servis bulunuyor. Bu servislere de <strong>Consumer</strong> adını veriyoruz.</p><p>Üretilen event’ler, ilişkilerine göre gruplandığı ve aynı stream üzerinden aktığı için, dinleyen consumer’ların her seferinde aynı event tipiyle karşılaştığını düşünmeliyiz.</p><p><strong>Peki consumer’lar yeni mesaj olduğunu nasıl anlıyor?</strong></p><p>Burada hızlı bir düşünceyle aklımıza iki yöntem geliyor. Birinci yöntemde, consumer’lar <strong>polling</strong> yaparak yeni bir event’in olup olmadığını kontrol ederler. Bu işlem, veri olmadığı durumlarda dahi çalışacağı için diğer servisler için gecikme yaratabilir.</p><p>Diğer yöntemimizde ise, her yeni oluşan event için consumer’lara “Hey, yeni bir event var” bildirisi yollayarak mesajı dinlemelerini sağlayıp, gereksiz polling işleminden kaçınmış oluruz.</p><h4>Mesajlaşma Sistemleri</h4><p>Unix pipe veya TCP bağlantılarını kullanarak bir producer ve consumer arasında mesajlaşma sistemi kurulmasını sağlayabiliriz. Bugün popüler olarak kullanılan sistemlerin hepsi temelinde bu yapı taşlarının üzerine kurulmuştur.</p><p>Mesajlaşma sistemlerini tercih etmemizin sebebi, çoğu durumda bir producer’dan çıkan mesajı dinleyen farklı consumer’ların olmasıdır. Bu event’lerin farklı consumer’lara ulaşmasını sağlamak için mesajlaşma sistemlerini kullanıyoruz.</p><p><strong>Mesajlaşma sistemlerinden hangisini kullanacağımızın tek bir doğrusu yoktur. Bu yüzden sorabileceğimiz bazı sorular var:</strong></p><ol><li><strong>Producer’dan gelen mesajların sayısı, consumer’ların tüketebileceğinden fazla olursa ne olur?</strong></li></ol><p>Bu gibi durumlar için üç yöntem bulunmaktadır:</p><ul><li><strong>Mesajları droplayarak</strong> (işlemeyerek) sistem yükünü azaltabilirsiniz.</li><li>Mesajları bir <strong>kuyruğa atıp sırasıyla işleyebilirsiniz</strong>.</li><li>Bir <strong>sınır belirleyip</strong> sınır aşıldığı zaman producer tarafından mesaj üretilmesini engelleyebilirsiniz (<strong>backpressure</strong>).</li></ul><p>Eğer mesajları bir kuyruğa biriktirmeyi tercih ederseniz, kuyruk şiştiği sürece sistemin nasıl tepki vereceğini de takip etmek gerekmektedir.</p><ul><li><strong>Kuyrukta biriken mesajlar belleğin limitini aştığı zaman ne oluyor?</strong></li><li><strong>Diske yazma işlemi yapılıyor mu?</strong></li><li><strong>Disk performansı nasıl etkileniyor?</strong></li></ul><p>Sorularını sormamız gerekebilir.</p><ol><li><strong>Bir node offline duruma geçtiği zaman ne olur? Mesaj kaybı yaşanır mı?</strong></li><li>Mesajların kaybı kabul edilebilir bir durum değilse, mesajları sadece bellekte değil, aynı zamanda diskte tutan bir sistem tercih edilebilir. Bu durumda performans problemleri yaşanabilir. Eğer mesaj kaybı kabul edilebilir bir durum ise, bellekte verileri tutup yüksek verim alınabilir.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*2fGtEUjBL5ToYSkz.png" /></figure><h4>Message Brokers</h4><p>Event’lerimizi yollamanın ve yerine ulaştığından emin olmamızın yöntemlerinden biri <strong>Message Broker</strong> kullanmaktır. Aslında Message Broker sistemleri, stream’leri yönetmek için optimize edilmiş veri tabanlarıdır. Producer’lar ürettiği event’leri öncelikle broker’lara iletir ve broker’lar mesajların doğru consumer’lara iletildiğinden emin olurlar.</p><p>Bu sayede mesajın iletilmesi ve tutarlılık gibi sorunların hepsi broker’ların üzerine bırakılmış olur. Broker’lar iletilen mesajları bir kuyruk sistemine eklerler, consumer’lar tarafından bu kuyruk eritilmeye başlanır.</p><p>Broker’lar ellerinden geldiği sürece event’leri bir sırayla iletmeye çalışsa da, consumer tarafındaki bir gecikme veya event’lerin birikmesi gibi durumlarda bu event’lerin işlenme sırası karışabilir.</p><h4>Birden Fazla Consumer Çalıştırmak</h4><p><strong>Scalability</strong> için birden fazla consumer çalıştırdığımız durumlar vardır. Bu durumlarda mesajların hangi sırayla iletileceğini belirlemek için farklı yöntemler vardır. Bu yazımızda bunlardan iki tanesini inceleyebiliriz.</p><ul><li><strong>Load Balancing</strong> yönteminde, broker üzerine gelen her mesaj bir consumer’a iletilir. Bu sayede event’ler tarafından gelen bilgilerin büyük olması durumunda yükü eşit dağıtarak yük dengelemesi yapılabilir.</li><li><strong>Fan-out</strong> yönteminde ise, gelen mesajlar tüm consumer’lara iletilir. Bir e-ticaret sitesindeki sipariş oluşturma adımını düşündüğümüzde, sipariş oluştuğu noktada stok düzenlemesi ve mail gönderilmesi gibi işlemleri yöneten servislerimizin işlemden haberdar olmasını sağlayabiliriz.</li></ul><h4>Acknowlegments and Redelivery</h4><p>Broker’ların ilettiği mesajı dinleyen consumer, o an offline durumda olabilir. Bu durumlarda, event’in işlendiğinin bilgisini broker’lara iletmesi gerekir. Eğer mesaj <strong>acknowledgment</strong> bilgisi gelmezse, broker tarafından event farklı bir consumer’a iletilir ve işlenmesi sağlanır.</p><blockquote>Not: Consumer tarafından mesaj işlenmiş ve acknowlegment bilgisi iletilmiş olabilir. Ancak network katmanında bu bilginin kaybolma durum hala vardır.</blockquote><h3>Sonuç</h3><p>Bu yazıda, akış işleme ve mesajlaşma sistemlerinde <strong>producer</strong> ve <strong>consumer</strong> kavramlarının nasıl etkileştiğini ve event’lerin güvenilir iletimi için kullanılan yöntemleri inceledik. <strong>Message broker</strong>’ların, event’lerin doğru consumer’lara ulaştırılmasında oynadığı kritik rolü ve sistemlerin ölçeklenebilirliği için birden fazla consumer kullanmanın önemini vurguladık.</p><p>Ayrıca, mesajlaşma sistemlerinde karşılaşılabilecek zorlukları (örneğin, mesaj birikimi, node’ların offline duruma geçmesi ve mesaj kaybı riskleri) ele aldık. <strong>Acknowledgments</strong> ve <strong>redelivery</strong> mekanizmalarının, sistem performansını ve güvenilirliğini artırmada ne kadar önemli olduğunu gördük.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb7e99a1c8fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sticky Sessions in Kubernetes: Keeping User Sessions Consistent In Virtual Agents]]></title>
            <link>https://dogukanuhn.medium.com/sticky-sessions-in-kubernetes-keeping-user-sessions-consistent-f08f00a953d9?source=rss-512226dacaeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f08f00a953d9</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Berkay Doğukan Urhan]]></dc:creator>
            <pubDate>Sun, 15 Sep 2024 14:21:04 GMT</pubDate>
            <atom:updated>2024-09-15T14:40:48.720Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn how to use session affinity in Kubernetes to maintain consistent user sessions with ClientIP and NGINX Ingress Controller.</h4><p>Virtual assistant projects store the questions asked by users as conversation history. They can generate responses to new questions by also considering past questions and answers. Managing this system through a single deployment is straightforward.</p><p>In systems hosted on Kubernetes, load balancing is applied to handle the system’s load with different pods. In this scenario, the pod responding to the incoming request may not have the Agent class created for the client; therefore, it needs to create a new agent and retrieve the same conversation history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_Ns7DSe4ZPwB9xdO" /></figure><p>In a Kubernetes environment, you can use a method known as “session affinity” or “sticky sessions” to always direct requests from the same client to the same pods. This ensures that requests from a particular client are consistently forwarded to the same backend pod.</p><h4>Sticky Sessions</h4><p>Kubernetes Service resources support the sessionAffinity feature. By default set to None, when this value is set to ClientIP, requests from the same client IP are directed to the same pod.</p><p><strong>ClientIP</strong>: Provides session affinity based on the client’s IP address. Requests from the same client IP are directed to the same pod for a specified duration.</p><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: example-service<br>spec:<br>  selector:<br>    app: example-app<br>  ports:<br>    - protocol: TCP<br>      port: 80<br>      targetPort: 9376<br>  sessionAffinity: ClientIP<br>  sessionAffinityConfig:<br>    clientIP:<br>      timeoutSeconds: 3600</pre><h4>NGINX Ingress Controller</h4><p>The NGINX Ingress Controller can direct client requests to the same pod using HTTP cookies. This method eliminates issues associated with IP-based session affinity (NAT, proxy, dynamic IP addresses) because the session affinity is provided through a cookie placed in the client’s browser.</p><pre>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: ornek-ingress<br>  annotations:<br>    nginx.ingress.kubernetes.io/affinity: &quot;cookie&quot;<br>    nginx.ingress.kubernetes.io/session-cookie-name: &quot;session-id&quot;<br>    nginx.ingress.kubernetes.io/session-cookie-hash: &quot;sha1&quot;</pre><h4>Points to Consider</h4><ul><li><strong>Security</strong>: It’s important to manage session cookies securely. Cookies may need to be set with the HttpOnly and Secure flags.</li><li><strong>Cookie Conflicts</strong>: If your application uses the same cookie name, pay attention to naming conventions to avoid conflicts.</li></ul><h4>Conclusion</h4><p>Implementing session affinity in Kubernetes is essential for applications that rely on maintaining user session data across requests, such as virtual assistants. By using ClientIP in Kubernetes Services or cookie-based affinity with NGINX Ingress Controller, you ensure that requests from the same client are consistently routed to the same pod.</p><p>This helps maintain conversation continuity and improves user experience. However, always be mindful of security considerations like managing session cookies properly and avoiding cookie name conflicts to ensure a secure and efficient system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f08f00a953d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Senkron ve Asenkron Replication]]></title>
            <link>https://dogukanuhn.medium.com/senkron-ve-asenkron-replication-663a36c42144?source=rss-512226dacaeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/663a36c42144</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Berkay Doğukan Urhan]]></dc:creator>
            <pubDate>Wed, 04 Sep 2024 18:00:12 GMT</pubDate>
            <atom:updated>2024-09-04T18:00:12.450Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://amzn.eu/d/bNasLW6">Designing Data Intensive Applications</a> kitabını okuduğum sırada ilgimi çeken bir konuyu sizinle paylaşmak istedim.</p><h4>Replication Nedir?</h4><p>Replication dediğimiz kavram kısaca, bir veri tabanında tuttuğumuz verilerin kopyalarını, birbiriyle iletişim içerisinde olan sunucular üzerinde tutma işlemine verilen isimdir.</p><p>Tüm kodlarımız için replication ihtiyacımız bulunmuyor ancak eğer dünyanın farklı noktalarından erişime sahip bir sistem tasarlıyorsak veya sistemde kesinti yaşanmaması gerekiyorsa tercihlerimizin arasında bulunmalıdır.</p><p>İhtiyacımız olan örnek durumlar nelerdir?</p><ul><li>Avrupa ve Asya tarafından trafik aldığımızı düşünürsek, bu lokasyonlar dan gelen istekleri daha yakın veri tabanına düşürerek, response sürelerimizi kısaltabiliriz.</li><li>Sürekli işlem gören bir sistemimiz varsa, veri tabanına erişimde yaşanan bir problem sonrasında, çalışan diğer veri tabanı üzerinden istekler karşılanmaya devam eder.</li></ul><p>Replication kavramı <strong><em>single-leader</em></strong>, <strong><em>multi-leader</em></strong> ve <strong><em>leaderless</em> </strong>yöntemleri olarak 3 yapıda ele alınır. Ancak biz bu yazımız içerisinde <strong>Senkron ve Asenkron Replication </strong>kavramına göz atıyor olacağız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qYz7JeQTdojAhHlT" /></figure><h4>Senkron ve Asenkron Replication</h4><p>Senkron ve asenkron replikasyon, veritabanı sistemlerinde veri yedekleme ve tutarlılığı sağlamak için kullanılan iki temel yöntemdir. Senkron replikasyon, verinin aynı anda tüm düğümlere yazıldığı, veri tutarlılığının ön planda olduğu bir yöntemken, asenkron replikasyon verinin daha hızlı aktarımına odaklanır ve izleyici düğümler arasında bir gecikme olabilir. Her iki yöntem de farklı performans ve güvenlik gereksinimlerine göre seçilir.</p><h4>Senkron Replication</h4><p>Senkron replikasyon, lider düğümün (leader node) gönderdiği veriyi bir izleyici düğüme (follower node) yazdıktan sonra, diğer düğümlerden geri bildirim almadan işlemi tamamlamadığı bir sistemdir. Lider düğüm, izleyicilerin veriyi başarıyla aldıklarına dair onay almadan yeni bir işlem gerçekleştiremez.</p><p>Bu, tüm düğümler arasında sürekli veri tutarlılığı sağlamak için tasarlanmış bir yöntemdir. İşlem, yalnızca izleyici düğümler de aynı veriyi kaydettiğinde başarılı bir şekilde tamamlanmış sayılır. Böylece, izleyici düğümler lider düğüm ile her zaman senkronize kalır.</p><blockquote><em>Avantajlar:</em></blockquote><blockquote><strong>Veri Tutarlılığı:</strong> Tüm düğümler her zaman en güncel ve doğru verilere sahiptir. Lider düğümde yapılan her değişiklik, izleyici düğümlerde de anında yansır, bu sayede veri tutarsızlıkları önlenir.</blockquote><blockquote><strong>Veri Güvenliği:</strong> Eğer lider düğümde bir sorun olursa, izleyici düğümler de aynı verilere sahip olduğundan veri kaybı yaşanmaz ve sistemde herhangi bir bozulma meydana gelmez.</blockquote><blockquote><em>Dezavantajlar:</em></blockquote><blockquote><strong>Performans Kaybı:</strong> Lider düğüm, izleyicilerden onay beklemek zorunda olduğu için işlem süresi uzayabilir. Bu bekleme süresi, özellikle yüksek iş yükü ve çok sayıda izleyici düğüm varsa, performans sorunlarına yol açabilir.</blockquote><blockquote><strong>Kapasite Sorunları:</strong> Eğer izleyicilerden biri yanıt vermezse, lider düğüm yeni işlemleri durdurmak zorunda kalabilir. Bu durum, özellikle büyük ve dağıtık sistemlerde verimliliği azaltabilir.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*53fCeB0CV0ZiKhnM.jpg" /></figure><h4>Asenkron Replication</h4><p>Asenkron replikasyon, lider düğümün (leader node) veriyi izleyici düğümlere (follower node) gönderdikten sonra onların geri bildirimini beklemeden işlemi tamamladığı bir sistemdir.</p><p>Lider, veriyi izleyicilere iletir ancak onların bu veriyi ne zaman aldığını veya kaydettiğini beklemek zorunda değildir. Bu, liderin hızlı bir şekilde yeni işlemlere geçmesine olanak tanır ve takipçi düğümler, liderin temposuna göre asenkron şekilde veri güncellemelerini işler.</p><blockquote><em>Avantajlar:</em></blockquote><blockquote><strong>Yüksek Performans:</strong> Lider düğüm, izleyicilerin geri bildirimini beklemediği için veri yazma işlemi daha hızlı gerçekleşir. Bu, özellikle yüksek trafikli ve büyük sistemlerde önemli bir performans artışı sağlar.</blockquote><blockquote><strong>Daha Az Bekleme:</strong> Lider düğüm, izleyicilerin durumu veya kapasitesine bağlı olmaksızın işlemleri sürdürebilir, böylece sistemdeki gecikmeler azalır ve işleme kapasitesi artar.</blockquote><blockquote><em>Dezavantajlar:</em></blockquote><blockquote><strong>Veri Kaybı Riski:</strong> İzleyici düğümler, lider düğümle anında senkronize olmadığı için, lider düğümde bir arıza olduğunda bazı veriler izleyici düğümlere ulaşmamış olabilir. Bu da veri kaybına neden olabilir.</blockquote><blockquote><strong>Veri Tutarsızlığı:</strong> İzleyici düğümler, lider düğümden gecikmeli olarak veri alabileceğinden, tüm düğümler arasında tutarsızlıklar oluşabilir. Bu da bazı durumlarda eski veya yanlış verilerin kullanılmasına yol açabilir.</blockquote><p><strong>Senkron Replikasyonun En Uygun Olduğu Senaryolar:</strong><br>Senkron replikasyon, veri tutarlılığının kritik olduğu ve veri kaybının kesinlikle kabul edilemediği senaryolarda tercih edilmelidir. Örneğin, finansal işlemler, bankacılık sistemleri, hastane bilgi yönetim sistemleri gibi her bir veri parçasının anında doğru ve güncel olmasının zorunlu olduğu durumlarda senkron replikasyon kullanılır. Bu sistemlerde, performans kaybı kabul edilebilirken veri kaybı kabul edilemez.</p><p><strong>Asenkron Replikasyonun En Uygun Olduğu Senaryolar:</strong><br>Asenkron replikasyon, performansın ön planda olduğu ve bazı veri kaybı toleransının olduğu durumlarda uygundur. Örneğin, web siteleri, sosyal medya platformları, e-ticaret siteleri gibi yüksek trafikli sistemlerde hız ve işleme kapasitesi daha önemli olabilir. Bu tür uygulamalarda, belirli bir veri kaybı veya gecikme kabul edilebilirken, sistemin sürekli hızlı yanıt verebilmesi büyük bir avantaj sağlar.</p><h4>Özet</h4><p>Senkron ve asenkron replikasyon yöntemleri farklı ihtiyaçlara hizmet eder. Senkron replikasyon, veri tutarlılığının hayati olduğu ve herhangi bir veri kaybının kabul edilemediği senaryolarda tercih edilir. Ancak, izleyici düğümlerden onay bekleme süresi nedeniyle performans kaybı yaşanabilir. Asenkron replikasyon ise performans avantajı sağlar, ancak veri kaybı ve tutarsızlık riskini beraberinde getirir. Sistem tasarımında, veri güvenliği ile performans arasındaki denge dikkate alınarak doğru replikasyon yöntemi seçilmelidir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=663a36c42144" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Better Locking with System.Threading.Lock]]></title>
            <link>https://dogukanuhn.medium.com/better-locking-with-system-threading-lock-421a378ed3fe?source=rss-512226dacaeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/421a378ed3fe</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Berkay Doğukan Urhan]]></dc:creator>
            <pubDate>Wed, 04 Sep 2024 11:08:21 GMT</pubDate>
            <atom:updated>2024-09-08T18:53:35.693Z</atom:updated>
            <content:encoded><![CDATA[<p>Discover efficient synchronization in high-traffic systems using .NET 9’s Lock object for improved performance and reduced deadlock risks.</p><h3>Introduction</h3><p>When designing systems that handle high traffic, using multi-threaded structures has become inevitable. Some objects within the code we develop try to interact with multiple threads simultaneously, but this can sometimes lead to undesirable outcomes.</p><p>First, let’s look at the structures used in these situations, and then discuss how the new Lock object introduced in .NET 9 works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Szd18enqoBWr1Z8S" /></figure><h4>Lock Keyword</h4><p>When multiple threads need to update the same shared variable, you use a “lock” to ensure that only one thread can perform operations on that variable at a time. Other threads must wait for the lock to be released.</p><pre>private static readonly object _lockObject = new object();<br>private static int _counter = 0;<br><br>static void Main()<br>{<br>    Thread thread1 = new Thread(Increment);<br>    Thread thread2 = new Thread(Increment);<br><br>    thread1.Start();<br>    thread2.Start();<br><br>    thread1.Join();<br>    thread2.Join();<br><br>    Console.WriteLine($&quot;Counter: {_counter}&quot;);<br>}<br><br>private static void Increment()<br>{<br>    lock (_lockObject)<br>    {<br>        _counter++;<br>    }<br>}</pre><p>When we use a lock, we guarantee that the output for _counter will be 2. But what could happen if we didn&#39;t use a lock?</p><h4>Potential Situations:</h4><ul><li><strong>Thread 1</strong>: Reads the value of _counter (0) and increments it (1) but hasn&#39;t updated it yet.</li><li><strong>Thread 2</strong>: Reads the value of _counter (0), increments it (1), and updates it.</li><li><strong>Thread 1</strong>: Updates the value of _counter (1).</li></ul><blockquote>There are both pros and cons to using locks:</blockquote><blockquote><strong>Data Consistency</strong>: It ensures that the data remains consistent by preventing multiple threads from making changes to the same data simultaneously.</blockquote><blockquote><strong>Deadlock Prevention</strong>: Improper use can lead to deadlocks, where a thread tries to lock another resource before releasing the one it has locked. Careful use is essential.</blockquote><blockquote><strong>Performance Impact</strong>: Using locks can lead to waiting times and thus performance degradation, so they should only be used when necessary and for as short a duration as possible.</blockquote><h4>Monitor</h4><p>The Monitor class under System.Threading provides synchronized access to objects for thread-safe operations. The Monitor class doesn&#39;t differ much from the lock operation but offers more control over how threads access the locked objects.</p><pre>bool lockTaken = false;<br>try<br>{<br>    Monitor.TryEnter(_lockObject, ref lockTaken);<br>    if (lockTaken)<br>    {<br>        // Lock was successfully acquired, proceed with the operation.<br>    }<br>    else<br>    {<br>        // Lock was not acquired, alternative action can be taken.<br>    }<br>}<br>finally<br>{<br>    if (lockTaken)<br>    {<br>        Monitor.Exit(_lockObject); // Release the lock.<br>    }<br>}</pre><h3>Introduction</h3><p>When designing systems that handle high traffic, using multi-threaded structures has become inevitable. Some objects within the code we develop try to interact with multiple threads simultaneously, but this can sometimes lead to undesirable outcomes.</p><p>First, let’s look at the structures used in these situations, and then discuss how the new Lock object introduced in .NET 9 works.</p><h4>Lock Keyword</h4><p>When multiple threads need to update the same shared variable, you use a “lock” to ensure that only one thread can perform operations on that variable at a time. Other threads must wait for the lock to be released.</p><pre>private static readonly object _lockObject = new object();<br>    private static int _counter = 0;<br><br>    static void Main()<br>    {<br>        Thread thread1 = new Thread(Increment);<br>        Thread thread2 = new Thread(Increment);<br><br>        thread1.Start();<br>        thread2.Start();<br><br>        thread1.Join();<br>        thread2.Join();<br><br>        Console.WriteLine($&quot;Counter: {_counter}&quot;);<br>    }<br><br>    private static void Increment()<br>    {<br>        lock (_lockObject)<br>        {<br>            _counter++;<br>        }<br>    }</pre><p>When we use a lock, we guarantee that the output for _counter will be 2. But what could happen if we didn&#39;t use a lock?</p><h4>Potential Situations:</h4><ul><li><strong>Thread 1</strong>: Reads the value of _counter (0) and increments it (1) but hasn&#39;t updated it yet.</li><li><strong>Thread 2</strong>: Reads the value of _counter (0), increments it (1), and updates it.</li><li><strong>Thread 1</strong>: Updates the value of _counter (1).</li></ul><p>There are both pros and cons to using locks:</p><ul><li><strong>Data Consistency</strong>: It ensures that the data remains consistent by preventing multiple threads from making changes to the same data simultaneously.</li><li><strong>Deadlock Prevention</strong>: Improper use can lead to deadlocks, where a thread tries to lock another resource before releasing the one it has locked. Careful use is essential.</li><li><strong>Performance Impact</strong>: Using locks can lead to waiting times and thus performance degradation, so they should only be used when necessary and for as short a duration as possible.</li></ul><h3>Monitor</h3><p>The Monitor class under System.Threading provides synchronized access to objects for thread-safe operations. The Monitor class doesn&#39;t differ much from the lock operation but offers more control over how threads access the locked objects.</p><pre>bool lockTaken = false;<br>try<br>{<br>    Monitor.TryEnter(_lockObject, ref lockTaken);<br>    if (lockTaken)<br>    {<br>        // Lock was successfully acquired, proceed with the operation.<br>    }<br>    else<br>    {<br>        // Lock was not acquired, alternative action can be taken.<br>    }<br>}<br>finally<br>{<br>    if (lockTaken)<br>    {<br>        Monitor.Exit(_lockObject); // Release the lock.<br>    }<br>}</pre><blockquote>Advantages:</blockquote><blockquote><strong>Flexibility</strong>: With Monitor.TryEnter, you can check if you acquired the lock immediately or wait for a certain period, allowing for more dynamic locking strategies.</blockquote><blockquote><strong>Enhanced Error Management</strong>: You can perform alternative actions if the lock is not acquired, ensuring safe program execution in error scenarios.</blockquote><blockquote>Disadvantages:</blockquote><blockquote><strong>Code Complexity</strong>: Using Monitor.Enter and Monitor.Exit is more complex compared to the lock keyword and requires careful attention, as improper use can lead to deadlocks.</blockquote><blockquote><strong>Performance Impact</strong>: Unnecessary long lock usage can cause threads to wait and result in performance degradation.</blockquote><h4>System.Threading.Lock</h4><p>The System.Threading.Lock object, introduced in .NET 9, offers a more modern and efficient synchronization mechanism compared to traditional lock and Monitor classes. This new structure simplifies sync operations in multi-threaded applications while offering noticeable performance improvements. However, caution is advised when using it in production environments.</p><pre>static Lock myLock = new Lock();<br><br>static void Main()<br>{<br>    using (myLock.EnterScope())<br>    {<br>        // Code within this block can only be accessed by this thread, protected by myLock.<br>    }<br>}</pre><p>With .NET 9’s System.Threading.Lock, a thread can enter a specific scope with the EnterScope method, making the resource inaccessible to other threads during that time. Since it works with the Dispose pattern, the lock is automatically released, even in error situations, increasing code reliability and reducing deadlock risks.</p><h4>Performance</h4><p>Using System.Threading.Lock in code structures results in a 25% performance improvement. However, it is noted that ongoing development on the Lock class may lead to worse results in some cases while awaiting performance optimizations.</p><pre>| Method                   | Mean      | Error    | StdDev   | Ratio | Gen0   | Allocated | Alloc Ratio |<br>|------------------------- |----------:|---------:|---------:|------:|-------:|----------:|------------:|<br>| CountTo1000WithLock      | 107.22 us | 1.561 us | 1.460 us |  1.00 | 0.1221 |   1.06 KB |        1.00 |<br>| CountTo1000WithLockClass |  75.73 us | 0.884 us | 0.827 us |  0.71 | 0.1221 |   1.05 KB |        0.99 |</pre><h3>Summary</h3><p>In this article, we explored the challenges encountered when managing multi-threaded structures in high-traffic systems and the traditional methods used to overcome these challenges.</p><p>We also looked at the modern and efficient synchronization solutions offered by the System.Threading.Lock object introduced in .NET 9. This new structure provides performance improvements and reduces the risk of deadlocks.</p><blockquote><a href="https://www.c-sharpcorner.com/UploadFile/de41d6/monitor-and-lock-in-C-Sharp/"><em>https://www.c-sharpcorner.com/UploadFile/de41d6/monitor-and-lock-in-C-Sharp/</em></a><em><br></em><a href="https://steven-giesel.com/blogPost/4cf6d48a-ec9d-4c68-961c-31fd8d8c1340"><em>https://steven-giesel.com/blogPost/4cf6d48a-ec9d-4c68-961c-31fd8d8c1340</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=421a378ed3fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[.NET9 İle Gelen Yenilikler: System.Threading.Lock]]></title>
            <link>https://dogukanuhn.medium.com/net9-i%CC%87le-gelen-yenilikler-system-threading-lock-c24770994d22?source=rss-512226dacaeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/c24770994d22</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[thread-synchronization]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Berkay Doğukan Urhan]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 20:24:58 GMT</pubDate>
            <atom:updated>2024-09-08T18:51:25.948Z</atom:updated>
            <content:encoded><![CDATA[<p>Yüksek trafikli sistemlerde multi-thread yapıların yönetiminde .NET 9 ile gelen modern ve performans odaklı System.Threading.Lock yeniliklerini keşfedin.</p><h3>Giriş</h3><p>Yüksek trafik geçiren sistemler tasarladığımız zamanlarda multi-thread yapıları kullanmamız kaçınılmaz oldu. Geliştirdiğimiz kod parçaları içerisindeki bazı objeler, aynı anda birden fazla thread ile etkileşime geçmeye çalışırlar ama bu durum bazen istenmeyen sonuçlara yol açabilir.</p><p>Önce bu durumlar için kullanılan yapılara göz atıp, sonrasında ise .Net 9 ile gelen yeni Lock objesinin nasıl çalıştığına değinelim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Dtn9u2H9Bohmt9iX" /></figure><h4>Lock Keyword</h4><p>Birden fazla iş parçacığının aynı paylaşılan değişkeni güncellemesi gerektiğinde, “lock” kullanarak sadece bir iş parçacığının o değişken üzerinde işlem yapmasına izin verirsiniz. Diğer iş parçacıkları, kilidin serbest bırakılmasını beklemek zorundadır.</p><pre> private static readonly object _lockObject = new object();<br>    private static int _counter = 0;<br><br>    static void Main()<br>    {<br>        Thread thread1 = new Thread(Increment);<br>        Thread thread2 = new Thread(Increment);<br><br>        thread1.Start();<br>        thread2.Start();<br><br>        thread1.Join();<br>        thread2.Join();<br><br>        Console.WriteLine($&quot;Counter: {_counter}&quot;);<br>    }<br><br>    private static void Increment()<br>    {<br>        lock (_lockObject)<br>        {<br>            _counter++;<br>        }<br>    }</pre><p>Lock kullandığımız zaman oluşacak _counter çıktısının <strong>2</strong> olduğunu garantilemiş oluyoruz. Peki lock kullanmasaydık ne gibi durumlarla karşılaşabilirdik.</p><p>Gerçekleşebilecek bazı durumlar:</p><ul><li><strong>İş Parçacığı 1</strong>: _counter değerini okur (0) ve artırır (1), ancak henüz güncellemez.</li><li><strong>İş Parçacığı 2</strong>: _counter değerini okur (0), artırır (1), ve günceller.</li><li><strong>İş Parçacığı 1</strong>: _counter değerini günceller (1).</li></ul><p>Lock kullanmanın bazı artı ve eksi yönleri de olabilir. Bu durumlar ise;</p><blockquote><strong>Veri Tutarlılığı</strong>: Aynı veri üzerinde birden fazla iş parçacığının aynı anda değişiklik yapmasının önüne geçerek, verinin tutarlı kalmasını sağlar.</blockquote><blockquote><strong>Deadlock Önleme</strong>: Yanlış kullanıldığında deadlock (ölü kilit) durumlarına yol açabileceği için dikkatli kullanılmalıdır. Bir iş parçacığı, kilitlediği kaynağı serbest bırakmadan başka bir kaynağı kilitlemeye çalışırsa, bir deadlock durumu oluşabilir.</blockquote><blockquote><strong>Performans Etkisi</strong>: Lock kullanımı, bekleme sürelerine ve dolayısıyla performans düşüşlerine yol açabilir. Bu yüzden sadece gerekli olduğu durumlarda ve mümkün olduğunca kısa süreli kullanılmalıdır.</blockquote><h4>Monitor</h4><p><a href="https://learn.microsoft.com/en-us/dotnet/api/system.threading?view=net-8.0">System.Threading</a> altında bulunan <a href="https://learn.microsoft.com/en-us/dotnet/api/system.threading.monitor?view=net-8.0">Monitor</a> sınıfı ile lock işlemi yaptığımız objelere sync bir yapıda erişim sağlayabiliriz. Monitor sınıfı Lock işleminde yaptığımız işlemden farklı bir işlem yapmaz ancak lock yaptığımız objelere threadlerin erişimi konusunda daha kontrol edilebilir bir yapı sunar.</p><pre>bool lockTaken = false;<br>try<br>{<br>    Monitor.TryEnter(_lockObject, ref lockTaken);<br>    if (lockTaken)<br>    {<br>        // Kilit başarıyla alındı, işlem yapılabilir.<br>    }<br>    else<br>    {<br>        // Kilit alınamadı, alternatif işlem yapılabilir.<br>    }<br>}<br>finally<br>{<br>    if (lockTaken)<br>    {<br>        Monitor.Exit(_lockObject); // Kilidi serbest bırak.<br>    }<br>}</pre><blockquote>Faydalı Yönler</blockquote><blockquote><strong>Esneklik</strong>: Monitor.TryEnter ile kilidi hemen alıp almadığınızı kontrol edebilir veya belirli bir süre boyunca bekleyebilirsiniz, bu da daha dinamik kilitleme stratejileri sağlar.</blockquote><blockquote><strong>Gelişmiş Hata Yönetimi</strong>: Monitor.TryEnter ile kilit alınamadığında alternatif bir işlem gerçekleştirebilirsiniz, bu da hata durumlarında programın güvenli çalışmasını sağlar.</blockquote><blockquote>Zararlı Yönler</blockquote><blockquote><strong>Kod Karmaşıklığı</strong>: Monitor.Enter ve Monitor.Exit kullanımı, lock anahtar kelimesine göre daha karmaşıktır ve dikkatli olmayı gerektirir, aksi takdirde deadlock gibi hatalara yol açabilir.</blockquote><blockquote><strong>Performans Etkisi</strong>: Gereksiz yere uzun süreli kilit kullanımı, iş parçacıklarının birbirini beklemesine ve performans düşüşüne neden olabilir.</blockquote><h3>System.Threading.Lock</h3><p>.NET 9 ile tanıtılan System.Threading.Lock objesi, geleneksel lock ve Monitor sınıflarına kıyasla daha modern ve verimli bir senkronizasyon mekanizması sunuyor. Bu yeni yapı, multi-thread uygulamalarında sync işlemleri kolaylaştırırken aynı zamanda performans konusunda gözle görülür fark sunuyor. <strong>Ancak production ortamında kullanırken dikkatli olmak gerekebilir.</strong></p><pre>static Lock myLock = new Lock();<br><br>    static void Main()<br>    {<br>        using (myLock.EnterScope())<br>        {<br>            // Bu blok içindeki kod, myLock tarafından korunan kaynaklara yalnızca bu iş parçacığı erişebilir.<br>        }<br>    }</pre><p><strong>System.Threading.Lock</strong>, .NET 9 ile gelen bir yenilik olarak, geleneksel lock yapısına göre daha verimli ve modern bir senkronizasyon sağlar. <strong>EnterScope</strong> metodu, iş parçacığının özel bir alana girmesini sağlayarak, bu alanı başka bir iş parçacığının erişimine kapatır. <strong>Dispose </strong>yapısı ile çalıştığından, hata durumlarında bile kilidin serbest bırakılmasını otomatik hale getirir, bu da kodun güvenilirliğini artırır ve <strong>deadlock </strong>riskini azaltır.</p><h4>Performans</h4><p><strong>System.Threading.Lock </strong>kullanarak hazırlanan kod yapısında performans olarak %25 oranında bir hızlanma görüntüleniyor. Ancak <a href="https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs#L850">Lock detaylarında</a> belirtildiği üzere, Lock sınıfı üzerinde geliştirmeler hala devam etmekte ve performans iyileştirmesi beklerken daha kötü sonuçlarda doğurabileceğinden bahsediliyor.</p><pre>| Method                   | Mean      | Error    | StdDev   | Ratio | Gen0   | Allocated | Alloc Ratio |<br>|------------------------- |----------:|---------:|---------:|------:|-------:|----------:|------------:|<br>| CountTo1000WithLock      | 107.22 us | 1.561 us | 1.460 us |  1.00 | 0.1221 |   1.06 KB |        1.00 |<br>| CountTo1000WithLockClass |  75.73 us | 0.884 us | 0.827 us |  0.71 | 0.1221 |   1.05 KB |        0.99 |</pre><h4>Özet</h4><p>Yazımız da yüksek trafikli sistemlerde çoklu iş parçacığı yapılarının yönetiminde karşılaşılan zorlukları ve bu zorlukların üstesinden gelmek için kullanılan geleneksel yöntemleri inceledik.</p><p>.NET 9 ile tanıtılan System.Threading.Lock objesinin sunduğu modern ve verimli senkronizasyon çözümlere göz attık. System.Threading.Lock ile gelen performans iyileştirmeleri ve deadlock risklerini azaltma gibi avantajlarının bulunduğunu gördük.</p><blockquote>Referanslar</blockquote><blockquote><a href="https://www.c-sharpcorner.com/UploadFile/de41d6/monitor-and-lock-in-C-Sharp/">https://www.c-sharpcorner.com/UploadFile/de41d6/monitor-and-lock-in-C-Sharp/</a><br><a href="https://steven-giesel.com/blogPost/4cf6d48a-ec9d-4c68-961c-31fd8d8c1340">https://steven-giesel.com/blogPost/4cf6d48a-ec9d-4c68-961c-31fd8d8c1340</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c24770994d22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RabbitMQ usage with Node.js and .Net Core]]></title>
            <link>https://dogukanuhn.medium.com/rabbitmq-usage-with-node-js-and-net-core-8d49f2b4700e?source=rss-512226dacaeb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d49f2b4700e</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <dc:creator><![CDATA[Berkay Doğukan Urhan]]></dc:creator>
            <pubDate>Fri, 09 Jul 2021 15:56:26 GMT</pubDate>
            <atom:updated>2021-07-10T23:08:55.440Z</atom:updated>
            <content:encoded><![CDATA[<h3>RabbitMQ usage with Node.js and .Net Core</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*7e4oQkig0t_45ql2Dlc0Pg.png" /><figcaption>rabbitmq</figcaption></figure><p>Hello everyone,</p><p>Today i am going to talk about RabbitMQ. While i was trying to understand micro services, i faced with RabbitMQ.</p><p>After that i decided to make some examples but some obstacles stoped me. So i wanna talk about exchange types and how to use RabbitMQ with .Net Core and Node.js</p><h4>Exchange Types</h4><p>In short, we can describe it as control the routing of messages of queues. Exhanges named like “Direct, Topic, Fanout, Headers” but today i just want to talk two of them:</p><ul><li>Direct: If you want to send a message to a specific queue like payment service, this is the best way. While creating a queue, we can set a routing key such as PaymentServiceQueue. While using <strong>Direct Exchanges, </strong>choose the routing key we set before for the send message consumer.</li><li>Fanout: Fanout Exchanges dont use routing keys. Fanout Exchanges send every message come to itself to every queues in its binding</li></ul><h4>Example</h4><p>There is some examples in my github repository. My project include notification logic. So i use a small Node.js application for consume and send e-mail or sms to user. Lets check codes and exchange for make some sense.</p><h4>Notification Exchange</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*iuLkVom94WeaA2G1kJehHg.png" /><figcaption>Notification Exchange</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*4S-chihBjDJeH9oFOAlFzA.png" /><figcaption>Queues</figcaption></figure><p>Notification exchange is a direct exchange. I created two queue and bind them to my notification exchange. While during bind process, i declare routing keys “notification.email” and “notification.sms”.</p><h4>.Net Core Client</h4><p>We have to install <strong>RabbitMQ.Client </strong>package from Nuget.</p><p>After users use payment service, there will be some notification operations. After control the user notification options, there will be some operation to sending information about his/her basket detail to user.</p><h4>Code</h4><pre>public void PublishToMessageQueue(string exchange,string routingKey, string eventData){</pre><pre>var factory = new ConnectionFactory() { HostName = &quot;localhost&quot;, VirtualHost=&quot;productsales&quot; };</pre><pre>using var connection = factory.CreateConnection();</pre><pre>using var channel = connection.CreateModel();</pre><pre>var body = Encoding.UTF8.GetBytes(eventData);</pre><pre>channel.BasicPublish(exchange: exchange,</pre><pre>routingKey: integrationEvent,</pre><pre>basicProperties: null,</pre><pre>body: body);</pre><pre>}</pre><p>This function get parameters such as exchange name, routing key and data.</p><p>ConnectionFactory used for create connection with RabbitMQ. In my scenario, there will be a virtual host named “productsales” and its not required.</p><h4>Node.js Consumer</h4><p>This application role is get email or phone number and after that send the text to user.</p><p>We have to install <strong>amqplib </strong>package for create connection with RabbitMq.</p><pre>npm install amqplib</pre><h4>Code</h4><pre>const amqp = require(&quot;amqplib/callback_api&quot;);<br><br>amqp.connect(&quot;amqp://localhost/productsales&quot;, function (err, conn) {<br>  if (err) throw err;<br>  conn.createChannel(function (err, channel) {<br>    var emailQueue = &quot;notification.email&quot;;<br>    var smsQueue = &quot;notification.sms&quot;;<br>    channel.consume(emailQueue, (x) =&gt; {<br>      SendEmail(JSON.parse(x.content));<br>    });<br>    channel.consume(smsQueue, (x) =&gt; {<br>      SendSMS(JSON.parse(x.content));<br>    });<br>  });<br>});<br><br>function SendEmail(data) {<br>  console.log(data);<br>}<br><br>function SendSMS(data) {<br>  console.log(data);<br>}</pre><p>GitHub link for the whole project</p><p><a href="https://github.com/dogukanuhn/ProductSales">dogukanuhn/ProductSales</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d49f2b4700e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>