<?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 Ebubekir ERGÜN on Medium]]></title>
        <description><![CDATA[Stories by Ebubekir ERGÜN on Medium]]></description>
        <link>https://medium.com/@ebubekirergun?source=rss-33e0680a5d96------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3VB5inWgtEBrE4y5fsal6A.jpeg</url>
            <title>Stories by Ebubekir ERGÜN on Medium</title>
            <link>https://medium.com/@ebubekirergun?source=rss-33e0680a5d96------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 16:17:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ebubekirergun/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[Documenting the Code Review Process: A Developer’s Journey to Better Collaboration]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ebubekirergun/documenting-the-code-review-process-a-developers-journey-to-better-collaboration-0a83ab8527da?source=rss-33e0680a5d96------2"><img src="https://cdn-images-1.medium.com/max/1536/1*PVhfzpCIK8MH36D1MC3wrg.jpeg" width="1536"></a></p><p class="medium-feed-snippet">Hey there, fellow devs! Today, I want to chat about something that&#x2019;s close to my heart as a software developer: documenting and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@ebubekirergun/documenting-the-code-review-process-a-developers-journey-to-better-collaboration-0a83ab8527da?source=rss-33e0680a5d96------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ebubekirergun/documenting-the-code-review-process-a-developers-journey-to-better-collaboration-0a83ab8527da?source=rss-33e0680a5d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/0a83ab8527da</guid>
            <category><![CDATA[team-collaboration]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ebubekir ERGÜN]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 16:26:17 GMT</pubDate>
            <atom:updated>2025-06-10T16:26:17.476Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Optimizing Network Performance: Key Strategies for Backend Efficiency]]></title>
            <link>https://medium.com/@ebubekirergun/optimizing-network-performance-key-strategies-for-backend-efficiency-2d6dba069550?source=rss-33e0680a5d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d6dba069550</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[latency-reduction]]></category>
            <category><![CDATA[cdn]]></category>
            <category><![CDATA[network-performance]]></category>
            <category><![CDATA[web-optimization]]></category>
            <dc:creator><![CDATA[Ebubekir ERGÜN]]></dc:creator>
            <pubDate>Tue, 27 May 2025 09:14:46 GMT</pubDate>
            <atom:updated>2025-05-27T09:14:46.129Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z27E_mKkmc52cJtsN7SxOw.png" /></figure><p>In the realm of backend development, network performance is a cornerstone of delivering fast, reliable, and scalable applications. As user expectations for speed and responsiveness continue to soar, ensuring that network-related bottlenecks are minimized is no longer optional — it’s a necessity. A well-optimized network can drastically reduce latency, improve throughput, and enhance the overall user experience. In this article, we’ll explore four critical strategies for boosting backend performance through network optimization. Let’s dive into the technical details and actionable insights.</p><h3>Hosting Backend Close to Users to Minimize Network Latency</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tSe4_x_pcBEfQanH5tGnHQ.png" /></figure><p>Latency, often described as the time it takes for data to travel from its source to its destination across a network, is a silent killer of application performance. The farther your backend servers are from your users, the longer it takes for requests and responses to traverse the network. This delay can be particularly noticeable for users engaging in real-time interactions, such as gaming, video streaming, or collaborative tools.</p><p>One of the most effective ways to combat latency is by hosting your backend infrastructure closer to your user base. This can be achieved through <strong>geographically distributed data centers</strong> or leveraging cloud providers with global regions, such as AWS, Google Cloud, or Azure. For instance, if a significant portion of your user base is in Europe, hosting your primary backend in a Frankfurt-based data center rather than in the US West Coast can shave off critical milliseconds from round-trip times (RTT).</p><p>Beyond physical proximity, <strong>Edge Computing</strong> takes this concept a step further by processing data at or near the source of user requests. By deploying backend services or microservices at edge locations, you reduce the distance data must travel, thus minimizing latency. This approach is particularly useful for applications requiring real-time data processing, such as IoT systems or live analytics dashboards.</p><p>However, proximity alone isn’t enough. It’s also essential to monitor and analyze network performance metrics using tools like Ping, Traceroute, or more advanced solutions like New Relic or Datadog. These tools help identify latency hotspots and ensure your hosting strategy aligns with user distribution.</p><h3>Utilization of HTTP Keep-Alive for Reducing Connection Overhead</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mpHKTcA_aRwRaWLtNLPOHg.png" /></figure><p>Every time a client (like a browser or mobile app) connects to a server, there’s an overhead associated with establishing a new TCP connection. This process, often referred to as the TCP handshake, involves multiple round trips to negotiate the connection before any actual data transfer begins. For applications with frequent client-server interactions, this overhead can accumulate, leading to significant performance degradation.</p><p>This is where <strong>HTTP Keep-Alive</strong> comes into play. HTTP Keep-Alive, also known as persistent connections, allows multiple requests and responses to be sent over a single TCP connection. Instead of closing the connection after each request (as was common in HTTP/1.0), the connection remains open for a specified duration, enabling subsequent requests to bypass the handshake process.</p><p>From a backend perspective, enabling Keep-Alive on your web server — whether it’s Nginx, Apache, or a custom Node.js setup — can significantly reduce latency and server resource consumption. For example, in Nginx, you can configure Keep-Alive by setting the keepalive_timeout directive in the server block:</p><pre>http {<br>    keepalive_timeout 15;<br>}</pre><p>This setting ensures that connections remain open for 15 seconds, allowing multiple requests within that window to reuse the same connection. However, it’s worth noting that while Keep-Alive reduces overhead, it can also tie up server resources if too many idle connections linger. Fine-tuning parameters like timeout duration and the maximum number of requests per connection is critical to balancing performance and resource usage.</p><p>Additionally, with the advent of HTTP/2 and HTTP/3, multiplexing and connection reuse are built into the protocol, further enhancing the benefits of persistent connections. If your backend supports these newer protocols, adopting them can provide even greater efficiency.</p><h3>Utilization of CDNs for Static and Frequently Accessed Assets</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BMQwNwSqpYlLHBiCyn9-QA.png" /></figure><p>Content Delivery Networks (CDNs) are a game-changer when it comes to optimizing network performance for static and frequently accessed assets like images, CSS files, JavaScript bundles, and videos. A CDN is a distributed network of servers strategically placed around the globe to cache and deliver content from locations close to the end user.</p><p>The primary benefit of using a CDN is the reduction in latency. When a user requests a static asset, the CDN serves it from the nearest edge server rather than fetching it from your origin server, which could be thousands of miles away. This not only speeds up delivery but also reduces the load on your backend infrastructure, allowing it to focus on dynamic content generation and business logic.</p><p>Popular CDN providers like Cloudflare, Akamai, and Amazon CloudFront offer robust features such as automatic caching, compression, and even DDoS protection. For instance, Cloudflare’s Smart Traffic Routing uses real-time network intelligence to route requests through the fastest paths, further optimizing performance.</p><p>To integrate a CDN into your backend workflow, start by identifying assets that rarely change and can be cached for long durations. Configure cache headers like Cache-Control to specify how long content should be cached at the CDN level. For example:</p><pre>Cache-Control: public, max-age=31536000</pre><p>This header instructs the CDN to cache the asset for one year, reducing unnecessary requests to the origin server. Additionally, ensure your backend invalidates or purges cached content when updates occur, either through API calls or manual intervention, to prevent stale data from being served.</p><p>One caveat to consider is the cost of CDN services, especially for high-traffic applications. However, the performance gains and reduced server load often outweigh the expense, making CDNs a worthwhile investment for most modern applications.</p><h3>Optimizing Backend Performance through Prefetching or Preloading Resources</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wAWTJAP3ikcCAgQ1phnDWg.png" /></figure><p>In a world where every millisecond counts, proactively loading resources before they’re explicitly requested can give your application a significant performance edge. <strong>Prefetching</strong> and <strong>preloading</strong> are techniques that anticipate user behavior and load resources in advance, reducing perceived latency and improving responsiveness.</p><p>Prefetching involves predicting which resources a user is likely to request next and fetching them in the background. For example, if a user is browsing a product catalog, the backend can prefetch images and data for the next few products based on scroll position or navigation patterns. This can be implemented using speculative requests triggered by client-side logic or server-side heuristics.</p><p>Preloading, on the other hand, focuses on loading critical resources as soon as possible during the initial page load. For instance, you can use the &lt;link rel=&quot;preload&quot;&gt; tag in HTML to instruct browsers to load essential assets like fonts or scripts early in the rendering process:</p><pre>&lt;link rel=&quot;preload&quot; href=&quot;/critical.css&quot; as=&quot;style&quot;&gt;</pre><p>From a backend perspective, supporting prefetching and preloading requires careful design. For prefetching, your API endpoints should be lightweight and optimized to handle speculative requests without overloading the server. Techniques like caching frequently prefetched data in memory using tools like Redis can further enhance performance. For preloading, ensure that your server prioritizes critical assets by setting appropriate response headers and leveraging server-side rendering (SSR) if applicable.</p><p>However, both techniques come with trade-offs. Overzealous prefetching can waste bandwidth and server resources if predictions are inaccurate, while preloading too many resources can delay the initial page load. Striking the right balance requires continuous monitoring and A/B testing to refine your strategy based on real user behavior.</p><h3>Conclusion: Building a Network-Optimized Backend</h3><p>Network performance is a critical pillar of backend optimization, influencing everything from user satisfaction to operational costs. By hosting your backend close to users, leveraging HTTP Keep-Alive, utilizing CDNs for static assets, and implementing prefetching or preloading, you can significantly enhance the speed and efficiency of your application.</p><p>Each of these strategies comes with its own set of challenges and considerations, but when executed thoughtfully, they can transform your backend into a high-performance engine capable of meeting the demands of modern users. Start small by identifying the most impactful areas for improvement — whether it’s reducing latency through better hosting or offloading static content to a CDN — and scale your efforts as you gain insights from performance metrics.</p><p>In the end, network optimization is not a one-time task but an ongoing journey. Stay proactive, keep experimenting, and always prioritize the end-user experience. After all, in the digital age, speed is not just a feature — it’s a competitive advantage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d6dba069550" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elevating System Reliability: Advanced Monitoring and Logging Techniques]]></title>
            <link>https://medium.com/@ebubekirergun/elevating-system-reliability-advanced-monitoring-and-logging-techniques-c1375853685c?source=rss-33e0680a5d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1375853685c</guid>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[logging]]></category>
            <category><![CDATA[observability]]></category>
            <dc:creator><![CDATA[Ebubekir ERGÜN]]></dc:creator>
            <pubDate>Mon, 26 May 2025 16:40:15 GMT</pubDate>
            <atom:updated>2025-05-26T16:40:15.760Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rpJXkwmmW-6Kir52pE3R5w.png" /></figure><p>Hey there! If you’re building software today, you know that keeping your app running smoothly is a big deal. Whether you’ve got a tiny .NET API or a massive network of services, being able to peek under the hood of your system is everything. That’s where <strong>monitoring</strong> and <strong>logging</strong> save the day. Monitoring is like having a live feed of your app’s vitals — think heart rate or blood pressure — while logging is more like a diary, jotting down every little thing that happens for when you need to figure out what went wrong.</p><p>In this piece, I’m gonna walk you through the ins and outs of observability. We’ll chat about building a solid monitoring and logging game plan, check out awesome tools like Prometheus, Grafana, and the ELK Stack for keeping tabs on your backend, and dig into asynchronous logging in .NET to make sure your app doesn’t slow down. I’ve got some hands-on .NET examples lined up, so let’s roll up our sleeves and get to it!</p><h3>1. Laying the Groundwork: Comprehensive Monitoring and Logging</h3><p>Before we jump into the nitty-gritty of tools and code, let’s take a quick step back and talk about why monitoring and logging are such a big deal. Picture this: monitoring is like the dashboard in your car, showing you speed, gas levels, and any warning lights in real time. Logging? That’s more like a travel journal, capturing every twist and turn of your trip so you can look back if something goes off track.</p><p>So, what does a solid monitoring and logging setup look like? Here’s my take:</p><ul><li><strong>Figure out what matters</strong>: What stats should you keep an eye on? Maybe it’s how fast your app responds, how often errors pop up, or how much CPU it’s chugging.</li><li><strong>Get ahead of trouble</strong>: Set up alerts to ping you when something’s fishy, way before your users start complaining.</li><li><strong>Keep everything in one spot</strong>: Pull logs and metrics from all your services into a single place so you’re not hunting around.</li><li><strong>Think big</strong>: Make sure your observability tools can keep up as your app grows, without slowing things down.</li></ul><p>If you don’t have these basics down, troubleshooting turns into a wild goose chase. Let’s see how we can put this into action with some real tools and .NET goodies.</p><h3>2. Backend Monitoring with Prometheus, Grafana, and the ELK Stack</h3><p>When it comes to keeping an eye on your backend, I’ve found that tools like <strong>Prometheus</strong>, <strong>Grafana</strong>, and the <strong>ELK Stack</strong> (that’s Elasticsearch, Logstash, and Kibana) are a killer combo. Prometheus and Grafana are fantastic for grabbing and displaying metrics, while ELK helps you wrangle and make sense of logs. Let’s break down how to hook these up with a .NET app.</p><h3>Prometheus and Grafana: Real-Time Metrics for .NET Applications</h3><p>Prometheus is this cool time-series database that stores and lets you query metrics, and when you pair it with Grafana, you get these slick dashboards to see what’s going on. It’s like having a live chart of your app’s health right in front of you.</p><p><strong>Example: Keeping Tabs on a .NET Core API with Prometheus and Grafana</strong></p><p>First off, grab the prometheus-net package for your .NET Core project to start exposing metrics. Just run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldfAS77nbp0WOrNpq-PpOQ.png" /></figure><p>Next, let’s set up a metrics endpoint in your app. I usually tweak Program.cs or add a controller like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nt21sZLIorY47mfs684Jgg.png" /></figure><p>Now, tell Prometheus where to look for these metrics by tweaking prometheus.yml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2ZnVvhgfkvp2YehaHT4kQ.png" /></figure><ol><li>Finally, hook Grafana up to Prometheus as a data source and whip up a dashboard. You can track stuff like api_calls_total or how long HTTP requests are taking.</li></ol><p>This setup lets you spot weird spikes in errors or slowdowns before they turn into a mess. Pretty neat, right?</p><h3>ELK Stack: Centralized Log Analysis for .NET</h3><p>Metrics show you what’s happening, but logs explain why. The ELK Stack is my go-to for gathering logs from everywhere across services and making sense of them.</p><p><strong>Example: Pushing .NET Logs to ELK with Serilog</strong></p><p>Start by adding the Serilog.Sinks.Elasticsearch package to your project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aR7yXDsxZdedrZoBwuqR1w.png" /></figure><p>Set up Serilog in Program.cs to send logs straight to Elasticsearch:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyBNMjTDBey5zEFXA1Yf7w.png" /></figure><p>Pop into Kibana to search through your logs or build dashboards to zero in on errors or specific user actions.</p><p>Pairing Prometheus, Grafana, and ELK gives you the full picture of your .NET backend — metrics for quick checks and logs for digging deep when something’s off.</p><h3>3. Asynchronous Logging Mechanisms: Keeping .NET Applications Performant</h3><p>Logging is a must, but if you’re not careful, it can bog down your app, especially when traffic spikes. Writing logs straight to disk or a server for every single request? That’s a recipe for slowdowns. <strong>Asynchronous logging</strong> is the fix — it lets you stash logs off to the side without holding up your app’s main work.</p><h3>Why Asynchronous Logging Matters</h3><p>Imagine your .NET API is getting slammed with thousands of requests a minute. If every one of those writes a log right then and there, the I/O lag can kill your performance. Asynchronous logging tosses those messages into a queue or hands them off to a background thread, so your app keeps humming along.</p><h3>Example: Asynchronous Logging in .NET with Serilog</h3><p>Serilog is one of my favorite logging tools for .NET, and it’s got built-in support for async logging through buffered sinks. Here’s how I set it up:</p><p>Grab the packages you’ll need:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4uAT7J-vOWQ9OLWpkDKboA.png" /></figure><p>Configure Serilog in Program.cs to buffer logs and write them asynchronously:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*90oz_iGEiiDha8K6yhu3Cg.png" /></figure><p>Here, WriteTo.Async() buffers the logs and writes them in the background, so I/O doesn’t stall your app. You can even extend this to push logs to remote systems like Elasticsearch asynchronously, like we did earlier.</p><h3>Tips for Asynchronous Logging</h3><ul><li><strong>Watch the Buffer</strong>: Set a reasonable buffer size so you don’t run out of memory when things get busy. Serilog’s bufferSize setting is handy for that.</li><li><strong>Don’t Lose Logs</strong>: Have a backup plan in case the background writer crashes, so you’re not missing crucial info.</li><li><strong>Keep an Eye on It</strong>: Funny enough, you should monitor your logging system too, just to catch any hiccups or slowdowns.</li></ul><p>Asynchronous logging in .NET lets you capture all the details you need without sacrificing speed.</p><h3>Embracing Observability for Resilient .NET Systems</h3><p>Monitoring and logging aren’t just checkboxes to tick off — they’re a way of thinking about how to build rock-solid systems. By putting together a strong observability plan, using tools like Prometheus, Grafana, and the ELK Stack, and fine-tuning with asynchronous logging in .NET, you’ll end up with apps that run smoothly and are a breeze to fix when they don’t.</p><p>Kick things off small: get metrics going for one .NET service with Prometheus and Grafana, tie logs into ELK, and play around with async logging via Serilog. The examples I’ve shared are just a starting point — tweak them to fit your setup and scale up from there. Observability isn’t something you “finish”; it’s a constant work in progress.</p><p>What’s been your biggest headache with monitoring or logging in .NET? Got any favorite tools or tricks up your sleeve? I’m all ears — drop your thoughts below, and let’s swap stories!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1375853685c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elevating Software Performance: Advanced Code Optimization Techniques for Developers]]></title>
            <link>https://medium.com/@ebubekirergun/elevating-software-performance-advanced-code-optimization-techniques-for-developers-338b1aa94960?source=rss-33e0680a5d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/338b1aa94960</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[performance-tuning]]></category>
            <category><![CDATA[code-optimization]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Ebubekir ERGÜN]]></dc:creator>
            <pubDate>Mon, 26 May 2025 15:57:26 GMT</pubDate>
            <atom:updated>2025-05-26T15:57:26.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OkHhuida9KUab8RJK99JJw.png" /></figure><p>In the realm of software development, code optimization is a critical skill that can transform applications from sluggish to seamless. Whether you’re handling massive data streams, building scalable systems, or refining algorithms, optimizing code enhances efficiency, reduces resource consumption, and elevates user satisfaction. In this comprehensive guide, we explore advanced strategies for code optimization, with a focus on practical, technical examples using .NET and other relevant technologies.</p><h3>1. Streaming of Large Requests and Responses</h3><p>Handling large data transfers, such as file uploads or downloads, can strain system resources if processed in a single block. Streaming allows developers to process data in smaller chunks, reducing memory usage and improving performance.</p><p><strong>Technical Example (.NET with Streams):</strong> Consider a .NET application for uploading large files to a server. Instead of loading the entire file into memory, you can use Stream to process the data incrementally.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528171%252C%2B184%252C%2B195%252C%2B1%2529%26t%3Dseti%26wt%3Dnone%26l%3Dauto%26width%3D680%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dusing%252520System%25253B%25250Ausing%252520System.IO%25253B%25250Ausing%252520System.Net.Http%25253B%25250Ausing%252520System.Threading.Tasks%25253B%25250A%25250Apublic%252520class%252520FileUploadHandler%25250A%25257B%25250A%252520%252520%252520%252520public%252520async%252520Task%252520UploadFileAsync%2528Stream%252520fileStream%25252C%252520string%252520destinationPath%2529%25250A%252520%252520%252520%252520%25257B%25250A%252520%252520%252520%252520%252520%252520%252520%252520using%252520%2528var%252520fileOutputStream%252520%25253D%252520new%252520FileStream%2528destinationPath%25252C%252520FileMode.Create%25252C%252520FileAccess.Write%2529%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520%25257B%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520byte%25255B%25255D%252520buffer%252520%25253D%252520new%252520byte%25255B8192%25255D%25253B%252520%25252F%25252F%2525208KB%252520chunks%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520int%252520bytesRead%25253B%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520while%252520%2528%2528bytesRead%252520%25253D%252520await%252520fileStream.ReadAsync%2528buffer%25252C%2525200%25252C%252520buffer.Length%2529%2529%252520%25253E%2525200%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%25257B%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520await%252520fileOutputStream.WriteAsync%2528buffer%25252C%2525200%25252C%252520bytesRead%2529%25253B%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%25257D%25250A%252520%252520%252520%252520%252520%252520%252520%252520%25257D%25250A%252520%252520%252520%252520%25257D%25250A%25257D%25250A&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528171%25252C%2B184%25252C%2B195%25252C%2B1%252529%26t%3Dseti%26wt%3Dnone%26l%3Dauto%26width%3D680%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D56px%26ln%3Dfalse%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D133%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dusing%25252520System%2525253B%2525250Ausing%25252520System.IO%2525253B%2525250Ausing%25252520System.Net.Http%2525253B%2525250Ausing%25252520System.Threading.Tasks%2525253B%2525250A%2525250Apublic%25252520class%25252520FileUploadHandler%2525250A%2525257B%2525250A%25252520%25252520%25252520%25252520public%25252520async%25252520Task%25252520UploadFileAsync%252528Stream%25252520fileStream%2525252C%25252520string%25252520destinationPath%252529%2525250A%25252520%25252520%25252520%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520using%25252520%252528var%25252520fileOutputStream%25252520%2525253D%25252520new%25252520FileStream%252528destinationPath%2525252C%25252520FileMode.Create%2525252C%25252520FileAccess.Write%252529%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520byte%2525255B%2525255D%25252520buffer%25252520%2525253D%25252520new%25252520byte%2525255B8192%2525255D%2525253B%25252520%2525252F%2525252F%252525208KB%25252520chunks%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520int%25252520bytesRead%2525253B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520while%25252520%252528%252528bytesRead%25252520%2525253D%25252520await%25252520fileStream.ReadAsync%252528buffer%2525252C%252525200%2525252C%25252520buffer.Length%252529%252529%25252520%2525253E%252525200%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520await%25252520fileOutputStream.WriteAsync%252528buffer%2525252C%252525200%2525252C%25252520bytesRead%252529%2525253B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525257D%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%2525257D%2525250A%25252520%25252520%25252520%25252520%2525257D%2525250A%2525257D%2525250A&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b9accea083a5572664da3a721c7f6cb/href">https://medium.com/media/7b9accea083a5572664da3a721c7f6cb/href</a></iframe><p>In this example, the file is read and written in 8KB chunks using Stream.ReadAsync and Stream.WriteAsync, ensuring minimal memory usage even for multi-gigabyte files. This approach is ideal for APIs handling large uploads in ASP.NET Core.</p><p><strong>Key Takeaway:</strong> Streaming is essential for handling large data transfers efficiently, preventing memory bottlenecks, and ensuring scalability.</p><h3>2. Identifying Performance Bottlenecks through Code Profiling</h3><p>Optimization begins with understanding where performance issues exist. Code profiling tools help developers analyze runtime behavior, identify slow methods, and detect resource-intensive operations.</p><p><strong>Technical Example (.NET with Visual Studio Diagnostic Tools):</strong> Imagine a .NET application processing large datasets that runs slower than expected. Using Visual Studio’s built-in Diagnostic Tools, you can profile the application to pinpoint bottlenecks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKFegHphBISvLC524t0sXA.png" /></figure><p>Run this code in Visual Studio with Diagnostic Tools enabled (Debug &gt; Windows &gt; Diagnostic Tools). The CPU Usage tab will show which methods, like ProcessData, consume the most time, guiding you to optimize the nested loops.</p><p><strong>Key Takeaway:</strong> Profiling tools, such as Visual Studio’s Diagnostic Tools or third-party options like JetBrains dotTrace, are invaluable for identifying and addressing performance bottlenecks.</p><h3>3. Optimization of Algorithms and Data Structures Used</h3><p>The choice of algorithms and data structures directly impacts performance. Optimizing these can reduce time complexity and memory usage, leading to faster execution.</p><p><strong>Technical Example (.NET with Dictionary vs List):</strong> Suppose you’re building a .NET application to store and retrieve user data by ID. Using a List&lt;T&gt; for lookups results in O(n) time complexity, whereas a Dictionary&lt;TKey, TValue&gt; offers O(1) lookups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_HfoMjmOT21XPpij0EIRxw.png" /></figure><p>By replacing a List&lt;User&gt; with a Dictionary&lt;int, string&gt;, lookups become significantly faster, especially for large datasets.</p><p><strong>Key Takeaway:</strong> Choosing the right data structure (e.g., Dictionary over List for key-based lookups) and optimizing algorithms can drastically improve performance.</p><h3>4. Utilizing Compiled Languages like Go or Rust</h3><p>While .NET offers excellent performance with JIT compilation, compiled languages like Go and Rust provide native machine code execution, lower memory overhead, and faster startup times, making them ideal for performance-critical components.</p><p><strong>Technical Context (Interfacing .NET with Go):</strong> For a .NET application requiring high-performance data processing, you might offload specific tasks to a Go microservice. Go compiles to machine code, offering faster execution for compute-intensive operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8BFT-M2oTPaY2oxa5jFRw.png" /></figure><p>In your .NET application, call this Go service using HttpClient:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eyib7eQ1Fnb8CH-zJgafOQ.png" /></figure><p><strong>Key Takeaway:</strong> Compiled languages like Go or Rust can complement .NET for performance-critical tasks, leveraging their speed and efficiency.</p><h3>5. Architectural Styles and Service Decomposition</h3><p>Adopting the right architectural style, such as microservices, can improve scalability and performance by decomposing monolithic applications into smaller, independent services.</p><p><strong>Technical Example (.NET with Microservices):</strong> In a monolithic .NET application, a single service might handle user authentication, order processing, and notifications. Decomposing this into microservices using ASP.NET Core allows each component to scale independently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cDBTaI8g9cKK4zYeGhMvmQ.png" /></figure><p>By isolating order processing, you can deploy and scale this service independently, optimizing resource allocation.</p><p><strong>Key Takeaway:</strong> Service decomposition through microservices enhances modularity, scalability, and performance in .NET applications.</p><h3>6. Managing Network Issues: Setting Appropriate Connection Timeouts and Implementing Efficient Retry Mechanisms</h3><p>Network latency and failures can degrade application performance. Configuring timeouts and retry policies ensures resilience and reliability.</p><p><strong>Technical Example (.NET with HttpClient and Polly):</strong> Using HttpClient in .NET with the Polly library, you can implement timeouts and retries for network requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tpLlxS6XVCOwX8CnR36pLg.png" /></figure><p>This setup ensures the request retries up to 3 times on failure and times out after 5 seconds, preventing hanging operations.</p><p><strong>Key Takeaway:</strong> Proper timeout and retry mechanisms in .NET applications mitigate network issues, ensuring robust performance.</p><h3>7. Minimizing Overhead Through Batch Processing</h3><p>Processing data in batches reduces overhead by minimizing the number of operations, such as database calls or API requests, performed individually.</p><p><strong>Technical Example (.NET with Entity Framework Core):</strong> In a .NET application using Entity Framework Core, inserting records one by one is inefficient. Batch processing can optimize this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKBy-Ol_KOYm4ernr3ha2g.png" /></figure><p>Using AddRange instead of individual Add calls minimizes database round-trips, significantly improving performance for large datasets.</p><p><strong>Key Takeaway:</strong> Batch processing in .NET reduces operational overhead, making data handling more efficient.</p><p><strong>Last but not least</strong></p><p>Code optimization is a multi-faceted effort that encompasses data flow, profiling bottlenecks, optimizing algorithms, leveraging compiled languages, adopting scalable architectures, managing network challenges, and implementing batch processing. By applying these strategies with tools like .NET, developers can build high-performance applications that meet modern demands. Start small by profiling your code, try these techniques and watch your software become a productivity powerhouse.</p><p>Feel free to share your optimization stories or challenges in the comments; I’d love to hear how you overcome performance barriers in your projects!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=338b1aa94960" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PKCS#7: Güvenli Mesajlar ve Sertifikaları Taşımak İçin Bir Veri Formatı]]></title>
            <link>https://medium.com/@ebubekirergun/pkcs-7-g%C3%BCvenli-mesajlar-ve-sertifikalar%C4%B1-ta%C5%9F%C4%B1mak-i%CC%87%C3%A7in-bir-veri-format%C4%B1-d2448f4ab3d1?source=rss-33e0680a5d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2448f4ab3d1</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[certification]]></category>
            <category><![CDATA[pkcs7]]></category>
            <category><![CDATA[encryption]]></category>
            <dc:creator><![CDATA[Ebubekir ERGÜN]]></dc:creator>
            <pubDate>Thu, 20 Apr 2023 15:36:09 GMT</pubDate>
            <atom:updated>2023-04-20T15:36:09.269Z</atom:updated>
            <content:encoded><![CDATA[<p>PKCS#7, güvenli elektronik iletişimde önemli bir rol oynayan, sertifikalar ve dijital imzaların taşınması için kullanılan bir veri formatıdır. Bu makalede, PKCS#7&#39;nin temel özellikleri, nasıl çalıştığı ve neden bu kadar önemli olduğu üzerinde duracağız.</p><p><strong>PKCS#7&#39;nin Temelleri:</strong></p><ul><li>PKCS (Public Key Cryptography Standards) serisinin bir parçası olarak, PKCS#7, güvenli ve özel iletişim sağlamak için tasarlanmıştır.</li><li>PKCS#7, dijital imzalar, veri şifreleme ve sertifika yönetimi gibi işlemler için kullanılabilen bir veri formatı sağlar.</li><li>S/MIME protokolünde ve diğer güvenli iletişim uygulamalarında yaygın olarak kullanılmaktadır.</li></ul><p><strong>PKCS#7&#39;nin Çalışma Prensibi:</strong></p><ul><li>PKCS#7, “zarf” olarak adlandırılan ve farklı türdeki verileri içerebilecek yapılar kullanır.</li><li>Zarflar, içerdiği veriye göre farklı işlemler yapabilen ve gerektiğinde veriyi güvenli bir şekilde taşıyabilen kapsayıcılar gibidir.</li><li>İçerik türüne bağlı olarak, zarflar şunları içerebilir: dijital imzalar, şifrelenmiş veriler, sertifikalar ve daha fazlası.</li></ul><p><strong>PKCS#7&#39;nin Özellikleri ve Avantajları:</strong></p><ul><li>Güçlü güvenlik ve gizlilik sağlar: PKCS#7, güçlü şifreleme ve dijital imza teknikleri kullanarak veri güvenliğini sağlar.</li><li>Esneklik ve uyumluluk: PKCS#7 formatı, farklı uygulamalar ve protokoller için uyumlu olacak şekilde tasarlanmıştır.</li><li>Sertifika yönetimi: PKCS#7, sertifikaların dağıtımı ve yönetimi için uygun bir araçtır.</li><li>S/MIME ve diğer protokollerle entegrasyon: PKCS#7, S/MIME gibi yaygın kullanılan protokollerle kolayca entegre edilebilir.</li></ul><p><strong>PKCS#7&#39;nin Kullanım Alanları:</strong></p><ul><li>Elektronik posta güvenliği: PKCS#7, e-postaların şifrelenmesi ve imzalanması için kullanılabilir.</li><li>Sertifika yönetimi ve dağıtımı: Sertifikaların dağıtılması ve yönetilmesi için güvenli bir araç sağlar.</li><li>Güvenli dosya paylaşımı: PKCS#7, dosyaların güvenli bir şekilde şifrelenmesi ve paylaşılması için kullanılabilir.</li><li>Web hizmetleri güvenliği: PKCS#7, web hizmetleri ve API’larda güvenli iletişim sağlamak için kullanılabilir.</li><li>Elektronik belge ve sözleşme imzalama: PKCS#7, elektronik belge ve sözleşmelerin imzalanması ve doğrulanması için kullanılabilir.</li></ul><p><strong>Toparlayacak olursak:<br></strong> PKCS#7, güvenli iletişim ve sertifika yönetimi için kritik bir veri formatıdır. Esnek yapısı ve güçlü güvenlik özellikleri sayesinde, PKCS#7 yaygın olarak s/MIME protokolü ve diğer güvenli iletişim uygulamalarında kullanılır. Sertifika yönetimi, güvenli dosya paylaşımı ve elektronik belge imzalama gibi çeşitli alanlarda kullanılabilen PKCS#7, günümüzün dijital dünyasında güvenliğin önemli bir parçasıdır.</p><p>Şimdi PKCS#7 kullanarak C# da sertifika kullanarak web api güvenliğini sağlamak adına bir örnek ile taçlandıralım.</p><p>Kullandığımız kütüphaneler şu şekilde ;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fr3t8alc1CT8Sd6c9VvvHg.png" /></figure><p>Fonksiyonlara geçecek olursak.</p><p>Öncelikle bir sertifikaya ihtiyacınız olacak. göndereceğiniz veri şifrelemek için EncrytpData fonksiyonuna yönlendirdikden sonra vermiş olduğunuz sertifika özellikleri kullanılarak, text datası şifrelenecek.<br>Şifrelenmiş olan datayı sonrasında SendEncryptedDataToApi fonksiyonuna yönlendirdiğinde, datanın apiUrl değişkenine tanımlanan url’e gönderileceğini göreceksiniz.</p><p>Size gelen şifreli verinin çözülmesi için DecryptData içersindeki business’ı izlemeniz yeterli olacaktır.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kvFlF_tjWqXv1-tCCZumnA.png" /></figure><p>Yukarıdaki örnek, bir API’ye şifreli veri gönderir ve şifreli bir yanıt alır. Bu örnek, güvenli iletişim için PKCS#7&#39;nin nasıl kullanılacağını gösterirken, gerçek bir senaryoda daha fazla hata yönetimi ve güvenlik önlemleri eklemeniz gerekebilir.</p><p>Ayrıca, API’nin de PKCS#7 ile şifreleme ve şifre çözmeyi desteklemesi gerektiğini unutmayın. API tarafında, gelen şifreli veriyi çözmek ve istemciye şifreli bir yanıt göndermek için uygun düzenlemeler yapılmalıdır.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2448f4ab3d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PKCS Nedir ? vol.1]]></title>
            <link>https://medium.com/@ebubekirergun/pkcs-nedir-vol-1-e173af848d33?source=rss-33e0680a5d96------2</link>
            <guid isPermaLink="false">https://medium.com/p/e173af848d33</guid>
            <category><![CDATA[pkcs]]></category>
            <category><![CDATA[decryption]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[rsa]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[Ebubekir ERGÜN]]></dc:creator>
            <pubDate>Tue, 14 Mar 2023 13:40:27 GMT</pubDate>
            <atom:updated>2023-04-20T15:39:51.653Z</atom:updated>
            <content:encoded><![CDATA[<h3>PKCS Nedir ve PKCS#1 Hakkında</h3><p>PKCS (Public Key Cryptography Standards), açık anahtarlı kriptografi kullanarak mesajların güvenli bir şekilde iletilmesini sağlamak için bir dizi standart belge setidir.</p><p>PKCS standartları, RSA Laboratories tarafından oluşturulmuştur ve açık anahtarlı kriptografi ile ilgili birçok farklı konuyu ele alır. Bu standartlar, dijital imzalar, anahtar yönetimi, şifreleme anahtarları, kimlik doğrulama ve diğer birçok konuda rehberlik sağlar.</p><p>PKCS standartları arasında en yaygın olarak kullanılanlar şunlardır:</p><ol><li>PKCS#1: RSA şifreleme ve dijital imzalar için protokoller sağlar.</li><li>PKCS#7: Güvenli mesajları ve sertifikaları taşımak için bir veri formatı tanımlar.</li><li>PKCS#8: Özel anahtarları depolamak için bir format tanımlar.</li><li>PKCS#10: X.509 sertifikaları talep etmek için bir protokol tanımlar.</li><li>PKCS#11: Donanım ve yazılım tabanlı kriptografik cihazları yönetmek için bir API tanımlar.</li><li>PKCS#12: Özel anahtarları, sertifikaları ve diğer güvenlik verilerini bir dosya biçiminde saklamak için bir standart belirler.</li></ol><p>PKCS standartları, özellikle internet ve diğer geniş ağlarda güvenli bir iletişim sağlamak için önemlidir. Bu standartlar, dijital imzalama, kimlik doğrulama ve veri gizliliği gibi kriptografik teknolojilerin kullanımını yaygınlaştırmış ve güvenli bir iletişim altyapısı oluşturulmasına yardımcı olmuştur.</p><h3>PKCS#1</h3><p>PKCS#1 standardı, RSA algoritmasının şifreleme ve dijital imza işlemleri için gereksinimlerini belirler. Şifreleme için, mesajlar önce RSA şifreleme işlemi kullanılarak şifrelenir ve ardından bir dolgu mekanizması kullanılarak mesajın boyutu şifrelenen anahtarın boyutuna uyacak şekilde ayarlanır. Dijital imzalar için ise, mesajın özet değeri özel anahtarla şifrelenir ve bu şifreleme, dijital imza olarak kullanılır.</p><p>PKCS#1 ayrıca, anahtar çiftlerinin oluşturulması, depolanması ve işlenmesi için protokoller de belirler. Özel anahtarlar özel bir formatta saklanır ve şifreleme işlemlerinde kullanılırken, açık anahtarlar açık bir şekilde paylaşılır ve şifreleme işlemlerinde kullanılır.</p><p>PKCS#1 standardı, özellikle internet üzerinde güvenli bir iletişim için dijital imza ve şifreleme teknolojileri kullanılırken, mesajların güvenli bir şekilde taşınmasını sağlamak için önemlidir. Bu standart, açık anahtarlı kriptografinin en temel protokollerinden biridir ve birçok uygulamada kullanılan temel bileşenlerden biridir.</p><p><em>PKCS1# Kod Parçası</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B24PsoaDpiT8NXsDdl0B4Q.png" /></figure><p>Bu örnek, 2048 bitlik bir anahtar çifti oluşturur ve ardından bir mesajı şifreler ve deşifreler. Anahtar çiftleri ExportParameters() yöntemi kullanılarak elde edilir ve şifreleme/ deşifreleme işlemleri için RSACryptoServiceProvider sınıfı kullanılır.</p><p><em>PKCS1# Başka Bir Örnek</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FaBzVT2RVmeC4yArWwhbgw.png" /></figure><p>Bu örnek,Rsa anahtar çiftini oluşturur ve ardından XML formatında şifreleme ve deşifreleme yapar.</p><p><em>PKCS1# Başka Bir Örnek</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvJTAfiE85-lfTmzbYkzNw.png" /></figure><p>Bu program, öncelikle bir RSACryptoServiceProvider nesnesi oluşturur ve ToXmlString() yöntemini kullanarak açık anahtarını XML formatında alır. Daha sonra, RSAEncrypt() yöntemiyle, açık anahtar ve şifrelenecek mesajı kullanarak mesajı RSA şifreleme işlemi kullanarak şifreler. Şifreli mesaj, RSADecrypt() yöntemiyle özel anahtar kullanılarak çözülür ve sonuç Console.WriteLine() yöntemiyle ekrana yazdırılır.</p><p><em>Son Olarak</em></p><p>PKCS, şifreleme ve kimlik doğrulama gibi kritik güvenlik işlevlerinde kullanılan önemli bir standarttır. Bu standart, birçok farklı uygulamada ve teknolojide yaygın olarak kullanılmaktadır ve bu sayede internet güvenliği, dijital imza ve daha birçok alanda güvenliği sağlamaktadır.</p><p>Bu makalede PKCS’nin önemini ve kullanımını vurgulamaya çalıştık. Umarız bu makale, PKCS hakkında daha fazla bilgi edinmenize yardımcı olmuştur. PKCS’nin güvenliği ve bütünlüğü sağlamak için önemli bir rol oynadığını unutmayın.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e173af848d33" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>