<?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 Esma Özel on Medium]]></title>
        <description><![CDATA[Stories by Esma Özel on Medium]]></description>
        <link>https://medium.com/@esmaozel?source=rss-d3ef47134b00------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RY_vHqGpPb55EkAqlwpCFA.jpeg</url>
            <title>Stories by Esma Özel on Medium</title>
            <link>https://medium.com/@esmaozel?source=rss-d3ef47134b00------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 08:58:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@esmaozel/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[WHAT IS MONGODB?]]></title>
            <link>https://medium.com/@esmaozel/what-is-mongodb-7233edcbca7b?source=rss-d3ef47134b00------2</link>
            <guid isPermaLink="false">https://medium.com/p/7233edcbca7b</guid>
            <category><![CDATA[crud]]></category>
            <category><![CDATA[mongo]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[Esma Özel]]></dc:creator>
            <pubDate>Thu, 02 May 2024 12:10:12 GMT</pubDate>
            <atom:updated>2024-05-02T12:10:12.793Z</atom:updated>
            <content:encoded><![CDATA[<p>MongoDb is an open source NoSQL database. MongoDb stores data in json format as a document. Unlike relational databases, it uses collection instead of table, document instead of row and field instead of column structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*de6JtaXav3vN5nNMf91jyw.png" /></figure><p>MongoDb is often used by developers when they want high performance from large volume projects. It is advantageous to use MongoDb in situations where relational databases are difficult to solve. Examples of the advantages of Mongodb can be given below:</p><ul><li>Integrating large amounts of diverse data</li><li>Identify evolving complex database structures</li><li>Query high performance data</li><li>Supporting multi-cloud and hybrid applications</li><li>Collaborative structure that supports rapid development</li></ul><p><strong>WHAT ARE THE FEATURES OF MONGODB?</strong></p><ul><li>Each database contains collections of documents. The content, number and size of each document may be different.</li><li>Document structure varies depending on the structural features of a programming language.</li><li>There is no need for a pre-built schema for documents.</li><li>MongoDb has a scalable structure.</li><li>Queries can be easily created because they are JSON.</li><li>No matter how complex a document is, there is a query language that allows us to filter easily.</li><li>It provides support for modern uses such as graphics and text search.</li></ul><p><strong>WHAT ARE THE SHELL COMMANDS USED IN MONGODB?</strong></p><ul><li><strong>db </strong>: We use it to display the databases in use.</li></ul><pre>db()</pre><ul><li><strong>use</strong> : to create a new database or to use an existing database.</li></ul><pre>use &lt;database&gt;</pre><ul><li><strong>createCollection</strong> : We use it to create a collection. First we switch to the database we want to use with use. We create a new collection by giving the name of the collection to that database.</li></ul><pre>use &lt;database&gt;<br>db.createCollection(“collection_name”)</pre><ul><li><strong>dropDatabase()</strong>: Used to delete the registered database. We enter the database we want to delete and then delete it.</li></ul><pre>use &lt;database&gt;<br>db.dropDatabase()</pre><ul><li><strong>drop():</strong> We use it to delete the existing collection in the database.</li></ul><pre>b.collection_name.drop()  </pre><ul><li><strong>show</strong>: We use it to list databases and collections.</li></ul><pre>show databases<br>show collections</pre><p><strong>ADD DATA IN MONGODB</strong></p><p><strong>db.collection.insert() </strong>: We use it to insert data into the collection.</p><pre>db.collectionName.insert(<br>  { id: 1,<br>    name: “Esma”,<br>    surname: “Özel”,<br>    age: 27<br>  }<br> )</pre><p><strong>db.collection.insertOne()</strong>: Used to insert a single data into the collection.</p><pre>db.collectionName.insertOne(<br>  { id: 1,<br>    name: “Esma”,<br>    surname: “Özel”,<br>    age: 27<br>  }<br> )</pre><p><strong>db.collection.insertMany()</strong>: We use it to insert more than one data into the collection.</p><pre>db.collection.insertMany([<br>  { name: &quot;John&quot;, age: 30 },<br>  { name: &quot;Jane&quot;, age: 25 },<br>  { name: &quot;Doe&quot;, age: 40 }<br>]);</pre><p><strong>QUERY OPERATIONS</strong></p><p><strong>db.collection.find() </strong>: Used to retrieve the desired data in the collection. If no condition is given, it pulls all data.</p><pre> db.CollectionName.find({}) // Retrieves all data<br> db.collectionName.find({&quot;age&quot;:22}) // lists those with age 22.</pre><p><strong>in[] </strong>: Used to retrieve matching data from the values of the specified field.<br>For example, we use it when we want to retrieve cities with the letters ‘a’ and ‘e’ in them.</p><pre>db.collectionName.find(“city”:{“name”: {$in: [“A”,”E”]}})</pre><p>We can obtain the following data as output:</p><pre>{“id” : 1, “city”:”Elazığ”}<br>{“id” : 2, “city”:”Gaziantep”}</pre><p><strong>and</strong>: We use it in queries that require us to use more than one condition. For example, we can use it when we want to list the female employees working in x company whose age is older than 30.</p><pre>db.employees.find({<br>  $and: [<br>    { company: &quot;x&quot; },<br>    { age: { $gt: 30 } },<br>    { gender: &quot;female&quot; }<br>  ]<br>})</pre><p><strong>Or:</strong> We use it when only one of two or more conditions needs to be met. For example, we want to list employees in company x or employees in company y:</p><pre>db.employees.find({<br>  $or: [<br>    { &quot;companyName&quot;: &quot;x&quot; },<br>    { &quot;companyName&quot;: &quot;y&quot; }<br>  ]<br>})</pre><p><strong>$lt:</strong> {less than} operator is used to select values that are less than a certain value. For example, we can use this operator when we want to list books that cost less than 50 liras in a bookstore.</p><pre>db.books.find({price:{ $lt : 50}})</pre><p><strong>$gt:</strong> {greater than} is the opposite of the lt operator. For example, if we want to find books in a bookstore that cost more than $50.</p><pre>db.books.find({price:{ $gt : 50}})</pre><p>We can use lt and gt operators in the same query. For example, we can find the books in the bookstore that cost more than 50 tl and less than 100 tl.</p><pre>db.books.find({price:{$gt:50,$lt:100}})</pre><p><strong>Data Update Operations</strong></p><p><strong>db.collectionName.update():</strong> We use it to update the data in the collection. For example, we can use it when we want to update the class of the student whose number is 111.</p><pre>db.student.update(<br>  { &quot;Number&quot;: 111 },<br>  { $set: { &quot;class&quot;: 11 } }<br>)</pre><p><strong>db.collection.updateMany()</strong>: We use it to update more than one data in the collection.<br>For example, if we want to update the class of successful students in 10th grade as 11, we can use.</p><pre>db.collection.updateMany(<br>  { &quot;class&quot;: 10, &quot;success&quot;: true }, // Condition that specifies the documents to update<br>  { $set: { &quot;class&quot;: 11 } } // Updated field and its value<br>)</pre><p><strong>db.collection.findOneUpdate():</strong> Finds and updates the first data in the collection with certain conditions. For example, in a scenario where there are students in the collection, we can use it if we want to update the class according to the student’s ID.</p><pre>db.collection.findOneAndUpdate(<br>  { &quot;student_id&quot;: &quot;123&quot; }, // Condition specifying the document to update<br>  { $set: { &quot;class&quot;: 11 } }, // Updated field and its value<br>  { returnNewDocument: true } // Option to return the updated document<br>)</pre><p><strong>db.collection.replaceOne(): </strong>Finds the first document with the conditions and replaces it with another document. For example, in a scenario where there are students in the collection, we can use it if we want to update all the information of a student according to their ID.</p><pre>db.collection.replaceOne(<br>  { &quot;student_id&quot;: &quot;123&quot; }, // Condition specifying the document to replace<br>  { &quot;student_id&quot;: &quot;123&quot;, &quot;name&quot;: &quot;John&quot;, &quot;class&quot;: 11 } // New document<br>)</pre><p>This query finds the first student whose student_id field is “123” and replaces all fields of this student with a new document.</p><blockquote>NOTE: Even if there is more than one document in the collection that meets the same condition, it will only replace the first document that meets the condition.</blockquote><p><strong>Data Deletion Operations</strong></p><p><strong>Db.collection.remove() : </strong>We use it to delete the data in the collection. The data to be deleted according to the given condition is deleted. If the condition is not specified, all data is deleted. For example, let’s say we want to delete a specific student’s ID in a student collection:</p><pre>db.collection.remove({ &quot;student_id&quot;: &quot;123&quot; })</pre><p>This query removes all student documents with “student_id” field “123” from the collection.<br>If no condition is specified, it can be used to delete all documents:</p><pre>db.collection.remove({})</pre><p>This query deletes all documents in the collection. In modern versions of MongoDB, however, it is recommended to use deleteOne or deleteMany instead of remove, because their use is more explicit and better indicates the intention of deleting the documents.</p><p><strong>db.collection.deleteOne()</strong> : Deletes the first data in the collection according to the given condition. For example, it deletes the first user whose companyName field is x.</p><pre>db.Companies.deleteOne({“companyName”: “x”})</pre><p><strong>db.collection.deleteMany():</strong> Deletes all data in the collection according to the given condition. For example, it deletes all users whose companyName field is x.</p><pre>db.Companies.deleteMany({“companyName”:”x”})</pre><p><strong>BACKUP AND SECURITY IN MONGODB</strong></p><p>Backup is one of the most important ways to keep data safe in MongoDb. It allows us to restore data quickly in case of data loss. Backup strategies :</p><p><strong>1.Full Backup:</strong> This method makes a full copy of the entire database. This is the most comprehensive type of backup and requires a lot of storage space and the backup process can take a very long time.</p><p><strong>2. Incremental Backup: </strong>Creates small backup files containing only updated and added data. This is much more efficient in terms of storage space and time, but it is complex.</p><p><strong>3. Point-in-Time:</strong> Backs up the state of the database at a specific point in time. For example, it backs up data from a specific time interval.</p><p><strong>SECURITY IN MONGODB</strong></p><p>Security in MongoDB is important and can be achieved in various ways. Here are some common methods to improve security in MongoDB:</p><p><strong>User Authorization:</strong> You can provide access control by defining users and roles in MongoDB. You can manage users’ access levels to specific databases or collections.</p><p><strong>Using SSL/TLS:</strong> You can use SSL/TLS to encrypt data communication. This ensures that data is transmitted securely over the network.</p><p><strong>Encryption:</strong> MongoDB supports encryption of data on disk. This ensures that the data in the database is protected even in case of physical interception.</p><p><strong>Network Security:</strong> You can protect your MongoDB servers with firewalls and other network security measures. You can set network restrictions, such as only accepting traffic from specific IP addresses.</p><p><strong>Monitoring Security Settings:</strong> It is important to regularly monitor and update MongoDB’s security settings. Attackers are likely to discover new weaknesses, so you should constantly review your security measures.</p><p><strong>Security Updates:</strong> Note that MongoDB regularly releases security updates. You should keep your system up to date by applying these updates regularly.</p><p><strong>Logging and Monitoring:</strong> You can monitor and audit security events using MongoDB’s logging features. This can help you detect potential attacks or security breaches.</p><p>These methods are starting points that can be used to improve security in MongoDB. However, it is important to take appropriate security measures in each case and should be tailored to the specific requirements.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7233edcbca7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernets Nedir ?]]></title>
            <link>https://medium.com/@esmaozel/kubernets-nedir-525ef6a92265?source=rss-d3ef47134b00------2</link>
            <guid isPermaLink="false">https://medium.com/p/525ef6a92265</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[kubernets-nedir]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Esma Özel]]></dc:creator>
            <pubDate>Sun, 07 Apr 2024 18:27:20 GMT</pubDate>
            <atom:updated>2024-04-17T19:41:41.281Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kubernetes Nedir ?</h3><p>Kubernets; conteiner ile uygulamaları çalıştıran bir bilgisayar düğümü ya da çalışan makine gruplarıdır. Bir uygulamanın, uygulama kodunu farklı platformlarda çalıştırmak için kullanması gereken tüm dosya ve kitaplıkların paketlendiği sürece konterizasyon(conteinerl’ı hale getirme) diyoruz. Kubernet conteiner’ları yönetmemize olanak tanır.</p><p>Kubernet kullanarak uygulamalarımızın daha hızlı ve verimli bir şekilde çalışmasını sağlayabiliriz. Uygulamalarımızda sürekli kontrol sağlayarak istenmeyen durumlarda müdahale eder ve uygulamamız kesintisiz bir şekilde çalışmaya devam eder.</p><h3>Kubernets’in Temel Kavramları ve Kullanım Alanları</h3><p>Kubernets, container orchestratiın platformu olarak çalışır ve içinde bir çok kavram yer alır. Bu kavramlar ise Kubernets’ İ kullanarak uygulamaların yayılması, yapılandırılması ve yönetilmesi gerektiğini anlamak için önemlidir.</p><h3>1.Node</h3><p>Kubernets’in cluster’ında çalışan fiziksel veya sanal makinelere cluster denir. Node’lar conteiner’ları çalıştırmak için gerekli olan işletim sistemi ve conteiner runtime’ı içerir.</p><h3>2.Pod</h3><p>Kubernets’in en temel yapı birimine pod denir. Pod’lar birden fazla conteiner içererbilir ve bu cobteiner’lar aynı network ve disk kaynaklarını paylaşır.</p><h3>3.Replication Controller</h3><p>Kubernets’in oluşturduğu pod sayılarını kontol eder, olması gereken replica sayısına gelmesini sağlar. Belirtilen sayıdaki portları çalıştırır ve bu portların çökmesi durumunda otomatik olarak yeniden başlatır.Örneğin node hata verir ve çökerse, üzerindeki podlar da hata verecektir. Bu durumda Replication Controller nesnesinin takip ettiği pod’lar farklı bir node üzerinde yeniden ayağa kalkacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*mFYfiBLq5n3nwRCJm4MeXw.png" /></figure><p>Replication Controller, Pod’ları ölçekleyebilir ve konfigüre edebilir. Örnek olarak önceden belirlenen bir sayıda Replica Pod’u çalıştırabilir ve pod’ların sayısını otomatik olarak ölçeklendirebilir.</p><p>Örneğin Replication Controller’a bir yapılandırmanın 3 tane pod’u olsun demişsek, Replication Controller her zaman onu 3 adet olacak şekilde koruyacaktır. Eğer pod’lardan birini silersek, Replication Controller yeni bir pod oluşturur ve yeni podu cluster’a dahil eder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*5oPPHBH1c9Qdr7XmAOC5Hg.png" /></figure><p>Replication Controller, belirlenen sayıdaki pod’un çalışmasını garantiler. Örneğin pod’lardan biri silinirse, Replication Controller silinen pod’ların yerine yenilerinin oluşmasını sağlar. Bu sayede uygulama her zaman çalışır ve her zaman istenilen sayı kadar pod çalışır. Bu mekanizmanın temel amacı ise Kubernets’in yüksek kullanılabilirlik ve güvenilirliğini sağlamaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*vl9QNn_lNENseLULAVLwmw.png" /></figure><h3>3.1 Replication Controller Yapısı</h3><p>Replication Controller 3 ana başlıktan oluşur.</p><p>· <strong>Label selector:</strong> Replication Controller’ın kontrol edeceği podların tanımlanmasında kullanılır.</p><p>· <strong>Replica count:</strong> Çalışacak pod sayısını belirler.</p><p>· <strong>Pod template :</strong> Yeni oluşacakkodların manifestidir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*zcb8ADUvWG6StMAZq_CuoQ.png" /></figure><p>Replication Controller’ın bu üç başlığını istediğimiz zaman değiştirebiliriz fakat dikkat etmemiz gereken önemli noktalar vardır.</p><p>· Label selector ve ya pod templat’i değiştirmek mevcuttaki pod’ları etkilemez.</p><p>· Replication Controller’ın label selector’unu veya podlarının labellar’ını değiştirirsek podlar silinmez, yaşamaya devam eder fakat artık Replication Controller’ın kontrolünde olmaz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*eNMqpOLlce4TUujz_4oI_w.png" /></figure><p>· Pod templati değiştirirmemiz mevuttaki podları etkilemez. Replication Controller tarafında oluşacak kodlar bu yeni template ile oluşur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*FkU-9HFesHF1DtIwQP911w.png" /></figure><h3>3.2 Replication Controller Nasıl Oluşturulur ?</h3><p>Replication Controller oluşturmak için Json ya da yaml formatında bir manifest dosyası hazırlayıp Kubernets API Server’agöndereceğiz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*zAEQ6V0NBWVzuWHzvFr5sw.png" /></figure><p>Oluşturmuş olduğumuz bu yaml dosyası “<strong>myapp</strong>” adında bir Replication Controller oluşturur. “<strong>replicas</strong>” ile 3 adet replica Pod çalıştırmak için yapılandırıldığını görebiliriz. “<strong>selector</strong>” altında da belirtildiği gibi “<strong>app:myapp</strong>” label ile işaretlendirilmiş podları bulup yönetir. “<strong>template”</strong> ise oluşturulacak nesnenin özelliklerini ve yapılandırılmasını tanımlar. Örnek olarak; bir pod template’i oluşturulacak pod’un adını, etiketini, konteynerleri ve bu konteynerlerin yapılandırılmasını belirtir. Burada dikkat etmemiz gereken nokta; oluşturulan Pod’ların Replication Controller tarafından yönetilebilmesi için labels kısmında, Replication Controller’ın selector kısmında belirtilen label’lar ile oluşturulmasıdır. Yoksa Replication Controller’ı oluşturamayız.</p><p>Manifest dosyası hazır olduktan sonra <strong>kubectl create</strong> veya <strong>kubectl apply</strong> komutlarından birini kullanarak Replication Controller’ ı oluşturabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*vCrIus2vAUWPbk90PMpwBQ.png" /></figure><p>Bu adımdan sonra pod’ları listelediğimizde belirttiğimiz replika sayısı kadar pod olduğunu göreceğiz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*3JAPEt-zc0MwflAzCOP-SA.png" /></figure><h3>3.2 Replication Controller Nasıl Oluşturulur ?</h3><p>“kubectl get rs” komutu ile oluşturulan Replication Controller’ı görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*lRh1nNB6yOeXrGybXz6rfA.png" /></figure><h3>3.3 Replication Controller Scale Etmek ve Sayısını Değiştirmek</h3><p>Replica Controller’ ı oluştururken replicas parametresi ile oluşturcağımız replika sayısını belirlemiştik. Bu sayıyı ihtiyaca göre arttırıp azaltabiliriz. Replika sayısını değiştirmek için “<strong>kubectl scale rc</strong>” komutunu kullanırız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*34oW_lAgIi2PV5XonhXAUA.png" /></figure><p>Burada 10 replika olarak değiştirdik. Böylelikle önceki replikalarımızla birlikte toplam 10 replika olacağını belirtmiş olduk. Aynı işlemi “kubectl edit” komutu ile de yapabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*OpvVHeaCn_V1ZSewu7uX7g.png" /></figure><h3>3.4 Replication Controller Silmek</h3><p>Replication Controller’ ı silersek yönettiği tüm pod’ları da silmiş oluruz. Bunun için “kubectl delete” komutunu kullanırız.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*jm01LotCHpM7MOW3L3U08Q.png" /></figure><p>Replication Controller silinirken takip ettiği pod’ların silinmesini istemiyorsak “ — cascade=false” komutunu kullanabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*kGhY48Wg9megsjB8IX1S_g.png" /></figure><h3>4.Service</h3><p>Kubernets’ de servisleri uygulamamızın dışarısı ile iletişimi için kullanırız. Servisler belirli bir uygulama veya mikro servis grubu için sabit bir Ip ve DNS kaydı sağlar. Böylece uygulamamızın hangi IP adresine ve DNS kaydına bağlanacağını önceden bilmiş oluruz. Bu sayede Pod’lar sürekli değişse bile sorun olmaz.</p><h3>5.Volume</h3><p>Pod’ lar içindeki verileri Volume sayesinde saklayabilir ve taşıyabiliriz. Pod’ların ölümü veya yeniden oluşması gibi durumlarda verilerin korunması için kullanılır.</p><h3>6.Deployment</h3><p>Deployment; uygulamalarımızın Kubernetes Cluster’ında çalıştırılmasını sağlar. Uygulamalarımızın güvenilir ve ölçeklenebilir bir şekilde dağılması için önemlidir. Deployment’in bize sağladığı avantajlar :</p><p>· <strong>Yüksek Kullanılabilirlik :</strong> Replikalar ile uygulamamızın sürekli olarak çalışmasını sağlar.</p><p>· <strong>Kolay Güncelleme ve Geri Alım</strong> : Uygulamamızın versiyonlarını kolayca güncellememizi ve geri almamızı sağlar.</p><p>·<strong> Ölçeklenebilirlik</strong> : Uygulamamızın ölçeklendirilmesini sağlar. Uygulamanın üzerindeki yük artarsa, Deployment’lar direkt yeni pod üreterek uygulama üzerindeki yükü kaldırır.</p><p>· <strong>Değişiklik Yönetimi</strong> : Yaptığımız değişiklikleri yeni bir Deployment versiyonu olarak yayınlarsak Kubernets bu değişiklikleri otomatik olarak uygular ve uygulamamız kesintisiz olarak çalışmaya devam eder.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=525ef6a92265" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Nedir?]]></title>
            <link>https://medium.com/wellbees/docker-nedir-aca9fbb32c57?source=rss-d3ef47134b00------2</link>
            <guid isPermaLink="false">https://medium.com/p/aca9fbb32c57</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[docker-image]]></category>
            <dc:creator><![CDATA[Esma Özel]]></dc:creator>
            <pubDate>Mon, 28 Nov 2022 21:16:57 GMT</pubDate>
            <atom:updated>2023-02-01T08:04:02.708Z</atom:updated>
            <content:encoded><![CDATA[<p>Docker yazılım geliştiriciler ve sistemciler için açık kaynaklı yeni nesil bir sanallaştırma platformudur.</p><h4>Docker Olmadan Sanallaştırma Mimarisi</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*svngnkr_XyAbjIBTh3i7gQ.png" /><figcaption>Docker Olmadan Sanallaştırma Mimarisi</figcaption></figure><p>En altta fiziksel makinelerimiz bulunmakta, onun üzerinde bir işletim sistemimiz kurulu. Onun da üzerinde sanallaştırmaya imkan veren Hypervisor programımız kurulu. Onun da üzerinde ise sanal makinelerimiz ayağa<strong> </strong>kalkmış durumdadır. Üç tane sanal makinemiz var ve üçünün de konfigürasyon bilgileri birbirinden farklı. Yani sanal makinelerden biri 4 gb kullanırken diğeri 5 gb ram kullanabilir ya da çekirdeklerini farklı ölçülerde kullanabilir. Docker olmadan işler bu şekilde devam ediyor. Yani bir uygulamayı ayağa kaldırmak için oldukça fazla işlem yapmak gerekiyor.</p><p><strong>Docker İle Sanallaştırma Mimarisi</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*tbAScYkg7RFC0Ee7ZEaMqg.png" /><figcaption>Docker İle Sanallaştırma Mimarisi</figcaption></figure><p>Docker ile uygulamayı ayağa kaldırmak için yaptığımız işlemler oldukça kolaylaşmaktadır. İlk katmanımızda yine aynı şekilde fiziksel makineye ihtiyaç duyuyoruz. Daha sonra yine bir işletim sistemine ihtiyaç duyuyoruz. 2. Katmandan sonra artık Docker Engine kullanıyoruz ve Docker Engine bizim yerimize sanallaştırma işlemini gerçekleştirmektedir. Burada uygulamalar direkt Docker Engine üzerinde çalışmaktadır. Docker kullanırken bir sanal işletim sistemine ihtiyaç duymayız. Fakat Docker yoksa mutlaka sanal işletim sistemine ihtiyaç duyarız. Docker uygulamanın çalışır hale gelmesini hızlandırır. Docker ile farklı versiyonları çalıştırmamıza olanak sağlar. Docker kolay paylaşım sağlar. Yani uygulamalarımızı Docker ile saniyeler içerisinde taşıyabiliriz.</p><p><strong>DockerFile/Image/Container Nedir ?</strong></p><p>Aşağıda gördüğünüz 3 yapı Asp.Net Core uygulamamızı Dockerize edebilmemiz için gerekli olan aşamalardır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*LLArimq7YVGSa22ty0gTwA.png" /></figure><p><strong>DockerFile </strong>: DockerFile dosyamızın içerisinde biz talimatlar yazarız. DockerFile için talimatlar, komut satırıdır diyebiliriz. Yani DockerFile içerisinde alt alta yazılan talimatlardır. Bu talimatlar .Net Core uygulamamızın nasıl bir ortamda çalışacağı ile ilgilidir. Bir Asp.Net core uygulamsının çalışabilmemisi için bazı yapılara ihtiyaç vardır. Örneğin bir işletim sistemi. Bir işletim sisteminde ilgili Asp.Net Core uygulamamızı çalıştıracak kütüphanelere ihtiyaç var. En sın olarak ise Asp.Net Core uygulamasının publish edilmiş datasına ihtiyacımız var . Uygulamamızın çalışması için bu 3 bileşene ihtiyacımız var; bu bileşenleri tanımladığımız yer bizim DockerFile dosyamızdır.</p><p><strong>Docker Image: </strong>Docker Build komutunu kullandıktan sonrasında arkasında bir image oluşur. Bu image DockerFile dosyasında belirtmiş olduğumuz talimatlara göre oluşur. Docker Image bir layer -katmanlar topluluğudur. DockerFile içerisinde belirtmiş olduğumuz her bir satıra karşılık Docker Image içerisinde bir layer oluşur. Örneğin 4 satırlı bir ImageFile dosyamız varsa 4 katmanlı bir docker ımage oluşur. Docker Image dosyası static bir dosyadır, Read only dir. Yani sadece okunabilir bir dosyadır. Çalıştırılabilir dosya değildir. Docker Image dosyası vermiş olduğumuz talimatlara göre oluştuktan sonra docker run komutuyla birlikte bir conrtainer ayağa kaldırır. Container is docker ımage ların çalışabilen instance ‘larıdır.</p><p><strong>Conteiner Nedir ?</strong></p><p><em>Aşağıda gördüğünüz kutucuklara conteiner denilmektedir</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*64SMM3LCliMjmScZhiKm8w.png" /><figcaption>Conteniners</figcaption></figure><p>Conteiner’ları uygulamaların çalışacağı mini bir işletim sistemi olarak düşünebiliriz. Bu mini işletim sistemi üzerinde uygulamalar çalışmaktadır. Docker conteinerleri durdurabilir, silebilir tekrar başlatabilir. Fakat docker image; static olduğundan dolayı, bu işlemleri gerçekleştiremez. Docker Image üzerinde istenildiği kadar conteiner ayağa kaldırılabilir. Image ile uygulamamızın çalışabilen instancelerini oluşturabilirz. Bu instancelere container denir.</p><p><strong>Docker CLI Nedir ?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*cJsGL2v-RaR462Ww6J3jag.png" /></figure><p><em>Docker ile haberleşmemizi sağlayan bir komut satırıdır.Docker tek parçadan oluşan bir yapı değildir. Birden fazla parçanın bir araya gelmesi ile oluşan bir yapıdır. Bilgisayarımıza docker kurduğumuz zaman iki önemli tool yüklenir. Bunlardan bir tanesi server tarafında ana tool olan docker daemon</em> <em>iken ikinci client tarafından docker CLI’dır. Server tarafındaki Docker Daremon tektir. Client tarafındaki Docker CLI birden fazla olabilir.</em></p><blockquote><strong><em>Peki haberleşme nasıl gerçekleşir ?</em></strong></blockquote><p>Docker Daemon kendisi ile haberleşmek için Rest API ‘ları var. Docker CLI’ya bir komut yazdığımız zaman bu komut Docker Daemon ‘ a bir API isteği gönderir. Bu API isteği üzerine Docker Dmon yapaeacağı işlemi gerçekleştirir.</p><p>Örneğin ; bir containerın ayağa kaldırılması, durdurulması veya silinmesi, bir image oluşturulnası gibi. Bu komutlar Rest API aracılığıyla Docker Darmona gelir. Docker Daemon da gelmiş olan komuta göre gerekli işlemleri gerçekleştirir.</p><p><strong>Docker Registry Nedir ?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*nQaGA3y1LSEc-3NIIye9mA.png" /><figcaption>Basit Docker Hiyerarşisi</figcaption></figure><p>Docker Registry Image’ları kaydedebileceğimiz bir depo olarak düşünebiliriz. Örneğin yukarda görmüş olduğunuz rafı Docker Registry olarak düşünebilirsiniz. Rafların içindeki her kutu da bir Image’dır. Bu Image’ların her biri tek bir amaca hizmet etmektedir.</p><p><strong><em>Bizim neden bir Registry’e ihtiyacımız var? Neden biz Image’larımızı kaydetmek istiyoruz veya bu Registry ‘lerden neden Image’ları istiyoruz?</em></strong></p><p>Örneğin bilgisayarımıza bir Asp.Net Core uygulaması inşa ettik ve bu uygulamamızı Dockerize etmek istiyorsunuz. Uygulamamızın root klasörüne bir docker file dosyası oluşturdunuz. Bu docker file dosyasında gerekli komutları yazarak bir image oluşturacaksınız. Oluşturmuş olduğumuz Asp.Net Core uygulamasının çalışması için bizim mini bir işletim sistemine ve bu işletim sistemi içerisinde kurulu Asp.net Core uygulamaasını çalıştıracak bir enviromenta ihtiyaç vardır. İşte bunu kendimiz oluşturmak yerine çeşitli firmaların (Microsoft,Google vs.) yayınlamış olduğu imagelerden çekip kullanabiliyoruz.</p><p>Microsftun Asp.Net core 3.1 ini çalıştıracak Image’ını kendi bilgisayarımıza indirdiğimiz zaman; bu Image üzerine oluşturmuş olduğumuz Asp.net Core uygulamasını publish ederek ve arkasından yeni bir Image oluşturarak gelen Image üzerine çalışacak olan Asp.Net core uygulamamızın publish edilmiş datasını koyarız.Arkasından yeni oluşan Image ‘ı bir container oluşturarak ayağa kaldırabilirz.Yani Image’dan çalışabilen bir instance alıyoruz. Yalnız bu Image’ların üzerinde herhangi bir program yüklü değil. Bu Image üzerine çalışacak olan Instance ‘ı biz koyuyoruz.</p><p><strong>Resmi Olarak Microsoft Tarafından Yayınlanmış Olan Asp.Net Core Images</strong></p><blockquote>DockerHub</blockquote><p>Docker Hub da bir tane private Image oluşturabiliyoruz. Birden fazla private image için ücret ödemek gerekmektedir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*V_E5fZlWkg24EgaGCmwJ_w.png" /><figcaption>Images</figcaption></figure><p>Docker Hub içinde Asp.Net Core için Image arattığımızda ; bir tane ASP.Net Core Runtime geldi. Dikkat ederseniz Microsoft Asp.Net Core tarafından resmi bir Image’dir. Bunun yanında Asp.Net Core SDK var. İkisinin arasındaki fark SDK içerisinde aynı zamanda runtime da vardır. Runtime’da ise sadece uygulamamızı yayınlayabiliriz. Yani Runtime uygulamamızı çalıştırmak için uygun bir ortam sağlıyorken ASP.NET Core SDK aynı zamanda uygulamayı çalıştırmamız ve uygulamayı geliştirmemiz için bir ortam sağlamaktadır.</p><p><strong>Docker pull konutuyla birlikte aşağıdagördüğünüz image’ları bilgisayarınıza indirebilirsiniz. Bu image’ı indirdikten sonra kendi image’nızı publish eder ve yeni bir image oluşturduğunuz zaman artık oluşturduğunuz image üzerinden container da oluşturabilirsiniz.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*Cnt7Axq9GQoU8LqqsJeTnw.png" /><figcaption>Images İndirme Komutları</figcaption></figure><blockquote><strong>NOT :Linux Image’lar Windows Imagelar’a göre çok daha küçüktür.Image ne kadar kğçük ise ; Image dan container oluşturmak o kadar kısa sürer. Bu yüzden Linux Image kullanmak daha çok tavsiyeedilir. Eğer uygulama içerisinde cross platform yoksa ; bu durumda Windows Image kullanmak gerekir. Windows Image’lar ise içerisinde Linux yerine Windows nonoserver isminde küçük bir işletim sistemi bulundurur. Bunun üzerine yine Asp.Net Core uygulamalarını çalıştıracak enviroment kurulu bir şekilde gelmektedir.</strong></blockquote><p><strong>!!!Docker bilisayarlar arasındaki versiyondan, işletim sisteminden bağımsız olarak çalışabilecek ortamı bize sağlar.</strong></p><p><strong>Docker Kurulumu</strong></p><p>Docker kurabilmek için Docker Hub da bir hesabınızın olması gerekir. Eğer bir hesabınız yoksa öncelikle bir hesap oluşturmanız gerekmektedir. Daha sonra arama ekranına docker hub download yazarak yine docker hub ‘ın kendi sitesinden exe dosyasını indirebilirsiniz. Exe dosyasını çalıştırınız, sonra diğer adımlarda next diyerek docker’ ı bilgisayarınıza kurabilirsiniz.</p><p>Windows işletim sistemine sahip bilgisayarlarda Docker’ı kurduğunuzda hem Linux Conteinerları hem de Windows Conteinerları çalıştırabilirsiniz. Fakat linux türevi işletim sitemine kurduğunuzda is sadece Linux Conteinerleri çalıştırabilirsiniz. Yani bir Ubuntu üzerine Docker kurduğunuzda Windows Conteinerlari çalıştıramazsanız; ama Windows da her ikisini de çalıştırabilirsiniz. Program kurulduktan sonra giriş yapmayı unutmayın.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aca9fbb32c57" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wellbees/docker-nedir-aca9fbb32c57">Docker Nedir?</a> was originally published in <a href="https://medium.com/wellbees">Wellbees Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>