<?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 Orhan Yılmaz on Medium]]></title>
        <description><![CDATA[Stories by Orhan Yılmaz on Medium]]></description>
        <link>https://medium.com/@orhany?source=rss-30581c8f5935------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CUUU0M5NVQQTJydYT77Nwg.jpeg</url>
            <title>Stories by Orhan Yılmaz on Medium</title>
            <link>https://medium.com/@orhany?source=rss-30581c8f5935------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:48:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@orhany/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[Spring Anotasyonları (sık kullanılan)]]></title>
            <link>https://medium.com/@orhany/spring-anotasyonlar%C4%B1-s%C4%B1k-kullan%C4%B1lan-90b74cbfce70?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/90b74cbfce70</guid>
            <category><![CDATA[spring-annotation]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Sun, 02 Jun 2024 10:28:52 GMT</pubDate>
            <atom:updated>2024-06-02T10:28:52.522Z</atom:updated>
            <content:encoded><![CDATA[<p>Merhaba, Bu yazımızda sıklıkla kullanılan Java anotasyanlarından bahsedeğim. Java anotasyanları XML bazlı konfügürasyonların kullanımına alternatif ve pratik çözüm için geliştirilmiştir.</p><h3>@Bean</h3><p>@Bean<strong> </strong>anotasyonu Application Context ‘ de sınıfın bir instance ‘ını tutar ve gerekli olduğunda context den çağırılır. Bean anatosyonu içerin class @Configuration anotasyonuna sahip olmalıdır.</p><pre>@Configuration<br>public class AppConfig {<br>    @Bean<br>    public MyService myService() {<br>        return new MyServiceImpl();<br>    }<br>}</pre><h3>@Component</h3><p>@Component<strong> </strong>anotasyonu kullanılan class ‘ın Application Context ‘ de instance’ ını oluşturur ve servisi kullanacak sınıf Autowired ile bu sınıfı call eder.</p><pre>@Component<br>public class MyComponent {<br>    // ...<br>}</pre><h3>@Configuration</h3><p>@Configuration anotasyonu sınıfın bir konfigürasyon sınıfı olduğunu ve bu sınıf içinde bean tanımlaması yapılabileceğini gösterir. Spring configuration anotasyonunu görür ve sınıfın bir konfigürasyon sınıfı olduğunu anlar. @Bean anotasyonuyla belirtilen metodların objelerini Application Context bean olarak ekler.</p><pre>@Configuration<br>public class MyConfig {<br>    @Bean<br>    public MyService myService() {<br>        return new MyServiceImpl();<br>    }<br>}</pre><h3>@Autowired</h3><p>İlgili servisi injeck etmek için kullanılan anotasyondur. İnjeck edilen serviste biren fazla bean var ise hangisinin olduğunu @Qualifier anotasyoınu ile yönetiriz.</p><pre>@Autowired<br>private MyService myService;</pre><h3>@Qualifier</h3><p>Autowired ile enjeckte ettiğimiz servisin birden fazla Bean ‘i var ise hangi bean in kullanılacağını ifade etmek için kullanırız.</p><pre>@Autowired<br>@Qualifier(&quot;specificBean&quot;)<br>private MyService myService;</pre><h3>@Value</h3><p>External bir özellik inject etmek için kullanılır. Örneğin bir *.properties veya *.yaml dosyasındaki bir özelliği sınıfa @Value<em>(</em>“${<em> özellik_param</em>}”<em>) </em>anotasyonu ile inject ederiz.</p><pre>@Value(&quot;${my.property}&quot;)<br>private String myProperty;</pre><h3>@Lazy</h3><p>Default olarak Spring uygulaması ayağa kalktığında bean ’ler oluşturulur. Lazy anotasyonu ile Application Context ‘de ilgili bean in request yapıldığında oluşturulması sağlanır.</p><pre>@Lazy<br>@Bean<br>public MyService myService() {<br>    return new MyServiceImpl();<br>}</pre><h3>@Primary</h3><p>Aynı türden birden fazla Bean varsa, Spring’in hangisini enjekte edeceğini bilmesi gerekir. Bu durum <a href="http://twitter.com/Qualifier">@Qualifier</a> ile başarılabilir, ancak ana örneği kullanmamız gereken ve nadiren diğerlerini kullanmamız gereken durumlar vardır. Bu durumda, en sık kullanılan Bean ‘i <a href="http://twitter.com/Primary">@Primary</a> ile işaretleyebiliriz</p><pre>@Primary<br>@Bean<br>public MyService primaryService() {<br>    return new MyServiceImpl();<br>}</pre><h3>@Scope</h3><p>Application Context ‘de belirli koşullara göre Bean oluşturulmasını sağlar. Scope türlerininı açılarsak</p><p><strong>Singleton </strong>: Context ‘de oluturulan Bean ‘ ler varsayılan singleton olarak bir kere üretilir.</p><p><strong>Prototype </strong>: Her istendiğinde IOC container tarafında farklı bir örneği (instance) oluşturulur.</p><p><strong>Request : </strong>HTTP request geldiğinde Bean oluşturulur.</p><p><strong>Session </strong>: HTTP session istediğinde bean oluşturulur.</p><p><strong>Application</strong> : ServletContext’ in yaşam döngüsü için bir bean oluşturur</p><p><strong>WebSocket</strong> : Berlirlenen WebSocket kuralı ile bean oluşturulur.</p><pre>@Scope(&quot;prototype&quot;)<br>@Bean<br>public MyService myService() {<br>    return new MyServiceImpl();<br>}</pre><h3>@Profile</h3><pre>@Profile(&quot;dev&quot;)<br>@Bean<br>public MyService devService() {<br>    return new DevServiceImpl();<br>}</pre><h3>@Controller</h3><p>Sınıfın Spring MVC’ de (Model-View-Controller) bir Controller olduğunu belirtmek için sınıf düzeyinde bir açıklamadır. Bu açıklamanın REST için kullanımı @RestController anotasyonudur.</p><pre>@Controller<br>public class MyController {<br>    // ...<br>}</pre><h3>@Service</h3><p>Servis katmanında kullanılan bu anotasyon, uygulamanın genellikle yeniden kullanılacak ve kolayca bakımı yapılacak iş mantığına sahip olduğunu belirtir.</p><pre>@Service<br>public class MyService {<br>    // ...<br>}</pre><h3>@Repository</h3><p>Bu anotasyon, sınıfın DAO (Veri Erişim Nesnesi) Katmanını olduğunu gösterir.</p><pre>@Repository<br>public class MyRepository {<br>    // ...<br>}</pre><h3>@EnableAsync</h3><p>Spring context içerisinde herhangi bir yerde asenkron işlem yapacağımızı bildirir. <strong>@EnableAsync</strong> anotasyonunu main clas içerisinde belirtmemiz gerekmektedir. Asenkron yapmak istediğimiz method da ise <strong>@Async</strong> anotasyonu ile bildirim yapmamız gerekmektedir.</p><pre>@SpringBootApplication<br>@EnableAsync<br>public class MyApplication {<br>    public static void main(String[] args) {<br>        SpringApplication.run(MyApplication.class, args);<br>    }</pre><h3>@Async</h3><p>@Async anotasyonu, bir methodun asenkron olarak çalıştırılmasını sağlar.</p><pre>@Async<br>public void asyncMethod() {<br>    // Asenkron işlemler<br>}</pre><h3>@Transactional</h3><p>@Transactional anotasyonu, method veya class seviyesinde bir işlem (transaction) yönetimini belirtir.</p><pre>@Transactional<br>public void performTransaction() {<br>    // İşlem gerektiren işlemler<br>}</pre><h3>@Scheduled</h3><p>@Scheduled anotasyonu, belirli bir zamanlama ile methodların çalıştırılmasını sağlar.</p><pre>@Scheduled(fixedRate = 5000)<br>public void scheduledTask() {<br>    // 5 saniyede bir çalışacak kod<br>}</pre><h3>@RestController</h3><p>@RestController anotasyonu, sınıfın RESTful web servislerde controller olarak kullanılmasını sağlar. @Controller ve @ResponseBody anotasyonlarının birleşimidir.</p><pre>@RestController<br>public class MyRestController {<br>    // ...<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90b74cbfce70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JAVA EE API’s]]></title>
            <link>https://medium.com/@orhany/java-ee-apis-5e87dae39f4d?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e87dae39f4d</guid>
            <category><![CDATA[java-ee]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Thu, 30 May 2024 11:57:01 GMT</pubDate>
            <atom:updated>2024-05-30T11:57:01.535Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Java EE (Java Platform, Enterprise Edition) API’leri, geniş bir yelpazede kurumsal uygulama geliştirme için kullanılan çeşitli spesifikasyonları ve kütüphaneleri içerir. İşte Java EE’nin başlıca API’leri ve spesifikasyonları:</blockquote><ol><li><strong>EJB (Enterprise Java Beans):</strong></li></ol><ul><li>Kurumsal bileşenler oluşturmak için kullanılır. İş mantığı ve iş süreçlerinin yönetimini sağlar.</li></ul><p>2. <strong>JPA (Java Persistence API):</strong></p><ul><li>Java nesnelerinin ilişkisel veritabanlarına kalıcı olarak kaydedilmesini sağlar. ORM (Object-Relational Mapping) için standart bir API’dir.</li></ul><p>3.<strong> JMS (Java Message Service):</strong></p><ul><li>Mesaj tabanlı iletişim için kullanılan bir API’ dir. Uygulamalar arasında asenkron mesajlaşmayı sağlar.</li></ul><p>4.<strong> JTA (Java Transaction API):</strong></p><ul><li>Dağıtılmış işlemleri yönetmek için kullanılan bir API’ dir. İşlemlerin tutarlılığını ve bütünlüğünü sağlar.</li></ul><p>5. <strong>JAX-RS (Java API for RESTful Web Services):</strong></p><ul><li>RESTful web servisleri oluşturmak için kullanılır. Java tabanlı bir API’ dir.</li></ul><p>6. <strong>JAX-WS (Java API for XML Web Services):</strong></p><ul><li>SOAP tabanlı web servisleri oluşturmak için kullanılır. XML mesajlaşmasını destekler.</li></ul><p>7.<strong> Servlet API:</strong></p><ul><li>Sunucu tarafında çalışan Java bileşenleri oluşturmak için kullanılır. HTTP isteklerini işleyebilir.</li></ul><p>8. <strong>JSP (JavaServer Pages):</strong></p><ul><li>Dinamik web sayfaları oluşturmak için kullanılır. HTML içine gömülü Java kodu çalıştırılabilir.</li></ul><p>9.<strong> JSF (JavaServer Faces):</strong></p><ul><li>Kullanıcı arayüzü bileşenleri oluşturmak için kullanılan bir çerçevedir. MVC (Model-View-Controller) desenini destekler.</li></ul><p>10. <strong>CDI (Contexts and Dependency Injection):</strong></p><ul><li>Bağımlılık enjeksiyonu ve bağlam yönetimi sağlar. Uygulama bileşenlerinin yaşam döngüsünü ve etkileşimini yönetir.</li></ul><p>11. <strong>JCA (Java Connector Architecture):</strong></p><ul><li>Kurumsal bilgi sistemlerine erişim sağlamak için kullanılan bir API’dir. Kaynak adaptörleriyle bağlantı kurar.</li></ul><p>12. <strong>Java Mail:</strong></p><ul><li>E-posta gönderme ve alma işlemleri için kullanılır. SMTP, IMAP ve POP3 protokollerini destekler.</li></ul><p>13. <strong>Java EE Security API:</strong></p><ul><li>Kimlik doğrulama ve yetkilendirme için güvenlik mekanizmaları sağlar. Kullanıcı yönetimi ve güvenlik rollerini içerir.</li></ul><p>14. <strong>Bean Validation:</strong></p><ul><li>Java Bean’ ler üzerinde doğrulama kısıtlamaları tanımlamak için kullanılır. Veri doğrulama mekanizmaları sağlar.</li></ul><p>15.<strong> Batch Applications for the Java Platform:</strong></p><ul><li>Toplu iş uygulamaları oluşturmak için standart bir API sağlar. Büyük veri işleme işlemleri için kullanılır.</li></ul><p>Bu API ’ler, Java EE platformunun sunduğu zengin özellikleri ve fonksiyonları temsil eder. Her biri, kurumsal uygulama geliştirme sürecinin farklı bir yönünü ele alır ve geliştiricilere geniş bir araç seti sunar. Bu API’ler, Java EE’nin esnek, ölçeklenebilir ve güvenli kurumsal uygulamalar geliştirmek için neden popüler bir platform olduğunu göstermektedir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e87dae39f4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java2EE ve Java EE]]></title>
            <link>https://medium.com/@orhany/java2ee-ve-java-ee-5369073ad34e?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/5369073ad34e</guid>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Thu, 30 May 2024 11:30:47 GMT</pubDate>
            <atom:updated>2024-05-30T11:30:47.978Z</atom:updated>
            <content:encoded><![CDATA[<p>Java EE (Java Platform, Enterprise Edition) ve J2EE (Java 2 Platform, Enterprise Edition) terimleri, Java’nın kurumsal uygulamalar geliştirmek için kullanılan sürümlerini ifade eder. Ancak, bu iki terim arasında bazı temel farklar vardır:</p><ol><li><strong>Adlandırma ve Versiyonlama:</strong></li></ol><ul><li>J2EE (Java 2 Platform, Enterprise Edition): Java’nın kurumsal sürümünün ilk adıdır. “Java 2” adlandırması, Java platformunun ikinci büyük sürümünü ifade eder ve J2EE, bu sürümün kurumsal bileşenlerini kapsar. J2EE, Java 2&#39;nin bir uzantısı olarak ilk kez 1999&#39;da tanıtıldı.</li><li>Java EE (Java Platform, Enterprise Edition): 2006 yılında, Java platformunun 5. sürümünden itibaren, Sun Microsystems “Java 2” adını bırakmaya karar verdi ve J2EE, Java EE olarak yeniden adlandırıldı. Bu yeniden adlandırma, platformun gelişimini ve sürekli evrimini yansıtmak için yapıldı.</li></ul><p><strong>2. Gelişmiş Özellikler ve API’ler:</strong></p><ul><li>J2EE, başlangıçta EJB (Enterprise JavaBeans), JSP (JavaServer Pages), ve Servletler gibi temel API’leri içeriyordu. O dönemdeki teknolojiler daha temel ve bazı yönleriyle daha sınırlıydı.</li><li>Java EE, daha gelişmiş özellikler ve genişletilmiş API’ler içerir. Zaman içinde platforma yeni teknolojiler eklenmiş, mevcut teknolojiler geliştirilmiş ve standartlar güncellenmiştir. Örneğin, Java EE 5 ile birlikte EJB 3.0, JPA (Java Persistence API) gibi daha modern ve kullanımı kolay API’ler tanıtılmıştır.</li></ul><p><strong>3. Topluluk ve Yönetişim:</strong></p><ul><li>J2EE, Sun Microsystems tarafından yönetiliyordu ve geliştirilmesi büyük ölçüde bu şirketin kontrolündeydi.</li><li>Java EE, Oracle’ın Sun Microsystems’ı satın almasıyla Oracle tarafından yönetilmeye başlandı. Daha sonra, 2017 yılında Oracle, Java EE’yi Eclipse Foundation’a devretti ve platformun adı Jakarta EE olarak değiştirildi. Bu değişiklik, topluluk odaklı bir gelişim sürecini teşvik etti.</li></ul><p>Özetle, J2EE ve Java EE, aynı kurumsal Java platformunun farklı dönemlerini ve evrimini ifade eder. J2EE, Java’nın kurumsal sürümünün ilk adı ve erken dönem sürümlerini kapsarken, Java EE, daha gelişmiş özellikler ve güncellemelerle birlikte platformun daha modern sürümlerini ifade eder. Günümüzde, bu platform Jakarta EE adı altında gelişimini sürdürmektedir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5369073ad34e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Software Arhitectural Patterns]]></title>
            <link>https://medium.com/@orhany/software-arhitectural-patterns-3d12a62f2b47?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d12a62f2b47</guid>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Wed, 29 May 2024 12:15:03 GMT</pubDate>
            <atom:updated>2024-05-29T12:15:03.885Z</atom:updated>
            <content:encoded><![CDATA[<p>𝐖𝐡𝐚𝐭 𝐚𝐫𝐞 𝐀𝐫𝐜𝐡𝐢𝐭𝐞𝐜𝐭𝐮𝐫𝐚𝐥 𝐏𝐚𝐭𝐭𝐞𝐫𝐧𝐬?<br>Architectural patterns are standard strategies that define structural organization for software systems, providing a template for the architecture’s design and module interactions.</p><p>Here are famous architectural patterns:</p><p>➡ 𝐄𝐯𝐞𝐧𝐭-𝐃𝐫𝐢𝐯𝐞𝐧: An event-driven architecture is a framework that orchestrates behavior around the production, detection, and consumption of events.<br>Example use case: A real-time analytics system where events are generated by user activities and processed immediately.</p><p>➡ 𝐋𝐚𝐲𝐞𝐫𝐞𝐝: A layered architecture is a hierarchical pattern for structuring a system into groups of related functionalities, each layer having a specific role.<br>Example use case: A web application with a presentation layer, business logic layer, and data access layer.</p><p>➡ 𝐌𝐨𝐧𝐨𝐥𝐢𝐭𝐡: A monolithic architecture is a traditional unified model for the design of a software program where all components are interwoven and interdependent.<br>Example use case: A small-scale e-commerce website where the user interface, server-side application, and database are all on a single platform.</p><p>➡ 𝐌𝐢𝐜𝐫𝐨𝐬𝐞𝐫𝐯𝐢𝐜𝐞: Microservices architecture is an approach where a single application is composed of many loosely coupled and independently deployable smaller services.<br>Example use case: A large-scale cloud-based application like Netflix, where each service runs a unique process and communicates through a well-defined, lightweight mechanism to serve a business goal.</p><p>➡ 𝐏𝐢𝐩𝐞-𝐅𝐢𝐥𝐭𝐞𝐫: In pipe-filter architecture data passes through a sequence of components (filters) each designed to process the data in some way. The movement of data through the filters is handled by connectors (pipes) that do not change the data but pass it from one filter to another.</p><p>➡ 𝐏𝐞𝐞𝐫-𝐭𝐨-𝐏𝐞𝐞𝐫: P2P architecture is a decentralized network architecture where each node, or “peer,” acts as both a client and a server. Peers are equally privileged and can initiate or complete tasks such as data sharing or communication directly with each other without relying on a central server.</p><p>➡ 𝐌𝐕𝐂 (𝐌𝐨𝐝𝐞𝐥-𝐕𝐢𝐞𝐰-𝐂𝐨𝐧𝐭𝐫𝐨𝐥𝐥𝐞𝐫): MVC separates an application into three interconnected components: the model, the view, and the controller.<br>Example use case: A desktop GUI application where user interface data (view), data manipulation (model), and input control (controller) are separated to simplify maintenance and scalability.</p><p>➡ 𝐏𝐫𝐢𝐦𝐚𝐫𝐲-𝐑𝐞𝐩𝐥𝐢𝐜𝐚 (or Primary-Secondary): The primary-replica pattern is a model where one primary component controls one or more subordinate instances, called replicas.<br>Example use case: A database replication system where the primary database manages writes and the replica databases handle read operations to distribute the load.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*s4OozCazB6CYGGrPDMbICg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d12a62f2b47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CAP Teoremi]]></title>
            <link>https://medium.com/@orhany/cap-teoremi-22df5846499f?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/22df5846499f</guid>
            <category><![CDATA[cap-teoremi]]></category>
            <category><![CDATA[cap]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 19:42:24 GMT</pubDate>
            <atom:updated>2024-03-20T19:42:24.375Z</atom:updated>
            <content:encoded><![CDATA[<p>Dağıtık sistemlerin tasarımı ve yönetimi, modern bilgi teknolojilerinin en önemli yönlerinden biridir. Bu sistemler, verileri birden fazla bilgisayar arasında dağıtarak iş yükünü paylaşır ve böylece yüksek kullanılabilirlik, ölçeklenebilirlik ve güvenilirlik sağlar. Ancak, dağıtık sistemlerin tasarımında karşılaşılan temel zorluklardan biri, CAP teoremi olarak bilinen bir kavramla özetlenir. 2000 yılında Eric Brewer tarafından ortaya atılan CAP teoremi, dağıtık sistemlerin üç temel özelliği arasındaki temel bir dengeyi açıklar: Tutarlılık (Consistency), Kullanılabilirlik (Availability) ve Bölünme Toleransı (Partition Tolerance). CAP teoremi, bu üç özelliğin aynı anda tam olarak sağlanamayacağını belirtir, yani bir dağıtık sistem en fazla bu özelliklerin ikisini aynı anda optimize edebilir.</p><h3>CAP Teoreminin Üç Temel Öğesi</h3><ol><li><strong>Tutarlılık (Consistency): </strong>Tutarlılık, bir dağıtık sistemin tüm düğümleri arasında bir veri değişikliği yapıldığında, değişiklikten hemen sonra yapılan tüm sorgulamalarda değişikliğin görünür olması gerektiğini ifade eder. Yani, herhangi bir kullanıcı sistemin herhangi bir noktasından veriye eriştiğinde, aynı anda yapılan tüm güncellemelerden haberdar olmalıdır.</li><li><strong>Kullanılabilirlik (Availability):</strong> Kullanılabilirlik, her türlü arıza durumunda bile sistemdeki her istek için bir yanıtın (hata mesajı dahi olsa) geri döndürülmesi gerektiğini belirtir. Kullanılabilirlik, sistemin her zaman çalışır durumda olmasını ve kullanıcı isteklerine hizmet vermeye devam etmesini ifade eder.</li><li><strong>Bölünme Toleransı (Partition Tolerance): </strong>Bölünme toleransı, sistemdeki iletişim hatlarından herhangi birinin kesilmesi durumunda bile sistemin çalışmaya devam edebilmesini ifade eder. Bir dağıtık sistemde ağ bölünmeleri kaçınılmazdır, dolayısıyla bir sistem bölünme toleransı sağlamıyorsa, bu ağ kesintileri sırasında kullanılabilirliğini veya tutarlılığını kaybeder.</li></ol><h3>CAP Teoreminin Uygulamadaki Etkileri</h3><p>CAP teoremi, sistem tasarımcılarının dağıtık sistemlerin hedeflerini ve önceliklerini belirlerken karşılaştığı temel bir kısıtlamayı ortaya koyar. Örneğin, bir finansal işlem sistemi gibi yüksek tutarlılık gerektiren bir uygulama için, sistem tasarımcıları bölünme toleransından ödün verebilirken, bir sosyal medya uygulaması gibi yüksek kullanılabilirlik gerektiren bir durumda tutarlılıktan ödün verilebilir.</p><p>CAP teoremi, dağıtık sistemlerin tasarımında mükemmel bir çözümün olmadığını; ancak sistemin gereksinimlerine bağlı olarak optimal denge noktalarının bulunabileceğini gösterir. Bu denge, sistemin gerçek dünya senaryolarında nasıl performans göstereceğini ve kullanıcılar için hangi deneyimi sunacağını belirler. Dolayısıyla, CAP teoremi, dağıtık sistemlerin anlaşılması ve tasarlanması için temel bir rehber olarak hizmet eder.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22df5846499f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Isolation Level]]></title>
            <link>https://medium.com/@orhany/isolation-level-562a94f78b60?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/562a94f78b60</guid>
            <category><![CDATA[isolation]]></category>
            <category><![CDATA[isolation-level]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Wed, 20 Mar 2024 19:37:41 GMT</pubDate>
            <atom:updated>2024-03-20T20:05:51.940Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Veritabanlarında izolasyon seviyesi (isolation level), aynı anda gerçekleşen birden fazla işlem arasındaki etkileşimin ne derecede izole edildiğini tanımlar. İzolasyon seviyeleri, veri tutarlılığını ve bütünlüğünü korumak için çeşitli kilit mekanizmaları ve işlem kontrolleri kullanır. Farklı izolasyon seviyeleri, işlemler arasındaki potansiyel çakışma ve kaynak kullanımı dengesini farklı şekillerde yönetir. Bu seviyeler, genellikle daha yüksek izolasyon seviyelerinin performans üzerinde daha fazla maliyeti olduğu bir performans-tutarlılık dengesi sunar.</strong></blockquote><h3>İzolasyon Seviyeleri :</h3><ol><li><strong>Read Uncommitted (Okunmamış Veriyi Okuma): </strong>Bu seviye, bir işlemin henüz tamamlanmamış ve onaylanmamış (commit edilmemiş) değişiklikleri okumasına izin verir. Bu, “kirli okuma” (dirty read) olarak bilinen bir duruma yol açabilir; yani, bir işlem başka bir işlem tarafından henüz tamamlanmamış bir veriyi okuyabilir ve sonra o veri geri alınabilir (rollback).</li><li><strong>Read Committed (Okunmuş Veriyi Okuma)</strong>: Bu seviye, bir işlemin yalnızca onaylanmış değişiklikleri okumasına izin verir. Bu, “kirli okumaları” önler, ancak “non-repeatable read” (tekrarlanamayan okuma) sorununa açık olabilir; yani, bir işlem aynı veriyi iki kez okuduğunda, arada başka bir işlem tarafından değiştirilmiş olabilir.</li><li><strong>Repeatable Read (Tekrarlanabilir Okuma): </strong>Bu seviye, bir işlemin veri seti üzerinde bir okuma yaparken, o veri üzerindeki tüm okumaların aynı sonucu vermesini garanti eder, bu da “non-repeatable read” sorununu önler. Ancak, bu izolasyon seviyesi, “phantom read” (hayalet okuma) sorununa açık olabilir; yani, bir işlem aynı sorguyu iki kez çalıştırdığında, arada başka bir işlem tarafından eklenmiş yeni kayıtlar görünebilir.</li><li><strong>Serializable (Serileştirilebilir): </strong>Bu, en yüksek izolasyon seviyesidir ve bir işlemin veritabanındaki değişiklikleri sanki sırayla (seri bir şekilde) yapılıyormuş gibi izole edilmesini sağlar. Bu seviye, “phantom reads” dahil olmak üzere yukarıda bahsedilen tüm okuma sorunlarını önler. Ancak, bu seviye genellikle en düşük performansa sahiptir çünkü çok sıkı kilit mekanizmaları kullanır.</li></ol><p>Java Spring’de izolasyon seviyesini ayarlamak, genellikle veritabanı işlemleri sırasında veri tutarlılığını ve izolasyonunu yönetmek için kullanılır. Spring Framework, @Transactional anotasyonu ile birlikte izolasyon seviyesi ayarlamayı oldukça kolaylaştırır. @Transactional anotasyonu, bir metodun veya sınıfın işlemlerinin nasıl yönetileceğini belirlemenize olanak tanır, bu da izolasyon seviyesi dahil olmak üzere çeşitli işlem özelliklerini ayarlamanıza imkan verir.</p><p>İzolasyon seviyesi, bir işlem sırasında yapılan değişikliklerin diğer işlemler tarafından ne zaman görülebileceğini tanımlar. Bu, özellikle birden çok işlem aynı veri üzerinde çalıştığında önemlidir ve veri tutarsızlıklarını önlemeye yardımcı olur.</p><p>Spring’de bir işlem için izolasyon seviyesi ayarlamanın en yaygın yolu, @Transactional anotasyonunun isolation özelliğini kullanmaktır. Aşağıda çeşitli izolasyon seviyelerini nasıl ayarlayabileceğinizi gösteren bir örnek bulunmaktadır:</p><pre>import org.springframework.stereotype.Service;<br>import org.springframework.transaction.annotation.Transactional;<br>import org.springframework.transaction.annotation.Isolation;<br><br>@Service<br>public class MyService {<br><br>    @Transactional(isolation = Isolation.DEFAULT)<br>    public void defaultIsolationLevelExample() {<br>        // Bu metod, varsayılan izolasyon seviyesi ile işlemler gerçekleştirir.<br>    }<br><br>    @Transactional(isolation = Isolation.READ_UNCOMMITTED)<br>    public void readUncommittedExample() {<br>        // Bu metod, READ_UNCOMMITTED izolasyon seviyesi ile işlemler gerçekleştirir.<br>    }<br><br>    @Transactional(isolation = Isolation.READ_COMMITTED)<br>    public void readCommittedExample() {<br>        // Bu metod, READ_COMMITTED izolasyon seviyesi ile işlemler gerçekleştirir.<br>    }<br><br>    @Transactional(isolation = Isolation.REPEATABLE_READ)<br>    public void repeatableReadExample() {<br>        // Bu metod, REPEATABLE_READ izolasyon seviyesi ile işlemler gerçekleştirir.<br>    }<br><br>    @Transactional(isolation = Isolation.SERIALIZABLE)<br>    public void serializableExample() {<br>        // Bu metod, SERIALIZABLE izolasyon seviyesi ile işlemler gerçekleştirir.<br>    }<br>}</pre><ul><li>DEFAULT: Platformun varsayılan izolasyon seviyesini kullanır.</li><li>READ_UNCOMMITTED: Diğer işlemler tarafından henüz onaylanmamış değişikliklerin bu işlem tarafından görülebileceği en düşük izolasyon seviyesidir.</li><li>READ_COMMITTED: Bir işlem, yalnızca diğer işlemler tarafından onaylanmış değişiklikleri görebilir. Bu, READ_UNCOMMITTED&#39;in sunduğu birçok sorunu önler.</li><li>REPEATABLE_READ: Bir işlem, başka işlemler tarafından yapılan değişiklikleri, o işlem başladıktan sonra görmeyecektir, ancak araya giren ekleme veya silme işlemlerinden etkilenebilir.</li><li>SERIALIZABLE: En yüksek izolasyon seviyesidir ve işlemlerin sırayla gerçekleştiği gibi davranılmasını sağlar, böylece en güvenli ama aynı zamanda en yavaş işlem performansını sunar.</li></ul><p>Farklı veritabanı yönetim sistemleri (DBMS), bu izolasyon seviyelerini farklı şekillerde uygulayabilir ve bazı durumlarda ek izolasyon seviyeleri sunabilir. İzolasyon seviyesinin seçimi, uygulamanın gereksinimlerine ve veritabanı performansına bağlıdır. Yüksek izolasyon seviyeleri daha fazla tutarlılık sağlarken, genellikle performansı düşürebilir ve kaynak kilitlenmesine yol açabilir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=562a94f78b60" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redis Notes]]></title>
            <link>https://medium.com/@orhany/redis-notes-b8cca536c803?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8cca536c803</guid>
            <category><![CDATA[redis]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Sun, 17 Sep 2023 09:51:20 GMT</pubDate>
            <atom:updated>2023-09-17T09:51:20.924Z</atom:updated>
            <content:encoded><![CDATA[<p>Redis is the abbreviation of <strong>Re</strong>mote Dictionary <strong>S</strong>ervices and part of the solution architectures as serves In-Memory cache so that reason is quite fast. Redis data structure built on key, value store. Surely limited by RAM. The key is a string and the value can be ;</p><ul><li>String</li><li>List</li><li>Set</li><li>Hash</li></ul><p>The Redis supports 100 K+ requests per second on a single node. Since the all the data stored in memory, Redis has extremely high throughput compared to relational database. Redis doesn’t support the JSON format by default and it’s data structure can contain only strings. If you set same key twice it overrides the previous value. Redis key also supports TTL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*fSAEO0Fx-MAvOi9N_xpXYA.png" /></figure><p>Redis stores data to disk, but can loose recent data.</p><p><strong>Redis Use Cases:</strong></p><p><strong>Caching</strong>:</p><ul><li>Redis is often used as a caching layer to store frequently accessed data in memory. This helps reduce the load on primary data sources (such as databases or APIs) and provides low-latency access to cached data.</li></ul><p><strong>Session Store:</strong></p><ul><li>Redis can be used to store user sessions in web applications. Because of its fast read and write operations, it ensures that user session data is readily available and can be easily shared across multiple application instances in a distributed environment.</li></ul><p><strong>Real-Time Analytics:</strong></p><ul><li>Redis is suitable for real-time analytics and counting. It can increment counters, track user activity, and calculate metrics in real-time, making it valuable for tracking user engagement, monitoring application performance, and generating real-time dashboards.</li></ul><p><strong>Pub/Sub Messaging:</strong></p><ul><li>Redis supports publish/subscribe (pub/sub) messaging patterns. It can be used to build real-time chat applications, push notifications, and event-driven systems where publishers send messages to channels, and subscribers receive messages from those channels.</li></ul><p><strong>Job Queues:</strong></p><ul><li>Redis can function as a distributed task queue. It is used to manage background jobs, such as processing image uploads, sending emails, or performing periodic tasks. Popular libraries like Resque and Celery use Redis for this purpose.</li></ul><p><strong>Leaderboards and Rankings:</strong></p><ul><li>Redis’s sorted sets data structure allows you to maintain leaderboards and rankings efficiently. It can be used to keep track of scores, ranks, and user standings in games, competitions, or any system where rankings matter.</li></ul><p><strong>Geospatial Indexing:</strong></p><ul><li>Redis provides geospatial data structures and commands for storing and querying location-based data. It’s used in location-based services, geofencing, and spatial analytics to store and query data related to geographic coordinates.</li></ul><p><strong>Rate Limiting and Throttling:</strong></p><ul><li>Redis can enforce rate limits and throttling for APIs and services. By tracking request rates and timestamps, it can prevent abuse or overload of resources and ensure fair access.</li></ul><p><strong>Distributed Locking:</strong></p><ul><li>Redis can be used to implement distributed locking mechanisms, ensuring that only one process or thread can access a critical section of code or a shared resource at a time.</li></ul><p><strong>Session Queues and Chat Systems:</strong></p><ul><li>Redis can power real-time chat systems, chat rooms, and message queues. Its publish/subscribe capabilities make it suitable for building interactive messaging applications.</li></ul><p><strong>Caching of Expensive Queries:</strong></p><ul><li>In addition to caching individual data items, Redis can cache the results of expensive database queries, API calls, or computations, reducing the load on backend systems.</li></ul><p><strong>Machine Learning and AI Model Caching:</strong></p><ul><li>Redis can be used to cache machine learning model predictions and AI inference results, enabling faster and more responsive AI-driven applications.</li></ul><p><strong>Temporal Data and Time Series:</strong></p><ul><li>Redis can be used to store and analyze temporal data and time series, making it useful for monitoring, IoT applications, and tracking historical data over time.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8cca536c803" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Messaging Models]]></title>
            <link>https://medium.com/@orhany/messaging-models-cb3088468531?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb3088468531</guid>
            <category><![CDATA[messaging]]></category>
            <category><![CDATA[messaging-system]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Sat, 16 Sep 2023 20:19:38 GMT</pubDate>
            <atom:updated>2023-09-16T20:19:38.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Messaging models are fundamental communication patterns used in distributed systems to facilitate the exchange of data and messages between various components, services, or processes. These models define how messages are sent, received, and processed within a system. Here are some common messaging models:</p><ol><li><strong>Point-to-Point (P2P) Messaging:</strong></li></ol><ul><li>Description: In the point-to-point messaging model, a message is sent from one sender (producer) to one receiver (consumer). Each message has a single intended recipient.</li><li>Use Cases: It is suitable for scenarios where one-to-one communication is required, such as task queues or workload distribution.</li></ul><p>2. <strong>Publish-Subscribe Messaging:</strong></p><ul><li>Description: In the publish-subscribe messaging model, messages are published to one or more topics (or channels), and multiple subscribers can receive messages from those topics. Subscribers express interest in specific topics, and they receive messages published to those topics.</li><li>Use Cases: It is commonly used for building event-driven systems, where multiple components need to react to specific events or data changes.</li></ul><p>3. <strong>Message Queues:</strong></p><ul><li>Description: Message queues provide a way to buffer and manage messages between producers and consumers. Messages are placed in a queue by producers and then consumed by one or more consumers, often in a first-come, first-served manner.</li><li>Use Cases: Message queues are crucial for building scalable and resilient systems, as they allow for load balancing, fault tolerance, and asynchronous processing.</li></ul><p>4. <strong>Message Brokers:</strong></p><ul><li>Description: Message brokers act as intermediaries between producers and consumers of messages. They facilitate message routing, transformation, and delivery. Message brokers often support various messaging models, including publish-subscribe and message queues.</li><li>Use Cases: Message brokers like Apache Kafka, RabbitMQ, and Amazon SQS are used in various scenarios, such as real-time data streaming, event processing, and task distribution.</li></ul><p>5. <strong>Request-Reply Messaging:</strong></p><ul><li>Description: In the request-reply messaging model, one component sends a request message to another component and expects a specific response. It is commonly used for synchronous communication and remote procedure calls (RPC).</li><li>Use Cases: Request-reply messaging is suitable when immediate responses are required, such as in client-server interactions.</li></ul><p>6. <strong>Message Formats:</strong></p><ul><li>Description: The messaging model also involves defining the structure and format of messages, including data serialization formats like JSON, XML, or protocol buffers. Consistent message formats ensure interoperability between components.</li><li>Use Cases: Message formats are essential for ensuring that messages are correctly interpreted and processed by sender and receiver components.</li></ul><p>7. <strong>Guarantees and Reliability:</strong></p><ul><li>Description: Messaging models may specify the level of guarantees and reliability of message delivery, such as at-most-once, at-least-once, or exactly-once delivery semantics.</li><li>Use Cases: Guarantee levels are chosen based on the system’s requirements for message durability and reliability.</li></ul><p>8. <strong>Error Handling:</strong></p><ul><li>Description: Messaging models often include mechanisms for handling errors and failures in message processing, such as retries, dead-letter queues, and error notifications.</li><li>Use Cases: Error handling ensures that messages are processed correctly and that failures are appropriately managed.</li></ul><p>9. <strong>Message Routing:</strong></p><ul><li>Description: Message routing determines how messages are directed to the appropriate destination, considering topics, queues, routing keys, and filtering criteria.</li><li>Use Cases: Proper message routing ensures that messages reach the intended recipients or consumers.</li></ul><p>Choosing the right messaging model for a system depends on its specific requirements, such as scalability, reliability, latency, and decoupling of components. Different messaging models offer distinct advantages and trade-offs, and architects must consider these factors when designing a distributed system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb3088468531" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Queue]]></title>
            <link>https://medium.com/@orhany/queue-b75aa6a89b0f?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/b75aa6a89b0f</guid>
            <category><![CDATA[queue-management]]></category>
            <category><![CDATA[queue]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Sat, 16 Sep 2023 20:01:01 GMT</pubDate>
            <atom:updated>2023-09-16T20:01:01.230Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is a message queue?</strong></p><p>Message queue is a form of asynchronous service-to-service communication used in serverless and microservices architectures.</p><p>Message queues to process orders and are a way of decoupling different parts of systems.</p><p>Similar to database, the queue is a sophisticated piece of software that runs on dedicated hardware.</p><p><strong>Why we should use a message queue?</strong></p><ul><li>Asynchronous communication</li><li>Prevent transaction loosing</li><li>Decoupling microservices.</li></ul><p>Let&#39;s say we have a pizza store and decide to sell online pizza for customers. To do this two microservices were designed pizza and payment services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Asrjm-HyajbmDshDmVN-6A.png" /><figcaption>Syncron Communication</figcaption></figure><p>So, what happens if our payment service receives too many requests and crashes? Pizza service will also get stuck waiting for payment service to recover.</p><p>The solution is a queue mechanism. Let&#39;s design a queue mechanism to prevent message stuck and transactions losing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*5crLEks1WROH8r1vuaZ-xg.png" /><figcaption>Asyncron Communication</figcaption></figure><p>And that wat we decouple our fast pizza service from a slow payment service and can process much more orders now!</p><p>When a service connects to a queue, it must choose one of two roles. Either can be a producer or a consumer. If consumer crashes, unprocessed message are usually not lost, because they are stored in the queue.</p><p><strong>Summary</strong></p><p>Pros:</p><ul><li>Buffering</li><li>Request spikes smoothing</li><li>Message durability</li></ul><p>Cons:</p><ul><li>Increase system complexity</li><li>Increase latency</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b75aa6a89b0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uneven distribution of data in a Sharded database.]]></title>
            <link>https://medium.com/@orhany/uneven-distribution-of-data-in-a-sharded-databases-d0af8f27bc15?source=rss-30581c8f5935------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0af8f27bc15</guid>
            <category><![CDATA[nostalgia]]></category>
            <category><![CDATA[sharding]]></category>
            <category><![CDATA[database-administration]]></category>
            <dc:creator><![CDATA[Orhan Yılmaz]]></dc:creator>
            <pubDate>Wed, 13 Sep 2023 08:38:56 GMT</pubDate>
            <atom:updated>2023-09-13T08:39:23.312Z</atom:updated>
            <content:encoded><![CDATA[<p>Uneven distribution of data in a sharded database can lead to performance issues and can be challenging to manage. Here are some solutions to address uneven distribution in a sharded database: <a href="https://www.linkedin.com/feed/hashtag/?keywords=sharding&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7103677345944731649">#sharding</a></p><h3>Struggling with Uneven Data Distrubition</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NOCDXB6jwi54uSWKtclu9w.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0af8f27bc15" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>