<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: karaa</title>
    <description>The latest articles on Forem by karaa (@karaa1122).</description>
    <link>https://forem.com/karaa1122</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3171474%2Fc91c84bf-ab01-4ac2-9407-c7184dbf96b7.jpeg</url>
      <title>Forem: karaa</title>
      <link>https://forem.com/karaa1122</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/karaa1122"/>
    <language>en</language>
    <item>
      <title>The Hardest Part About Being a Backend Developer Right Now</title>
      <dc:creator>karaa</dc:creator>
      <pubDate>Sat, 16 May 2026 21:42:17 +0000</pubDate>
      <link>https://forem.com/karaa1122/the-hardest-part-about-being-a-backend-developer-right-now-4np7</link>
      <guid>https://forem.com/karaa1122/the-hardest-part-about-being-a-backend-developer-right-now-4np7</guid>
      <description>&lt;p&gt;It’s not learning new frameworks.&lt;/p&gt;

&lt;p&gt;It’s not debugging distributed systems.&lt;/p&gt;

&lt;p&gt;It’s not scaling APIs.&lt;/p&gt;

&lt;p&gt;It’s staying motivated while job searching.&lt;/p&gt;

&lt;p&gt;Over the last few months I’ve:&lt;/p&gt;

&lt;p&gt;optimized resumes&lt;br&gt;
redesigned GitHub profiles&lt;br&gt;
solved coding problems&lt;br&gt;
improved portfolio projects&lt;br&gt;
applied to remote jobs daily&lt;/p&gt;

&lt;p&gt;And honestly? It gets mentally draining after a while.&lt;/p&gt;

&lt;p&gt;But during this process I realized something valuable:&lt;/p&gt;

&lt;p&gt;The strongest skill you can build as an engineer is consistency.&lt;/p&gt;

&lt;p&gt;Even while searching for opportunities, I kept building:&lt;/p&gt;

&lt;p&gt;NestJS microservices&lt;br&gt;
Django REST APIs&lt;br&gt;
CQRS/event-driven workflows&lt;br&gt;
RabbitMQ integrations&lt;br&gt;
scalable backend architectures&lt;/p&gt;

&lt;p&gt;One thing I’ve learned:&lt;br&gt;
real-world projects teach more than endless tutorial consumption.&lt;/p&gt;

&lt;p&gt;If you’re a developer struggling in the current market:&lt;br&gt;
keep shipping projects.&lt;br&gt;
Keep documenting what you learn.&lt;br&gt;
Keep improving your fundamentals.&lt;/p&gt;

&lt;p&gt;The market changes constantly, but strong engineering skills stay valuable.&lt;/p&gt;

&lt;p&gt;Right now I’m continuing to focus on backend engineering, distributed systems, and scalable application architecture — and sharing more of that journey publicly.&lt;/p&gt;

&lt;p&gt;What backend technology are you currently learning or building with?&lt;/p&gt;

</description>
      <category>backend</category>
      <category>career</category>
      <category>productivity</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>🚀 Mastering select_for_update() in Django: Prevent Race Conditions the Right Way</title>
      <dc:creator>karaa</dc:creator>
      <pubDate>Fri, 06 Jun 2025 20:47:31 +0000</pubDate>
      <link>https://forem.com/karaa1122/mastering-selectforupdate-in-django-prevent-race-conditions-the-right-way-4l56</link>
      <guid>https://forem.com/karaa1122/mastering-selectforupdate-in-django-prevent-race-conditions-the-right-way-4l56</guid>
      <description>&lt;p&gt;Handling concurrency in your Django applications? Then you’ll want to make friends with &lt;code&gt;select_for_update()&lt;/code&gt;. This handy ORM method helps lock database rows during a transaction, ensuring that your data stays consistent—even under high load.&lt;/p&gt;

&lt;p&gt;Let’s break it down with a real-world use case.&lt;/p&gt;

&lt;p&gt;🔍 What Is &lt;code&gt;select_for_update()&lt;/code&gt;?&lt;br&gt;
In short: it locks rows in the database until the end of the transaction, preventing other transactions from modifying or acquiring a lock on those rows.&lt;/p&gt;

&lt;p&gt;It’s especially useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inventory systems&lt;/li&gt;
&lt;li&gt;Bank transfers&lt;/li&gt;
&lt;li&gt;Purchasing Ticket&lt;/li&gt;
&lt;li&gt;Preventing double submission&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🛒 Example: Locking a Product Row During Checkout&lt;br&gt;
suppose you’re building an e-commerce backend where users can buy products. You need to ensure that the stock count is accurate—even if 10 users try to buy the same product at once.&lt;/p&gt;

&lt;p&gt;Here’s how to use &lt;code&gt;select_for_update()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from django.db import transaction
from .models import Product

def purchase_product(product_id, quantity):
    with transaction.atomic():
        product = Product.objects.select_for_update().get(id=product_id)

        if product.stock &amp;gt;= quantity:
            product.stock -= quantity
            product.save()
            return True
        else:
            return False
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What’s happening here?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We start a transaction using &lt;code&gt;transaction.atomic()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;We lock the product row with &lt;code&gt;select_for_update()&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The row stays locked until the block exits.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;⚙️ Advanced Usage&lt;br&gt;
You can customize the locking behavior with a few extra options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Product.objects.select_for_update(nowait=True).get(id=product_id)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;nowait=True&lt;/code&gt;: raises an error if the row is already locked.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;skip_locked=True&lt;/code&gt;: skips locked rows entirely (useful for task queues).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧠 Final Thoughts&lt;br&gt;
Locking rows at the database level is a powerful tool—but with great power comes great responsibility. Use &lt;code&gt;select_for_update()&lt;/code&gt; wisely.&lt;/p&gt;

&lt;p&gt;Want to take your Django database handling to the next level? Start by locking smarter. 🔒&lt;/p&gt;

&lt;p&gt;💬 Got questions or use cases? Drop them in the comments—let’s nerd out about transactions and Django internals.&lt;/p&gt;

</description>
      <category>django</category>
      <category>api</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
