{"id":1062,"date":"2017-01-31T14:27:30","date_gmt":"2017-01-31T12:27:30","guid":{"rendered":"https:\/\/gokhan-gokalp.com\/?p=1062"},"modified":"2018-05-18T22:43:34","modified_gmt":"2018-05-18T19:43:34","slug":"csharp-loki-ile-service-bazli-distributed-locking","status":"publish","type":"post","link":"https:\/\/gokhan-gokalp.com\/tr\/csharp-loki-ile-service-bazli-distributed-locking\/","title":{"rendered":"C# Loki ile Service Bazl\u0131 Distributed Locking"},"content":{"rendered":"<p>Merhaba arkada\u015flar.<\/p>\n<p>Bu makale konumda sizlere\u00a0<em><a href=\"http:\/\/www.trendyol.com\" target=\"_blank\" rel=\"noopener\">Trendyol.com<\/a><\/em>\u00a0\u00e7at\u0131s\u0131 alt\u0131nda geli\u015ftirip, baz\u0131 uygulamalar\u0131m\u0131zda kulland\u0131\u011f\u0131m\u0131z <strong><em><a href=\"https:\/\/github.com\/Trendyol\/Loki\" target=\"_blank\" rel=\"noopener\">Loki<\/a><\/em><\/strong> k\u00fct\u00fcphanesinden bahsetmek istiyorum.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/raw.githubusercontent.com\/GokGokalp\/Loki\/master\/misc\/logo.png\" alt=\"\" width=\"400\" height=\"200\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 400px; --smush-placeholder-aspect-ratio: 400\/200;\" \/><\/p>\n<h4>Loki Nedir?<\/h4>\n<p>Loki&#8217;yi k\u0131saca tan\u0131mlamak gerekirse:<\/p>\n<blockquote><p>Distributed\u00a0sistemler \u00fczerinde kolay bir \u015fekilde lock i\u015flemlerini handle etmeye yarayan bir library&#8217;dir.<\/p><\/blockquote>\n<p>Loki&#8217;yi biraz daha\u00a0a\u00e7mak gerekirse e\u011fer, shared bir resource \u00fczerinden i\u015flem yapan uygulamalar\u0131m\u0131z var ise ve bu uygulamalar\u0131m\u0131z\u0131 <strong>performans<\/strong> ve <strong>network split<\/strong>\u00a0problemlerinden dolay\u0131 kolay bir yoldan <strong>scale<\/strong> etmek istiyorsak, i\u015fte bu noktada bize yard\u0131mc\u0131 olmaktad\u0131r.<\/p>\n<h4>Peki Loki Nas\u0131l \u00c7al\u0131\u015f\u0131yor? ve Consistency&#8217;i Nas\u0131l Sa\u011fl\u0131yor?<\/h4>\n<p>Loki&#8217;nin \u00e7al\u0131\u015fma mant\u0131\u011f\u0131 asl\u0131nda olduk\u00e7a basit. Sizden sadece querying yapt\u0131\u011f\u0131n\u0131z k\u0131s\u0131m\u0131, &#8220;Locking.Instance.ExecuteWithinLock&#8221; method&#8217;u ile wraplemenizi istemektedir. Loki, \u015fuan altyap\u0131s\u0131nda primary locking handler olarak <strong>Redis<\/strong> ile \u00e7al\u0131\u015fmaktad\u0131r. Secondary locking handler olarak ise <strong>MSSQL<\/strong> implementasyonu bulunmaktad\u0131r. Loki&#8217;nin ger\u00e7ekle\u015ftirdi\u011fi i\u015flem ise wrap&#8217;lenen code blo\u011funu execute etmeden \u00f6nce, initialize s\u0131ras\u0131nda belirtece\u011fimiz bir &#8220;serviceKey&#8221; ile Redis locking handler&#8217;\u0131 \u00fczerinde bir key persist etmektedir. E\u011fer key&#8217;i persist edebildi ise ilgili code blo\u011funu execute etmektedir ve i\u015flem sonunda ise ilgili key&#8217;i Redis \u00fczerinden kald\u0131rmaktad\u0131r. Dolay\u0131s\u0131yla key&#8217;i persist edemez ise, bu key ile ilgili bir i\u015flem s\u00fcrd\u00fc\u011f\u00fcn\u00fc anlamaktad\u0131r ve ilgili code blo\u011funu execute etmemektedir.<\/p>\n<p>Secondary k\u0131sm\u0131na ge\u00e7meden \u00f6nce dilerseniz bir sequence diyagram\u0131na bakal\u0131m.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter lazyload\" data-src=\"https:\/\/raw.githubusercontent.com\/GokGokalp\/Loki\/master\/misc\/loki-basic-workflow.png\" alt=\"\" width=\"553\" height=\"672\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 553px; --smush-placeholder-aspect-ratio: 553\/672;\" \/><\/p>\n<p>Burada primary olan Redis \u00fczerine gelen &#8220;Lock()&#8221; ve &#8220;Release()&#8221; isteklerine dikkat \u00e7ekmek istiyorum.<\/p>\n<ul>\n<li>1. senaryoda e\u011fer Redis \u00fczerinden sorunsuz bir \u015fekilde lock alabilirse, arka planda <strong>async<\/strong> bir \u015fekilde consistency i\u00e7in\u00a0secondary persistence store \u00fczerinde de bir lock i\u015flemi ger\u00e7ekle\u015ftiriyor. Release k\u0131sm\u0131nda da ayn\u0131 i\u015flem ge\u00e7erlidir.<\/li>\n<li>2. senaryoda ise e\u011fer Redis \u00fczerinden herhangi bir lock alam\u0131yorsa ki bunun anlam\u0131 ba\u015fka bir uygulama \u015fuan \u00fczerinde \u00e7al\u0131\u015f\u0131yor, bunun i\u00e7in secondary&#8217;e hi\u00e7 bir \u015fekilde gitmeyip code blo\u011funu execute etmiyor.<\/li>\n<li>3. ve son senaryo i\u00e7in ise Redis \u00fczerinden lock almaya \u00e7al\u0131\u015f\u0131rken herhangi bir network probleminden dolay\u0131 bir hata al\u0131rsa, consistency&#8217;i sa\u011flamak ad\u0131na direkt olarak <strong>sync<\/strong> bir \u015fekilde secondary&#8217;deki persistence store \u00fczerine gidiyor. Release i\u015fleminde de ayn\u0131 senaryo ge\u00e7erli.<\/li>\n<\/ul>\n<p>Yukar\u0131daki senaryolar do\u011frultusunda\u00a0x bir uygulama n tane makine \u00fczerinde \u00e7al\u0131\u015f\u0131rken, ayn\u0131 datalar \u00fczerinde i\u015flem yapmadan kolay bir \u015fekilde\u00a0<strong>multiple<\/strong> olarak\u00a0<strong>distributed<\/strong>\u00a0\u00e7al\u0131\u015fmalar\u0131 sa\u011flanm\u0131\u015f oluyor. Tabi bunun i\u00e7in ilgili business do\u011frultusunda\u00a0i\u015fledi\u011finiz datalar\u0131, bir \u015fekilde flaglemeniz gerekmektedir.<\/p>\n<h4>Implementasyon A\u015famas\u0131<\/h4>\n<p>\u015euan nuget.org \u00fczerinde iki adet paket mevcuttur. Bunlardan birisi &#8220;<strong><em>LokiNet<\/em><\/strong>&#8221; di\u011feri ise &#8220;<strong><em>LokiNet.MSSQL<\/em><\/strong>&#8221; paketleridir. Nuget Package Manager \u00fczerinden eri\u015febilir ve kurulumu ger\u00e7ekle\u015ftirebilirsiniz. Loki&#8217;nin kullan\u0131m\u0131, mant\u0131\u011f\u0131nda da oldu\u011fu gibi gayet basit. \u0130lk olarak uygulama aya\u011fa kalkarken, &#8220;LokiConfigurationBuilder&#8221; ile a\u015fa\u011f\u0131daki gibi initialize etmek gerekiyor.<\/p>\n<pre class=\"lang:c# decode:true\">List&lt;EndPoint&gt; redisEndPoints = new List&lt;EndPoint&gt;\r\n{\r\n    new DnsEndPoint(\"redisUri\", redisPort)\r\n};\r\n\r\nLokiConfigurationBuilder.Instance.SetServiceKey(\"SimpleTestClient\")\r\n                        .SetPrimaryLockHandler(new RedisLokiLockHandler(redisEndPoints.ToArray()))\r\n                        .Build();<\/pre>\n<p>Loki&#8217;ye burada &#8220;SimpleTestClient&#8221; key&#8217;i ile lock i\u015flemlerini ger\u00e7ekle\u015ftirmesi gerekti\u011fini, &#8220;SetPrimaryLockHandler()&#8221; method&#8217;u ile de lock i\u015flemlerini Redis \u00fczerinden ger\u00e7ekle\u015ftirmesi gerekti\u011fini s\u00f6yl\u00fcyoruz. Secondary handler set etme mecburiyeti bulunmamakta fakat mevcutta bulunan MSSQL locking handler&#8217;\u0131 da kullanmak isterseniz e\u011fer:<\/p>\n<pre class=\"lang:c# decode:true \">LokiConfigurationBuilder.Instance.SetServiceKey(\"SimpleTestClient\")\r\n                        .SetPrimaryLockHandler(new RedisLokiLockHandler(redisEndPoints.ToArray()))\r\n                        .SetSecondaryLockHandler(new MSSQLLokiLockHandler(\"connectionString\"))\r\n                        .Build();<\/pre>\n<p>\u015feklinde configure etmeniz yeterli olacakt\u0131r. Bununla birlikte MSSQL handler&#8217;\u0131 i\u00e7in ihtiya\u00e7 duyaca\u011f\u0131 tablo script&#8217;i ise a\u015fa\u011f\u0131daki gibidir.<\/p>\n<pre class=\"lang:tsql decode:true \">CREATE TABLE [dbo].[LokiLockings](\r\n    [ServiceKey] [varchar](50) NOT NULL,\r\n    [CreationDate] [datetime] NOT NULL,\r\n CONSTRAINT [PK_LokiLockings] PRIMARY KEY CLUSTERED \r\n(\r\n    [ServiceKey] ASC\r\n))<\/pre>\n<p>Initialization i\u015flemleri bu kadar. Art\u0131k tek yapmam\u0131z gereken uygulamam\u0131zdaki business ak\u0131\u015f\u0131na g\u00f6re ister <strong>function<\/strong> baz\u0131nda ister <strong>application\u00a0<\/strong>baz\u0131nda locking i\u015flemini ger\u00e7ekle\u015ftirmektedir.<\/p>\n<p>Bunun i\u00e7in ise &#8220;Locking.Instance.ExecuteWithinLock()&#8221; method&#8217;unu a\u015fa\u011f\u0131daki gibi kullanmam\u0131z yeterli olacakt\u0131r.<\/p>\n<pre class=\"lang:c# decode:true \">Locking.Instance.ExecuteWithinLock(() =&gt;\r\n{\r\n    \/\/do somethings..\r\n},  expiryFromSeconds: 2);<\/pre>\n<p>&#8220;expiryFromSeconds&#8221; parametresi ile ise, isminden de anla\u015f\u0131labilece\u011fi \u00fczere ilgili lock i\u015fleminin belirli bir saniye sonunda otomatik olarak release olmas\u0131 sa\u011flanmaktad\u0131r.<\/p>\n<p>Bunlar d\u0131\u015f\u0131nda e\u011fer secondary olarak sizde farkl\u0131 bir persistence store kullanmak istiyorsan\u0131z, tek yapman\u0131z gereken &#8220;LokiLockHandler&#8221; base class&#8217;\u0131n\u0131 a\u015fa\u011f\u0131daki gibi inherit edecek yeni bir handler yazmakt\u0131r.<\/p>\n<pre class=\"lang:c# decode:true \">public class FooLockHandler : LokiLockHandler\r\n{\r\n    public override bool Lock(string serviceKey, int expiryFromSeconds)\r\n    {\r\n        \/\/Lock operations\r\n    }\r\n\r\n    public override void Release(string serviceKey)\r\n    {\r\n        \/\/Release operations\r\n    }\r\n}<\/pre>\n<p>Proje geli\u015ftirmeye a\u00e7\u0131k olup, sizler de github \u00fczerinden katk\u0131da bulunabilirsiniz.<\/p>\n<p>Umar\u0131m keyifli bir makale konusu olmu\u015ftur.<\/p>\n<p>Proje adresi:\u00a0<a href=\"https:\/\/github.com\/GokGokalp\/Loki\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/GokGokalp\/Loki<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Merhaba arkada\u015flar. Bu makale konumda sizlere\u00a0Trendyol.com\u00a0\u00e7at\u0131s\u0131 alt\u0131nda geli\u015ftirip, baz\u0131 uygulamalar\u0131m\u0131zda kulland\u0131\u011f\u0131m\u0131z Loki k\u00fct\u00fcphanesinden bahsetmek istiyorum. Loki Nedir? Loki&#8217;yi k\u0131saca tan\u0131mlamak gerekirse: Distributed\u00a0sistemler \u00fczerinde kolay bir \u015fekilde lock i\u015flemlerini handle etmeye yarayan bir library&#8217;dir. Loki&#8217;yi biraz daha\u00a0a\u00e7mak gerekirse e\u011fer, shared bir resource \u00fczerinden i\u015flem yapan uygulamalar\u0131m\u0131z&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/gokhan-gokalp.com\/tr\/csharp-loki-ile-service-bazli-distributed-locking\/\">Devam\u0131n\u0131 okuyun<span class=\"screen-reader-text\">C# Loki ile Service Bazl\u0131 Distributed Locking<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":2267,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,68,46,292,175],"tags":[373,369,374,372,370,371],"class_list":["post-1062","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","category-architectural","category-nesne-yonelimli-programlama-object-oriented-programming","category-nosql","category-performans-profiling","tag-c-scale","tag-distributed-lock","tag-easy-scale","tag-multiple-client","tag-redis","tag-redis-lock","entry"],"translation":{"provider":"WPGlobus","version":"3.0.2","language":"tr","enabled_languages":["en","tr"],"languages":{"en":{"title":true,"content":true,"excerpt":false},"tr":{"title":false,"content":false,"excerpt":false}}},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C# Loki ile Service Bazl\u0131 Distributed Locking - G\u00f6khan G\u00f6kalp<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# Loki ile Service Bazl\u0131 Distributed Locking - G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/\" \/>\n<meta property=\"og:site_name\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-31T12:27:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-05-18T19:43:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/01\/loki.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"G\u00f6khan G\u00f6kalp\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/\"},\"author\":{\"name\":\"G\u00f6khan G\u00f6kalp\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"headline\":\"C# Loki ile Service Bazl\u0131 Distributed Locking\",\"datePublished\":\"2017-01-31T12:27:30+00:00\",\"dateModified\":\"2018-05-18T19:43:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/\"},\"wordCount\":720,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/loki.png\",\"keywords\":[\"c# scale\",\"distributed lock\",\"easy scale\",\"multiple client\",\"redis\",\"redis lock\"],\"articleSection\":[\".NET\",\"Architectural\",\"Nesne Y\u00f6nelimli Programlama (Object Oriented Programming)\",\"NoSQL\",\"Performans (Profiling)\"],\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/\",\"name\":\"C# Loki ile Service Bazl\u0131 Distributed Locking - G\u00f6khan G\u00f6kalp\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/loki.png\",\"datePublished\":\"2017-01-31T12:27:30+00:00\",\"dateModified\":\"2018-05-18T19:43:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#primaryimage\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/loki.png\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/uploads\\\/2017\\\/01\\\/loki.png\",\"width\":400,\"height\":200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/csharp-loki-ile-service-bazli-distributed-locking\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# Loki ile Service Bazl\u0131 Distributed Locking\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#website\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"description\":\"C# &amp; Python lover\",\"publisher\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gokhan-gokalp.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"tr\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/#\\\/schema\\\/person\\\/7e2a7fa98babd22a5fdae563c4b8cdbe\",\"name\":\"G\u00f6khan G\u00f6kalp\",\"pronouns\":\"he\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"contentUrl\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\",\"caption\":\"G\u00f6khan G\u00f6kalp\"},\"logo\":{\"@id\":\"https:\\\/\\\/gokhan-gokalp.com\\\/wp-content\\\/litespeed\\\/avatar\\\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659\"},\"sameAs\":[\"https:\\\/\\\/gokhan-gokalp.com\"],\"url\":\"https:\\\/\\\/gokhan-gokalp.com\\\/tr\\\/author\\\/gok-gokalp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C# Loki ile Service Bazl\u0131 Distributed Locking - G\u00f6khan G\u00f6kalp","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/","og_locale":"tr_TR","og_type":"article","og_title":"C# Loki ile Service Bazl\u0131 Distributed Locking - G\u00f6khan G\u00f6kalp","og_url":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/","og_site_name":"G\u00f6khan G\u00f6kalp","article_published_time":"2017-01-31T12:27:30+00:00","article_modified_time":"2018-05-18T19:43:34+00:00","og_image":[{"width":400,"height":200,"url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/01\/loki.png","type":"image\/png"}],"author":"G\u00f6khan G\u00f6kalp","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"G\u00f6khan G\u00f6kalp","Tahmini okuma s\u00fcresi":"4 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#article","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/"},"author":{"name":"G\u00f6khan G\u00f6kalp","@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"headline":"C# Loki ile Service Bazl\u0131 Distributed Locking","datePublished":"2017-01-31T12:27:30+00:00","dateModified":"2018-05-18T19:43:34+00:00","mainEntityOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/"},"wordCount":720,"commentCount":4,"publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/01\/loki.png","keywords":["c# scale","distributed lock","easy scale","multiple client","redis","redis lock"],"articleSection":[".NET","Architectural","Nesne Y\u00f6nelimli Programlama (Object Oriented Programming)","NoSQL","Performans (Profiling)"],"inLanguage":"tr","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/","url":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/","name":"C# Loki ile Service Bazl\u0131 Distributed Locking - G\u00f6khan G\u00f6kalp","isPartOf":{"@id":"https:\/\/gokhan-gokalp.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#primaryimage"},"image":{"@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#primaryimage"},"thumbnailUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/01\/loki.png","datePublished":"2017-01-31T12:27:30+00:00","dateModified":"2018-05-18T19:43:34+00:00","breadcrumb":{"@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/"]}]},{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#primaryimage","url":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/01\/loki.png","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/uploads\/2017\/01\/loki.png","width":400,"height":200},{"@type":"BreadcrumbList","@id":"https:\/\/gokhan-gokalp.com\/csharp-loki-ile-service-bazli-distributed-locking\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gokhan-gokalp.com\/"},{"@type":"ListItem","position":2,"name":"C# Loki ile Service Bazl\u0131 Distributed Locking"}]},{"@type":"WebSite","@id":"https:\/\/gokhan-gokalp.com\/#website","url":"https:\/\/gokhan-gokalp.com\/","name":"G\u00f6khan G\u00f6kalp","description":"C# &amp; Python lover","publisher":{"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gokhan-gokalp.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"tr"},{"@type":["Person","Organization"],"@id":"https:\/\/gokhan-gokalp.com\/#\/schema\/person\/7e2a7fa98babd22a5fdae563c4b8cdbe","name":"G\u00f6khan G\u00f6kalp","pronouns":"he","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","url":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","contentUrl":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659","caption":"G\u00f6khan G\u00f6kalp"},"logo":{"@id":"https:\/\/gokhan-gokalp.com\/wp-content\/litespeed\/avatar\/e645f66b6264ced10d7b6d8b1f85509b.jpg?ver=1776170659"},"sameAs":["https:\/\/gokhan-gokalp.com"],"url":"https:\/\/gokhan-gokalp.com\/tr\/author\/gok-gokalp\/"}]}},"_links":{"self":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/comments?post=1062"}],"version-history":[{"count":4,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1062\/revisions"}],"predecessor-version":[{"id":2268,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/posts\/1062\/revisions\/2268"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media\/2267"}],"wp:attachment":[{"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/media?parent=1062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/categories?post=1062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gokhan-gokalp.com\/tr\/wp-json\/wp\/v2\/tags?post=1062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}