<?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 Melihciray on Medium]]></title>
        <description><![CDATA[Stories by Melihciray on Medium]]></description>
        <link>https://medium.com/@melihciray?source=rss-54e37a33284c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AvH2g7i6U0TZe_l7</url>
            <title>Stories by Melihciray on Medium</title>
            <link>https://medium.com/@melihciray?source=rss-54e37a33284c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 18:47:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@melihciray/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[Mistakes I Made While Choosing a Time-Series Database]]></title>
            <link>https://medium.com/@melihciray/mistakes-i-made-while-choosing-a-time-series-database-900c2550ace8?source=rss-54e37a33284c------2</link>
            <guid isPermaLink="false">https://medium.com/p/900c2550ace8</guid>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[timeseries-database]]></category>
            <dc:creator><![CDATA[Melihciray]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 13:35:30 GMT</pubDate>
            <atom:updated>2026-01-05T14:13:04.126Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Lessons Learned from IoT and Real-Time Systems</em></p><h3>Introduction — Why I’m Writing This</h3><p>Choosing a Time-Series Database (TSDB) often looks straightforward at first. However, once you start working with high-frequency data — especially in IoT and real-time systems — the decision becomes far more complex than expected.</p><p>While working on such a system, I made several TSDB-related decisions based largely on documentation, benchmarks, and theoretical assumptions. Since I didn’t have the opportunity to validate all of these decisions in long-running production environments, some of my initial assumptions started to break down over time.</p><p>In this article, I want to share the <strong>mistakes I made while evaluating InfluxDB and TimescaleDB</strong>, and what I would approach differently if I were making the same decision today.</p><p>This is not a “which TSDB is better?” article.</p><p>It’s a reflection on how <strong>asking the wrong questions early</strong> can lead to costly architectural decisions later.</p><h3>What Is a Time-Series Database? (Briefly)</h3><p>Time-Series Databases are designed to store and query data points indexed by time, enabling efficient time-based queries and aggregations.</p><p>They are commonly used in:</p><ul><li>IoT systems</li><li>Monitoring and metrics platforms</li><li>Real-time analytics</li><li>Financial time-series data</li></ul><p>However, this definition alone is not enough to choose the right TSDB.</p><h3>❌ Mistake #1: Focusing Only on Write Performance</h3><p>My first — and biggest — mistake was evaluating a Time-Series Database almost entirely based on <strong>write throughput</strong>.</p><p>When dealing with high-frequency data streams, the main question I kept asking myself was:</p><blockquote><em>“How much data per second can this database ingest?”</em></blockquote><p>What I failed to define clearly was <strong>how this data would be read and consumed</strong>.</p><p>Over time, important questions remained unanswered:</p><ul><li>What kind of queries will power dashboards?</li><li>How complex will time-range and device-based aggregations be?</li><li>How will alerting and threshold checks work?</li></ul><p>That’s when it became clear:</p><blockquote><em>Focusing only on write performance means leaving half of the system design undefined.</em></blockquote><h3><strong>❌ Mistake #2: Not Planning Retention and Downsampling Early</strong></h3><p>A common pitfall in Time-Series architecture is failing to define the data lifecycle from the start. This oversight is rarely due to simple procrastination or a “let’s decide later” mindset. Instead, it is often driven by a fear of losing detail:</p><p><strong>“If we downsample the data, we lose granularity. We need to keep the raw data in case we need to perform deep retrospective analysis in the future.”</strong></p><p>While the motivation is a genuine concern for <strong>data fidelity</strong>, in Time-Series systems, data volume grows rapidly — and this growth directly impacts:</p><ul><li>Storage costs</li><li>Query performance</li><li>Operational complexity</li></ul><p>When retention policies and downsampling strategies are not planned early on, the massive amounts of raw data preserved “just in case” eventually become a burden that cripples the system. The key takeaway is clear:</p><p><strong>In Time-Series systems, designing the data lifecycle is just as important as designing the data model.</strong></p><h3>❌ Mistake #3: Confusing Product Convenience with Architectural Simplicity</h3><p><em>(InfluxDB UI and Organizations)</em></p><p>InfluxDB’s built-in UI and organization-based structure felt extremely convenient during the evaluation phase. Being able to visualize data, build dashboards, and manage access from a single panel significantly reduced friction.</p><p>In hindsight, I realized I had <strong>mistaken product convenience for architectural simplicity</strong>.</p><p>While this approach offers:</p><ul><li>Fast onboarding</li><li>Low setup cost</li><li>Fewer initial components</li></ul><p>it also tightly couples:</p><ul><li>Visualization</li><li>Alerting</li><li>Access control</li></ul><p>directly to the database itself.</p><blockquote><em>A product being “easy to use” doesn’t necessarily mean the architecture is simple or flexible.</em></blockquote><h3>❌ Mistake #4: Locking Alerting and Automation Logic Inside the Database</h3><p><em>(InfluxDB Tasks &amp; Alerts)</em></p><p>InfluxDB’s Tasks and Alerts provide a very convenient way to implement thresholds, periodic checks, and webhook-based automation.</p><p>However, this convenience comes at a cost:</p><blockquote><em>Alerting and automation logic become deeply embedded in the database.</em></blockquote><p>This approach:</p><ul><li>Reduces testability</li><li>Makes versioning harder</li><li>Increases the responsibility of the database</li></ul><p>My mistake was treating alerting as a <strong>database feature</strong> rather than an <strong>application-level concern</strong>.</p><h3>❌ Mistake #5: Misjudging the Impact of Cardinality</h3><p><em>(AWS + InfluxDB v2)</em></p><p>When using a managed InfluxDB v2 time-series service on AWS, I observed that Tasks could introduce significant system load.</p><p>As the number and frequency of Tasks increased:</p><ul><li>The API became less responsive</li><li>Queries and writes slowed down</li><li>The service appeared “healthy” but was effectively unusable</li></ul><h3>⚠️ A Critical Limitation: No Manual Restart</h3><p>In a self-hosted setup, restarting the service would be the obvious fix.</p><p>However, in a managed AWS environment:</p><ul><li>Manual restarts are not available</li><li>AWS does not automatically restart the service</li></ul><p>In practice, the only way to recover was to <strong>trigger a configuration change</strong>, such as increasing storage from <strong>100 GB to 150 GB</strong>, which indirectly caused the service to restart.</p><p>This made one thing very clear:</p><blockquote><em>In managed environments, every database feature also carries operational risk.</em></blockquote><h3>❌ Mistake #6: Misjudging the Impact of Cardinality</h3><p>One area where I did spend time researching and made a conscious decision was <strong>cardinality</strong>.</p><p>I was aware early on that cardinality plays a critical role in Time-Series Databases, especially in InfluxDB, where each unique combination of measurement, tag keys, and tag values creates a distinct series.</p><p>Based on this, I deliberately avoided common pitfalls such as:<br> — Storing highly dynamic values as tags<br> — Treating identifiers like device IDs as unbounded dimensions</p><p>From a modeling perspective, this was the correct decision.</p><p>However, what I underestimated was not the concept itself, but <strong>how dominant cardinality becomes as a constraint over time</strong> — influencing memory usage, query behavior, and overall system predictability more than I initially expected.</p><p>The lesson here wasn’t <em>“I ignored cardinality”</em>, but rather:</p><blockquote><em>Even when cardinality is handled correctly, it remains one of the strongest forces shaping the architecture of a Time-Series system.</em></blockquote><h3>❌ Mistake #7: Underestimating the Long-Term Impact of Query Language Choice</h3><p><em>(SQL vs Flux)</em></p><p>I also underestimated how important the query language would be in the long run.</p><p>Flux is powerful and expressive, but it comes with trade-offs:</p><ul><li>Steep learning curve</li><li>Harder debugging</li><li>Difficult team-wide standardization</li><li>Less intuitive for SQL-oriented teams</li></ul><p>As queries become more complex, Flux scripts tend to grow longer and harder to maintain.</p><p>My mistake was treating the query language as a minor technical detail.</p><p>TimescaleDB’s use of SQL, on the other hand:</p><ul><li>Leverages existing knowledge</li><li>Integrates easily with BI and dashboarding tools</li><li>Improves long-term maintainability</li></ul><blockquote><em>SQL isn’t just a query language — it’s an ecosystem language.</em></blockquote><h3>🔄 InfluxDB v2 → v3 and the TimescaleDB Perspective</h3><p>The transition from InfluxDB v2 to v3 was not a typical upgrade.</p><blockquote><em>It represented a fundamental architectural shift.</em></blockquote><p>This reinforced an important realization:</p><blockquote><em>Choosing a Time-Series Database also means committing to how much your architecture may need to change in the future.</em></blockquote><p>With TimescaleDB:</p><ul><li>Alerting and automation typically live in the application layer</li><li>The database has a clearer, more focused responsibility</li><li>Operational behavior in cloud environments is more predictable</li></ul><h3>What I Would Do Differently Today</h3><p>If I were making the same decision again, I would:</p><ul><li>Define query patterns before choosing a database</li><li>Plan retention and downsampling from day one</li><li>Treat cardinality as an architectural concern</li><li>Keep alerting and automation logic in the application layer</li><li>Factor in <strong>operational limits of managed cloud services</strong></li></ul><h3>Conclusion</h3><p>Time-Series Database selection is often treated as a purely technical comparison.</p><p>In reality, it determines <strong>how your system evolves, how it’s operated, and how much control you retain</strong>.</p><p>The biggest lesson I learned is this:</p><blockquote><em>Poor TSDB decisions usually come from incorrect assumptions, not bad technology choices.</em></blockquote><p>If I were starting over, I wouldn’t ask:</p><blockquote><em>“Which database is faster?”</em></blockquote><p>I would ask:</p><blockquote><em>“Who will operate this system six months from now — and how?”</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=900c2550ace8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Generating Fake Data in Python with Faker: A Guide for Testing and Development]]></title>
            <link>https://medium.com/@melihciray/generating-fake-data-in-python-with-faker-a-guide-for-testing-and-development-8f47e9237c9c?source=rss-54e37a33284c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f47e9237c9c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Melihciray]]></dc:creator>
            <pubDate>Fri, 01 Nov 2024 13:23:00 GMT</pubDate>
            <atom:updated>2024-11-01T14:30:22.959Z</atom:updated>
            <content:encoded><![CDATA[<p>In software development, testing with real data isn’t always practical or safe. This is where the Python library <strong>Faker</strong> comes into play. Faker is an efficient way to generate dummy data, making it a valuable tool for developers and testers. In this article, we’ll walk through what Faker is, how it works, and practical examples of generating data for various purposes.</p><h3>Introduction to Faker</h3><p><strong>Subheading: What is Faker?</strong> Faker is a popular Python library that generates fake data across various data types, such as names, addresses, emails, and more. Whether you’re developing a new feature, testing a data pipeline, or setting up a database schema, Faker can help you populate your project with data that looks real but isn’t tied to actual individuals.</p><h3>Installing and Setting Up Faker</h3><p><strong>Subheading: How to Install Faker</strong> To get started with Faker, you’ll need to install it using pip. This is a quick process and only takes a few commands.</p><pre>pip install faker</pre><p><strong>Setting Up Faker</strong><br>After installing Faker, import it into your project and create a Faker instance. This will allow you to call various methods to generate the data you need.</p><pre>from faker import Faker<br>fake = Faker()</pre><h3>Generating Different Types of Data</h3><p><strong>Subheading: Basic Data Examples</strong> Once you have Faker set up, you can start generating data. Faker supports numerous data types, including:</p><ul><li><strong>Personal Data</strong>: fake.name(), fake.email(), fake.phone_number()</li><li><strong>Location Data</strong>: fake.address(), fake.city(), fake.country()</li><li><strong>Business Data</strong>: fake.company(), fake.job()</li><li><strong>Financial Data: </strong>fake.creadit_card_number(), fake.credit_card_provider(),fake.currency_name()</li><li><strong>Network and Web Data</strong>: fake.url(),fake.ipv4(),fake.password()</li><li><strong>Date and time Data</strong>: fake.date(),fake.time(),fake.date_time()</li><li><strong>Sentence and paragraph</strong>: fake.sentence(),fake.paragraph(),fake.text()</li></ul><h3>Advanced Usage with Faker</h3><p><strong>Using Faker for Testing and Mocking</strong><br>Faker is useful for creating large datasets for testing purposes. It’s also highly useful for mocking data in web development, where you might need fake profiles, product data, or random transactions.</p><p><strong>Subheading: Handling Multiple Locales</strong><br>Faker supports multiple languages, allowing developers to create data specific to various regions and cultures. To use different locales, simply specify the locale when creating your Faker instance:</p><pre>fake = Faker(&#39;tr_TR&#39;)  # For Turkish data<br>print(&quot;turkish name:&quot;, fake.name())</pre><p>Example:</p><pre><br># 1. Personal Information<br>print(&quot;Name:&quot;, fake.name())  # Generates a full name (e.g., &quot;John Doe&quot;)<br>print(&quot;Name and Surname:&quot;, fake.first_name(), fake.last_name())  # Generates a first and last name separately (e.g., &quot;John&quot; &quot;Doe&quot;)<br>print(&quot;E-mail:&quot;, fake.email())  # Generates a random email address (e.g., &quot;johndoe@example.com&quot;)<br>print(&quot;Phone Number:&quot;, fake.phone_number())  # Generates a random phone number in the US format (e.g., &quot;(555) 555-5555&quot;)<br>print(&quot;Birth Date:&quot;, fake.date_of_birth())  # Generates a random birth date (e.g., &quot;1980-07-21&quot;)<br><br># 2. Address Information<br>print(&quot;Address:&quot;, fake.address())  # Generates a full address with street, city, state, and ZIP code<br>print(&quot;City:&quot;, fake.city())  # Generates a city name (e.g., &quot;New York&quot;)<br>print(&quot;ZIP Code:&quot;, fake.zipcode())  # Generates a ZIP code (e.g., &quot;10001&quot;)<br>print(&quot;Country:&quot;, fake.country())  # Generates a country name (e.g., &quot;United States&quot;)<br><br># 3. Company Information<br>print(&quot;Company Name:&quot;, fake.company())  # Generates a company name (e.g., &quot;Acme Corp&quot;)<br>print(&quot;Job Title:&quot;, fake.job())  # Generates a random job title (e.g., &quot;Software Engineer&quot;)<br>print(&quot;Company Email:&quot;, fake.company_email())  # Generates a random company email (e.g., &quot;johndoe@acmecorp.com&quot;)<br><br># 4. Financial Information<br>print(&quot;Credit Card Number:&quot;, fake.credit_card_number())  # Generates a credit card number (e.g., &quot;1234-5678-9876-5432&quot;)<br>print(&quot;Credit Card Type:&quot;, fake.credit_card_provider())  # Generates a type of credit card (e.g., &quot;Visa&quot;)<br>print(&quot;Currency:&quot;, fake.currency_name())  # Generates a currency name (e.g., &quot;US Dollar&quot;)<br><br># 5. Internet and Web Information<br>print(&quot;URL:&quot;, fake.url())  # Generates a random website URL (e.g., &quot;https://example.com&quot;)<br>print(&quot;IP Address:&quot;, fake.ipv4())  # Generates an IPv4 address (e.g., &quot;192.168.1.1&quot;)<br>print(&quot;Username:&quot;, fake.user_name())  # Generates a random username (e.g., &quot;johndoe123&quot;)<br>print(&quot;Password:&quot;, fake.password())  # Generates a random password (e.g., &quot;password123!&quot;)<br><br># 6. Date and Time Information<br>print(&quot;Date:&quot;, fake.date())  # Generates a random date (e.g., &quot;2023-11-01&quot;)<br>print(&quot;Time:&quot;, fake.time())  # Generates a random time (e.g., &quot;14:35:29&quot;)<br>print(&quot;Date and Time:&quot;, fake.date_time())  # Generates a full date and time (e.g., &quot;2023-11-01 14:35:29&quot;)<br><br># 7. Color and Image Information<br>print(&quot;Hex Color Code:&quot;, fake.hex_color())  # Generates a random hex color code (e.g., &quot;#a3b2c1&quot;)<br>print(&quot;Color Name:&quot;, fake.color_name())  # Generates a color name (e.g., &quot;Blue&quot;)<br>print(&quot;Image URL:&quot;, fake.image_url())  # Generates a random image URL (e.g., &quot;https://placeimg.com/640/480/any&quot;)<br><br># 8. Random Text and Paragraphs<br>print(&quot;Sentence:&quot;, fake.sentence())  # Generates a random sentence (e.g., &quot;The cat ran away.&quot;)<br>print(&quot;Paragraph:&quot;, fake.paragraph())  # Generates a paragraph of random text<br>print(&quot;Random Text:&quot;, fake.text())  # Generates a random block of text</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f47e9237c9c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby Showdown: unless vs. if – The Ultimate Face-Off!]]></title>
            <link>https://medium.com/@melihciray/ruby-showdown-unless-vs-if-the-ultimate-face-off-133770268e1a?source=rss-54e37a33284c------2</link>
            <guid isPermaLink="false">https://medium.com/p/133770268e1a</guid>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[ruby-on-rails-development]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Melihciray]]></dc:creator>
            <pubDate>Fri, 18 Oct 2024 12:42:44 GMT</pubDate>
            <atom:updated>2024-10-18T12:42:44.668Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey there, Ruby enthusiasts! If you’ve been coding in Ruby for a while, you’ve probably encountered a little drama between two famous control flow keywords: if and unless. Think of them as two sides of the same coin, with if being the eternal optimist and unless bringing a slightly more skeptical vibe. In this article, we’ll break down the differences between these two Ruby stars, sprinkle in a bit of humor, and hopefully save you from any conditional confusion. Let&#39;s dive in!</p><p><strong>Meet the </strong><strong>if: The Optimist</strong><br>Ah, the classic if! It’s the control flow we all know and love. Whenever you want to do something if a condition is true, if is your best buddy. It’s straightforward, like a friend who always says, “Sure, if it’s sunny, let’s go out!”</p><pre>if sunny<br>  puts &quot;Let&#39;s go out and enjoy the sun!&quot;<br>end</pre><p>In this code, if sunny is true, we get to enjoy the great outdoors. If not? Well, it’s a couch and Netflix day. Simple, right?</p><p><strong>Enter </strong><strong>unless: The Skeptic</strong><br>Now, let’s talk about unless. This one’s a bit like your friend who always thinks the glass is half empty. It’s perfect when you want to do something only when a condition is false. Think of unless as saying, “Nah, I’ll only go out if it’s <em>not</em> raining.”</p><pre>unless raining<br>  puts &quot;Let&#39;s go out and enjoy the sun!&quot;<br>end</pre><p>So, if raining is false, we’ll go out and bask in the sun. If raining is true, we’re staying in. unless flips the logic on its head, making it ideal for those cases where you’re focusing on what you <em>don’t</em> want to happen.</p><p><strong>The Subtle Differences: Because It’s Never That Simple</strong></p><p><strong>1.Readability</strong><br>Here’s where the fun begins. if tends to be more intuitive because we’re all used to thinking in positive terms. But unless can make your code more readable when you’re dealing with negative conditions. For example, compare these:</p><pre>if !sunny<br>  puts &quot;Better grab an umbrella!&quot;<br>end<br><br># vs.<br><br>unless sunny<br>  puts &quot;Better grab an umbrella!&quot;<br>end</pre><p>Which one reads better? The unless version is often clearer when you’re talking about negative conditions. It’s like a quick way of saying, “I don’t want to do this unless...” (Get it?)</p><p><strong>2.Gotchas: Nested Logic Is a No-Go</strong><br>Let’s face it, life isn’t always simple, and neither are conditionals. If you ever try to nest an unless inside an if or vice versa, you might end up scratching your head.</p><pre>if user_signed_in<br>  unless admin<br>    puts &quot;Welcome, user!&quot;<br>  end<br>end</pre><p>This is perfectly valid, but <em>please</em>, for the sake of your future self (and any other developers reading your code), keep it simple. When things start looking like a logic puzzle, it’s usually better to just use if.</p><p><strong>3. Modifiers: The Short and Sweet Sidekick</strong></p><p>Ruby is all about making code look clean and elegant. Both if and unless can be used as modifiers:</p><pre>puts &quot;Welcome, guest!&quot; if user.nil?<br>puts &quot;Welcome, guest!&quot; unless user</pre><p>Here, they both do the same thing, but the choice between if and unless comes down to how you want to frame your condition. Feeling positive? Use if. Feeling a little contrarian? Go with unless.</p><p><strong>When to Use </strong><strong>if and When to Use </strong><strong>unless: A Cheat Sheet</strong></p><ul><li>Use if when you’re checking for something that is true.</li><li>Use unless when you’re checking for something that is false, especially if it makes the code more readable.</li><li>Avoid using unless with multiple conditions. It’s like trying to play chess in your head—it can get messy fast!</li></ul><pre># Good:<br>puts &quot;Welcome!&quot; unless user_signed_in<br><br># Bad:<br>unless user_signed_in &amp;&amp; account_active<br>  puts &quot;You can&#39;t access this page.&quot;<br>end</pre><p>See that? It’s like unless trying too hard to be complex. Stick with if when you have multiple conditions to juggle.</p><p><strong>Conclusion:</strong><br>At the end of the day, if and unless are just two sides of Ruby’s personality. if is your go-to for most scenarios, but unless is a great sidekick when you want to focus on things that shouldn’t happen. Choose the one that makes your code easier to read and understand, and your future self (and teammates) will thank you. Happy coding, and may your conditionals always be clear!</p><p>Feel free to share your unless and if adventures in the comments below! Or, better yet, let me know if you’ve ever found yourself in an unless-loop that drove you up the wall. 😉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=133770268e1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[İnsan Gibi Göster! Django Humanize ile Verilere Ruh Kat]]></title>
            <link>https://medium.com/@melihciray/i%CC%87nsan-gibi-g%C3%B6ster-django-humanize-ile-verilere-ruh-kat-e581d2be65a4?source=rss-54e37a33284c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e581d2be65a4</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[template-filter]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Melihciray]]></dc:creator>
            <pubDate>Tue, 08 Oct 2024 09:12:25 GMT</pubDate>
            <atom:updated>2024-10-08T10:01:00.861Z</atom:updated>
            <content:encoded><![CDATA[<p>Django, bildiğimiz gibi, “Beni kodla!” diye bağıran harika bir framework. Ama bir süre sonra, elimizdeki verilerin o soğuk, robotik hali gözümüze batmaya başlıyor. Milyonlarca sayı ekrana vurunca gözünüzde dolar işaretleri mi beliriyor? Tarihler sizi geçmişe mi götürüyor? <strong>Django </strong><strong>humanize filtreleri</strong> bu noktada imdadınıza yetişiyor! Gelin, ham verileri nasıl insan dostu hale getirebiliriz, hep birlikte bakalım.</p><h3>Nedir Bu Humanize?</h3><p>humanize, Django’nun içinde saklı bir hazine. Klasik veri gösterimlerini, daha insan gözüne hitap eden şekillerde göstermenizi sağlayan bir koleksiyon filtre. Hem de bunu sadece <strong>tek bir satırla</strong> yapabiliyorsunuz. Nasıl mı? İşte tarifi:</p><ul><li>Sayılar? Sıkıcı ve karışık! humanize ile virgüller ekleyelim, kelimelere dönüştürelim!</li><li>Tarihler? 3 ay önceki bir tarih mi? Bir bakalım… humanize ile bunu &quot;dün&quot;, &quot;bugün&quot; gibi gösterelim!</li><li>Zamanlar mı? 5 dakika önce bir veri mi kaydedildi? Hemen doğal dilde bunu verelim!</li></ul><p>Eğer bunu kullanmak isterseniz, şablonlarınıza basit bir “yükleme” işlemi yapıyorsunuz:</p><pre>{% load humanize %}</pre><p>Biraz sonra, verilerinize insan ruhu katmaya başlayabilirsiniz!</p><h3>humanize Entegrasyonu Nasıl Yapılır?</h3><ol><li><strong>humanize modülünü etkinleştirin:</strong></li><li>Django’nun humanize modülü varsayılan olarak gelir, yani ek bir paket kurmanıza gerek yoktur. Ancak, projede bu özelliği kullanabilmek için settings.py dosyasına küçük bir ekleme yapmanız gerekiyor.</li></ol><pre># settings.py<br>INSTALLED_APPS = [<br>    ...<br>    &#39;django.contrib.humanize&#39;,<br>]</pre><p>Bu adım, projede humanize modülünü aktif hale getirir. Eğer bu adımı atlarsanız, şablonlarınızda humanize fonksiyonlarını kullanmaya çalıştığınızda hata alırsınız.</p><h3>En Sevilen Filtreler — Humanize Gururla Sunar!</h3><h3>1. intcomma: Sayıları Böl ve Fethet!</h3><p>Herkes büyük sayıları sever… ta ki onları okumak zorunda kalana kadar! 1234567 sayısı kafanızı karıştırıyorsa, işte yardımınıza koşan intcomma:</p><pre>{{ 1234567|intcomma }}</pre><p>Ve sonuç? 🎉: 1,234,567</p><p>Artık “1 milyon mu, 1 trilyon mu?” diye kafa yormak zorunda değilsiniz. Virgüller sihirli dokunuşu yapıyor!</p><h3>2. intword: Sayılar Kelimelere Dönüşsün!</h3><p>Bazı sayılar o kadar büyük ki, kelimelere dökülmek zorundalar. Kaç kişinin bu kadar zengin olduğunu bile düşünmek zor. İşte intword filtresi tam burada devreye giriyor:</p><pre>{{ 1000000|intword }}</pre><p>Sonuç? 💸: 1.0 million</p><p>Yani, bir bakıma “paranın lafı olmaz” diyenlerdenseniz, işte size sayıları küçültmenin eğlenceli bir yolu!</p><h3>3. naturalday: “Bugün, Yarın, Dün” Ustalığı</h3><p>Tarihler bazen baş belası olabilir. Ama humanize&#39;ın <strong>naturalday</strong> filtresiyle tarihleri daha anlamlı hale getirebilirsiniz. Mesela, bir etkinlik dün olmuşsa, neden hala &quot;8 Ekim 2024&quot; olarak yazalım ki?</p><pre>{{ some_date|naturalday }}</pre><p>Sonuç? 🕰: yesterday</p><p>Artık geçmişte yaşadığınızı hatırlatan tarihleri doğal şekilde görebilirsiniz.</p><h3>4. naturaltime: Zamanı İnsan Gibi Hissettir!</h3><p>Birkaç dakika önce mi oturum açıldı? naturaltime ile bu durumu &quot;şimdi&quot; gibi göstermek çok basit:</p><pre>{{ some_time|naturaltime }}</pre><p>Sonuç? ⏳: 3 hours ago</p><p>Zamanı insan gibi algılayalım, rakamlara boğulmayalım!</p><h3>5. ordinal: Sayılara Havalı Bir Sıralama Ekle</h3><p>Kim birinci olmak istemez ki? Ama işte bunu ordinal filtresi olmadan nasıl havalı hale getirirsiniz? Onları birinci, ikinci, üçüncü yapın!</p><pre>{{ 1|ordinal }}</pre><p>Sonuç? 🥇: 1st</p><p>Artık sıralamalar daha eğlenceli!</p><h3>Neden Humanize Kullanmalısınız?</h3><ul><li><strong>Kullanıcı Dostu:</strong> Kim karmaşık sayılar ve tarihler görmek ister ki? Verilerinizi insan gözüne hitap edecek şekilde göstermek daha iyi bir kullanıcı deneyimi sağlar.</li><li><strong>Esprili Bir Hava:</strong> “1.234,567” görmek yerine “1.2 million” yazmak, ziyaretçilerinizi daha fazla mutlu eder. Sonuçta gözlerimiz ekrandaki tüm o sayılar için yapılmadı, değil mi?</li><li><strong>Zamandan Tasarruf:</strong> Tüm bu güzellikleri elle yapmak yerine humanize filtrelerini kullanmak size zaman kazandırır.</li></ul><h3>Humanize ile Şov Yapın!</h3><p>Sonuç olarak, Django humanize ile verilerinizi daha sempatik ve okunabilir hale getirmek çok basit. İnsanların sayılardan ve tarihlerden korkmamasını sağlayacak bu ufak dokunuşlar, kullanıcı arayüzünüzü bir adım ileriye taşıyacak. <strong>Bırakın veriler insan gibi konuşsun!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e581d2be65a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>