<?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>DEV Community: Alex Beygi</title>
    <description>The latest articles on DEV Community by Alex Beygi (@alex-beygi).</description>
    <link>https://dev.to/alex-beygi</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%2F1789094%2Fc98e157b-2180-45c8-a594-134585feb307.jpg</url>
      <title>DEV Community: Alex Beygi</title>
      <link>https://dev.to/alex-beygi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alex-beygi"/>
    <language>en</language>
    <item>
      <title>How to Build a Great Dev Team (That Actually Works)</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Tue, 17 Mar 2026 13:40:14 +0000</pubDate>
      <link>https://dev.to/alex-beygi/how-to-build-a-great-development-team-that-actually-works-49cc</link>
      <guid>https://dev.to/alex-beygi/how-to-build-a-great-development-team-that-actually-works-49cc</guid>
      <description>&lt;p&gt;Building a high-performing development team isn’t just about hiring the best engineers or choosing the right tech stack. Many companies obsess over systems, processes, and productivity frameworks—but overlook the most important factor:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Start With a People-First Culture
&lt;/h2&gt;

&lt;p&gt;When building a team, the instinct is often to optimize for performance: faster delivery, better output, more efficiency.&lt;/p&gt;

&lt;p&gt;But here’s the paradox:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The most productive teams are not the most pressured—they are the most supported.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When people feel safe, respected, and valued, they naturally perform better. A healthy environment creates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Higher engagement&lt;/li&gt;
&lt;li&gt;Better collaboration&lt;/li&gt;
&lt;li&gt;Stronger long-term output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you build the best system in the world but place the wrong people in it, it will fail.&lt;br&gt;
People are the foundation—not the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Trust Is Everything
&lt;/h2&gt;

&lt;p&gt;At the core of every great team is one thing: trust.&lt;/p&gt;

&lt;p&gt;Without trust&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Processes break down&lt;/li&gt;
&lt;li&gt;Communication becomes defensive&lt;/li&gt;
&lt;li&gt;Productivity drops&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many organisations try to fix problems by adding more rules and policies. But often, these systems are just “scar tissue”—reactions to past mistakes rather than real solutions.&lt;/p&gt;

&lt;p&gt;Instead of asking:&lt;/p&gt;

&lt;h2&gt;
  
  
  “How do we prevent this from ever happening again?”
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ASK:&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  “Why did this happen in the first place?”
&lt;/h2&gt;

&lt;p&gt;Great teams solve root problems, not just symptoms.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Hire the Right People—and the Right Managers
&lt;/h2&gt;

&lt;p&gt;A strong culture starts at the top—but it doesn’t survive unless it flows through good managers.&lt;/p&gt;

&lt;p&gt;A great manager is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Empathetic&lt;/li&gt;
&lt;li&gt;Honest&lt;/li&gt;
&lt;li&gt;Supportive&lt;/li&gt;
&lt;li&gt;Willing to advocate for their team&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ask yourself this simple question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“Would I want to work for this person?”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Great managers don’t just report problems—they:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defend their team&lt;/li&gt;
&lt;li&gt;Support growth&lt;/li&gt;
&lt;li&gt;Even challenge leadership when needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bad managers, on the other hand, can destroy even the best culture.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Define Your Values Clearly
&lt;/h2&gt;

&lt;p&gt;Before hiring or scaling your team, you need clarity:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does success look like?&lt;/li&gt;
&lt;li&gt;What do we stand for?&lt;/li&gt;
&lt;li&gt;What behaviors do we reward—and reject?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Without clear values:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Good people may still fail&lt;/li&gt;
&lt;li&gt;Teams become misaligned&lt;/li&gt;
&lt;li&gt;Expectations become unclear&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Strong values create:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alignment&lt;/li&gt;
&lt;li&gt;Psychological safety&lt;/li&gt;
&lt;li&gt;Better decision-making&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;For example, a healthy dev team might value:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Work-life balance over hustle culture&lt;/li&gt;
&lt;li&gt;Diversity of thought (“weird means interesting”)&lt;/li&gt;
&lt;li&gt;Psychological safety (“you’ve already made it”)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Values aren’t just words—they guide hiring, feedback, and daily behavior.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Integrity Over Image
&lt;/h2&gt;

&lt;p&gt;It’s easy to talk about culture.&lt;br&gt;
It’s much harder to live it—especially when things go wrong.&lt;/p&gt;

&lt;p&gt;True integrity means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Being consistent in good and bad times&lt;/li&gt;
&lt;li&gt;Doing what you said you would do&lt;/li&gt;
&lt;li&gt;Not overpromising&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many leaders act supportive—until pressure hits.&lt;br&gt;
That’s when real culture is revealed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Integrity means being the same person in every situation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If your team can rely on that consistency, trust grows naturally.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Build a Culture of Radical Candor
&lt;/h2&gt;

&lt;p&gt;One of the biggest killers of team performance is poor communication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Great teams practice radical candor:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be honest&lt;/li&gt;
&lt;li&gt;Be direct&lt;/li&gt;
&lt;li&gt;Be kind&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This doesn’t mean being harsh.&lt;br&gt;
It means caring enough to tell the truth—even when it’s uncomfortable.&lt;/p&gt;

&lt;p&gt;A strong communication culture looks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Feedback is immediate, not delayed&lt;/li&gt;
&lt;li&gt;Problems are discussed openly&lt;/li&gt;
&lt;li&gt;Conflict is handled constructively&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many teams avoid difficult conversations in the name of “being nice.”&lt;br&gt;
But that creates hidden frustration and toxicity.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Healthy teams don’t avoid conflict—they handle it well.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. Encourage Collaboration Over Competition
&lt;/h2&gt;

&lt;p&gt;In weak cultures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers compete&lt;/li&gt;
&lt;li&gt;Knowledge is hoarded&lt;/li&gt;
&lt;li&gt;People protect their position&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In strong cultures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers help each other&lt;/li&gt;
&lt;li&gt;Knowledge is shared&lt;/li&gt;
&lt;li&gt;The team grows together&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is to create a “team brain”—where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Everyone contributes&lt;/li&gt;
&lt;li&gt;Everyone learns&lt;/li&gt;
&lt;li&gt;Everyone supports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This leads to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster problem solving&lt;/li&gt;
&lt;li&gt;Better innovation&lt;/li&gt;
&lt;li&gt;Stronger team cohesion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  8. Support Your Team Beyond Work
&lt;/h2&gt;

&lt;p&gt;A great dev team isn’t just about code—it’s about life.&lt;/p&gt;

&lt;p&gt;If your team is worried about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Health&lt;/li&gt;
&lt;li&gt;Family&lt;/li&gt;
&lt;li&gt;Finances&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They can’t perform at their best.&lt;/p&gt;

&lt;p&gt;Support can include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flexible working hours&lt;/li&gt;
&lt;li&gt;Learning budgets (books, courses, conferences)&lt;/li&gt;
&lt;li&gt;Health and wellbeing support&lt;/li&gt;
&lt;li&gt;Real understanding of personal challenges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best companies ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What matters most to our people—and how can we help?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  9. Create the Workplace You’d Want
&lt;/h2&gt;

&lt;p&gt;This is the ultimate test:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you were an employee, would you want to work here?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communication style&lt;/li&gt;
&lt;li&gt;Work-life balance&lt;/li&gt;
&lt;li&gt;Leadership behavior&lt;/li&gt;
&lt;li&gt;Growth opportunities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the answer is no, something needs to change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building a great development team isn’t about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hiring “10x developers”&lt;/li&gt;
&lt;li&gt;Forcing productivity&lt;/li&gt;
&lt;li&gt;Adding more processes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Trust&lt;/li&gt;
&lt;li&gt;Communication&lt;/li&gt;
&lt;li&gt;Integrity&lt;/li&gt;
&lt;li&gt;Care&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you focus on people first, everything else follows.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Build a place where people want to work—and you’ll naturally build a team that performs.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Understanding RabbitMQ Exchange Types: Direct, Fanout, and Topic</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Sun, 08 Feb 2026 16:40:58 +0000</pubDate>
      <link>https://dev.to/alex-beygi/understanding-rabbitmq-exchange-types-direct-fanout-and-topic-4i45</link>
      <guid>https://dev.to/alex-beygi/understanding-rabbitmq-exchange-types-direct-fanout-and-topic-4i45</guid>
      <description>&lt;p&gt;RabbitMQ is a message broker that implements the AMQP (Advanced Message Queuing Protocol). At the heart of RabbitMQ’s routing model lies the exchange. Exchanges are responsible for receiving messages from producers and routing them to one or more queues based on defined rules.&lt;/p&gt;

&lt;p&gt;Choosing the correct exchange type is critical for building scalable, correct, and maintainable systems—especially in real-time systems such as chat, notifications, and event-driven architectures.&lt;/p&gt;

&lt;p&gt;This article explains the three most commonly used exchange types—Direct, Fanout, and Topic—and demonstrates how each routes messages, when to use them, and common mistakes to avoid.&lt;/p&gt;

&lt;h2&gt;
  
  
  Core Concepts Recap
&lt;/h2&gt;

&lt;p&gt;Before diving into exchange types, it’s important to understand a few fundamental components:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Producer:&lt;/strong&gt; Sends messages to an exchange.&lt;br&gt;
&lt;strong&gt;Exchange:&lt;/strong&gt; Routes messages to queues based on rules.&lt;br&gt;
&lt;strong&gt;Queue:&lt;/strong&gt; Stores messages until they are consumed.&lt;br&gt;
&lt;strong&gt;Binding:&lt;/strong&gt; A rule that links a queue to an exchange.&lt;br&gt;
&lt;strong&gt;Routing Key:&lt;/strong&gt; A string attached to a message, used by the exchange to decide where the message goes.&lt;/p&gt;

&lt;p&gt;An exchange never stores messages. It only decides where messages should be routed.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Direct Exchange
&lt;/h2&gt;

&lt;p&gt;How Direct Exchange Works&lt;br&gt;
A direct exchange routes messages to queues only if the routing key exactly matches the binding key.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Routing is deterministic&lt;/li&gt;
&lt;li&gt;Matching is strict equality&lt;/li&gt;
&lt;li&gt;No pattern matching is performed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's take at a PHP/Laravel example: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install the client:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require php-amqplib/php-amqplib&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example &lt;code&gt;.env&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;Q_HOST=127.0.0.1
MQ_PORT=5672
MQ_USER=guest
MQ_PASS=guest
MQ_VHOST=/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Typical connection factory (recommended to reuse in services):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use PhpAmqpLib\Connection\AMQPStreamConnection;
 embed function mqConnection(): AMQPStreamConnection {
    return new AMQPStreamConnection(
        env('MQ_HOST'),
        env('MQ_PORT'),
        env('MQ_USER'),
        env('MQ_PASS'),
        env('MQ_VHOST')
    ); 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Publish to a Direct Exchange
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use PhpAmqpLib\Message\AMQPMessage;

public function publishOrderCreated(array $payload)
{
    $connection = mqConnection();
    $channel = $connection-&amp;gt;channel();

    $exchange = 'orders.direct';
    $queue    = 'orders.created.queue';
    $key      = 'order.created';

    // Topology
    $channel-&amp;gt;exchange_declare($exchange, 'direct', false, true, false);
    $channel-&amp;gt;queue_declare($queue, false, true, false, false);
    $channel-&amp;gt;queue_bind($queue, $exchange, $key);

    $msg = new AMQPMessage(json_encode($payload), [
        'content_type'  =&amp;gt; 'application/json',
        'delivery_mode' =&amp;gt; AMQPMessage::DELIVERY_MODE_PERSISTENT,
    ]);

    $channel-&amp;gt;basic_publish($msg, $exchange, $key);

    $channel-&amp;gt;close();
    $connection-&amp;gt;close();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Consumer for a Direct Queue (manual ack)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$channel-&amp;gt;basic_qos(null, 1, null);

$channel-&amp;gt;basic_consume('orders.created.queue', '', false, false, false, false,
    function ($msg) {
        $data = json_decode($msg-&amp;gt;body, true);

        try {
            // process...
            $msg-&amp;gt;ack();
        } catch (\Throwable $e) {
            $msg-&amp;gt;nack(false, true); // requeue on failure
        }
    }
);

while ($channel-&amp;gt;is_consuming()) {
    $channel-&amp;gt;wait();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When to Use Direct Exchange&lt;/p&gt;

&lt;p&gt;Task queues (background jobs)&lt;/p&gt;

&lt;h2&gt;
  
  
  Worker pools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Point-to-point messaging&lt;/li&gt;
&lt;li&gt;Routing messages to a specific consumer group&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Characteristics
&lt;/h2&gt;

&lt;p&gt;✔ Predictable routing&lt;br&gt;
✔ High performance&lt;br&gt;
❌ Not suitable for broadcast&lt;br&gt;
❌ No pattern matching&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Fanout Exchange
&lt;/h2&gt;

&lt;p&gt;How Fanout Exchange Works&lt;/p&gt;

&lt;p&gt;A fanout exchange routes messages to all bound queues, ignoring the routing key entirely.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Routing key is irrelevant&lt;/li&gt;
&lt;li&gt;Every bound queue receives a copy&lt;/li&gt;
&lt;li&gt;Pure broadcast semantics&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Visual Explanation
&lt;/h2&gt;

&lt;p&gt;In the diagram’s Fanout Exchange section:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The producer sends a message&lt;/li&gt;
&lt;li&gt;The fanout exchange delivers the message to Queue X, Queue Y, and Queue Z&lt;/li&gt;
&lt;li&gt;All consumers receive the same message independently&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  When to Use (Chat Example)
&lt;/h2&gt;

&lt;p&gt;Fanout is perfect when multiple servers must receive the same message, such as a chat system where multiple WebSocket nodes need to forward messages to connected clients.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ws.node1.queue&lt;/li&gt;
&lt;li&gt;ws.node2.queue&lt;/li&gt;
&lt;li&gt;ws.node3.queue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every node receives the message and delivers it to clients connected to that node.&lt;/p&gt;
&lt;h2&gt;
  
  
  Laravel Example: Publish to Fanout (Chat Broadcast)
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use PhpAmqpLib\Message\AMQPMessage;

public function broadcastChatMessage(array $payload)
{
    $connection = mqConnection();
    $channel = $connection-&amp;gt;channel();

    $exchange = 'chat.fanout';

    $channel-&amp;gt;exchange_declare($exchange, 'fanout', false, true, false);

    $msg = new AMQPMessage(json_encode($payload), [
        'content_type' =&amp;gt; 'application/json',
    ]);

    // routing key is ignored for fanout; pass '' conventionally
    $channel-&amp;gt;basic_publish($msg, $exchange, '');

    $channel-&amp;gt;close();
    $connection-&amp;gt;close();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Fanout Consumers: Each server has its own queue
&lt;/h2&gt;

&lt;p&gt;On WebSocket Server 1:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$exchange = 'chat.fanout';
$queue = 'ws.server1.queue';

$channel-&amp;gt;exchange_declare($exchange, 'fanout', false, true, false);
$channel-&amp;gt;queue_declare($queue, false, true, false, false);
$channel-&amp;gt;queue_bind($queue, $exchange);

$channel-&amp;gt;basic_consume($queue, '', false, true, false, false, function($msg) {
    // push to local websocket clients
    echo "server1 received: {$msg-&amp;gt;body}\n";
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On WebSocket Server 2: same pattern but ws.server2.queue.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Result: all websocket servers receive each message and forward to their connected users.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Topic Exchange
&lt;/h2&gt;

&lt;p&gt;How Topic Exchange Works&lt;/p&gt;

&lt;p&gt;A topic exchange routes messages using pattern matching on routing keys.&lt;/p&gt;

&lt;p&gt;Topic exchanges route messages based on patterns in routing keys (dot-separated words):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wildcards:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;* matches exactly one word&lt;br&gt;
 # matches zero or more words&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example routing key:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;embed logs.error.app1&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example bindings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;logs.error.* ✅&lt;/li&gt;
&lt;li&gt;logs.*.app1 ✅&lt;/li&gt;
&lt;li&gt;logs.# ✅ &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Topic is best for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;event buses in microservices&lt;/li&gt;
&lt;li&gt;routing by domain + action + sub-type&lt;/li&gt;
&lt;li&gt;logging/event pipelines&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Laravel Example: Topic Exchange for Events
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use PhpAmqpLib\Message\AMQPMessage;

public function publishEvent(string $routingKey, array $payload)
{
    $connection = mqConnection();
    $channel = $connection-&amp;gt;channel();

    $exchange = 'events.topic';

    $channel-&amp;gt;exchange_declare($exchange, 'topic', false, true, false);

    $msg = new AMQPMessage(json_encode($payload), [
        'content_type' =&amp;gt; 'application/json',
    ]);

    $channel-&amp;gt;basic_publish($msg, $exchange, $routingKey);

    $channel-&amp;gt;close();
    $connection-&amp;gt;close();
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Bind Consumers by Pattern
&lt;/h2&gt;

&lt;h2&gt;
  
  
  All logs for app1:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$queue = 'logs.app1.all.queue';
$channel-&amp;gt;queue_declare($queue, false, true, false, false);
$channel-&amp;gt;queue_bind($queue, 'events.topic', 'logs.#.app1');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Everything:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$queue = 'logs.all.queue';
$channel-&amp;gt;queue_bind($queue, 'events.topic', '#');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Direct vs Fanout vs Topic: Choosing Correctly
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;Best Exchange&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One specific queue processes each message&lt;/td&gt;
&lt;td&gt;Direct&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Broadcast to every consumer&lt;/td&gt;
&lt;td&gt;Fanout&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Flexible routing with patterns&lt;/td&gt;
&lt;td&gt;Topic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chat broadcast to many WebSocket nodes&lt;/td&gt;
&lt;td&gt;Fanout&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Event bus across services&lt;/td&gt;
&lt;td&gt;Topic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worker queues (jobs)&lt;/td&gt;
&lt;td&gt;Direct&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Common Production Notes (Laravel):
&lt;/h2&gt;

&lt;p&gt;1) Don’t auto-ack unless losing messages is acceptable&lt;/p&gt;

&lt;p&gt;In your earlier consumer, you used no_ack=true. That makes delivery at-most-once (messages can be lost on crash). For real systems, prefer manual ack.&lt;/p&gt;

&lt;p&gt;2) Use durable topology for reliability&lt;/p&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;durable=true for exchanges/queues&lt;/li&gt;
&lt;li&gt;delivery_mode=PERSISTENT for messages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3) Prefer long-running workers (Artisan + Supervisor)&lt;/p&gt;

&lt;p&gt;Consumers should be CLI workers (Supervisor/systemd/Docker), not HTTP requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Direct:&lt;/strong&gt; exact routing, ideal for job workers.&lt;br&gt;
&lt;strong&gt;Fanout:&lt;/strong&gt; pure broadcast, perfect for chat/WebSocket clusters.&lt;br&gt;
&lt;strong&gt;Topic:&lt;/strong&gt; pattern routing, best for event buses and log pipelines.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>microservices</category>
    </item>
    <item>
      <title>The Rising Complexity of Modern CSS</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Wed, 26 Nov 2025 10:07:59 +0000</pubDate>
      <link>https://dev.to/alex-beygi/the-rising-complexity-of-modern-css-5a09</link>
      <guid>https://dev.to/alex-beygi/the-rising-complexity-of-modern-css-5a09</guid>
      <description>&lt;p&gt;Modern CSS is nothing short of incredible. It gives us the tools to craft rich, interactive, and visually stunning experiences on the web. But with this surge in capability comes a new weakness—not in CSS itself, but in the way we work with it.&lt;/p&gt;

&lt;p&gt;When I started my career as a web developer, writing CSS often meant inventing hacks to work around what it couldn’t do. Those days are far behind us. Today, CSS offers advanced layout systems, 3D transformations, and highly flexible animation tools.&lt;/p&gt;

&lt;p&gt;Yet most of the challenges we face in modern CSS aren’t about missing features—they stem from how we author it. This is why the future of CSS might not live in plain text files at all, but in visual creation tools.&lt;/p&gt;

&lt;p&gt;That idea might sound outrageous at first, but bear with me—I’ll try to make the case.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Growing Complexity of Color
&lt;/h2&gt;

&lt;p&gt;Developers have spent years building intuition around HEX and RGB. But new colour models like OKLCH require us to rethink that mental map entirely. You might instantly recognise a colour like #FF00FF, but &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/color_value/oklch" rel="noopener noreferrer"&gt;oklch&lt;/a&gt;(0.7017 0.3225 328.36) is far less intuitive.&lt;/p&gt;

&lt;p&gt;In the 2025 State of CSS survey, only 12% of respondents said they had tried any of the new level-4, wide-gamut color spaces and had a positive experience.&lt;/p&gt;

&lt;p&gt;Gradients: A Perfect Case for Visual Tools&lt;/p&gt;

&lt;p&gt;Gradients are a clear example of where visual editors shine.&lt;/p&gt;

&lt;p&gt;Without something like &lt;a href="https://gradient.style" rel="noopener noreferrer"&gt;https://gradient.style&lt;/a&gt;, working with gradients quickly becomes frustrating. Human brains simply aren’t built to imagine what a gradient such as:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;linear-gradient(in srgb, 37deg, #8dea81 0%, #92d3d2 100%)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;will look like—especially when different interpolation colour spaces can dramatically alter the result.&lt;/p&gt;

&lt;h2&gt;
  
  
  Animations: Even More Dependent on Visual Editing
&lt;/h2&gt;

&lt;p&gt;Nowhere is this issue more apparent than with animation timing functions.&lt;/p&gt;

&lt;p&gt;Translating sets of coordinates into a bezier curve—and then picturing how that curve will animate an element—is not something most people can do mentally. Tools that allow you to see and manipulate these curves visually are essentially required.&lt;/p&gt;

&lt;p&gt;The newer linear() interpolation function unlocks some amazing possibilities—like mimicking realistic physical motion—but creating “spring” or “bounce” curves manually is nearly impossible without visual guidance.&lt;/p&gt;

&lt;p&gt;Keyframe animations have the same problem. Basic from/to sequences are simple enough, but once you introduce multiple keyframes, editing and fine-tuning them becomes tedious. A dedicated keyframe editor removes that friction entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Falling Behind the CSS Working Group
&lt;/h2&gt;

&lt;p&gt;In the past, browser support was the main obstacle to adopting new CSS features. That’s no longer true. For example, offset-path has been fully supported in all major browsers since 2022—yet in the 2025 State of CSS survey, only 30% of participants even knew it existed.&lt;/p&gt;

&lt;p&gt;As the specification grows, remembering how each feature works becomes increasingly difficult. Many new CSS capabilities see slow adoption simply because developers can’t keep up.&lt;/p&gt;

&lt;h2&gt;
  
  
  More Advanced Features on the Horizon
&lt;/h2&gt;

&lt;p&gt;The brand-new &lt;code&gt;shape()&lt;/code&gt; and &lt;code&gt;path()&lt;/code&gt; functions are incredibly powerful, but crafting them manually can be tedious.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;clip‑path: shape(from 87% 0.5%, hline to 1%, curve to 16% 52% with 1% 1% / 17% 17%, curve to 1% 100% with 16% 87% / 1% 100%, hline to 87%, curve to 100% 52% with 87% 100% / 100% 89%, curve to 87% 1% with 100% 15% / 87% 1%, close);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Other impressive features—like mask-image, offset-path, and conic-gradient—will likely remain underused simply because writing the CSS for them is so complex.&lt;/p&gt;

&lt;h2&gt;
  
  
  A New Era of CSS Tools
&lt;/h2&gt;

&lt;p&gt;CSS has grown beyond what traditional text editors are comfortable handling—and that’s worth celebrating. Many developers already rely on visual tools to build gradients, paths, and animation timing functions, but these tools can go even further.&lt;/p&gt;

&lt;p&gt;Not only do visual tools make it easier to define colours, gradients, and animations—they also introduce developers to features they may not have known about. &lt;/p&gt;

&lt;p&gt;When new CSS capabilities are paired with intuitive visual interfaces, they become far more approachable and much easier to incorporate into everyday work.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>webdesign</category>
      <category>website</category>
    </item>
    <item>
      <title>Everything about Next.js 16</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Thu, 13 Nov 2025 09:16:14 +0000</pubDate>
      <link>https://dev.to/alex-beygi/everything-about-nextjs-16-2fg3</link>
      <guid>https://dev.to/alex-beygi/everything-about-nextjs-16-2fg3</guid>
      <description>&lt;p&gt;Next.js 16 is here, and it brings one of the most polished releases the framework has seen in a while. Instead of chasing big rewrites, this version focuses on the fundamentals, faster builds, predictable caching, smarter routing, and better developer visibility.&lt;/p&gt;

&lt;p&gt;And if you’re deploying on Appwrite Sites, you can start using Next.js 16 today. The latest release is fully supported, so you can build, test, and host your Next.js projects seamlessly on Appwrite’s open-source infrastructure.&lt;/p&gt;

&lt;p&gt;Many of the features introduced in earlier betas are now stable and production-ready, giving developers more control and consistency across their workflows.&lt;/p&gt;

&lt;p&gt;Here’s what’s new, what’s changed, and why it matters for anyone building with Next.js today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cache components
&lt;/h2&gt;

&lt;p&gt;Caching in Next.js used to be a bit of a mystery. Sometimes your data was cached when you didn’t want it to be; other times it wasn’t cached at all. You’d deploy, see stale data, and wonder if the problem was in your code or in the framework.&lt;/p&gt;

&lt;p&gt;Next.js 16 fixes that by introducing Cache Components: A new, explicit caching model. Instead of Next.js deciding what to cache, you tell it what should be cached and when to revalidate.&lt;/p&gt;

&lt;p&gt;It’s built on top of Partial Pre-rendering (PPR), which already blurred the line between static and dynamic pages. Together, they make rendering predictable and flexible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next.js DevTools MCP
&lt;/h2&gt;

&lt;p&gt;One of the more forward-looking additions in this release is Next.js DevTools MCP.&lt;/p&gt;

&lt;p&gt;It hooks into the Model Context Protocol (MCP), which lets AI tools and agents understand your project’s context, your routing, caching, and rendering behaviour.&lt;/p&gt;

&lt;p&gt;Why does that matter? Because AI that actually knows how your app works can give better debugging help, clearer explanations, and smarter suggestions. Instead of just dumping stack traces, it can reason about what’s happening under the hood.&lt;/p&gt;

&lt;p&gt;It’s still early, but it points toward a future where your dev tools don’t just react to errors, they understand them.&lt;/p&gt;

&lt;h2&gt;
  
  
  proxy.ts
&lt;/h2&gt;

&lt;p&gt;The old middleware.ts file is now proxy.ts. That’s it. Same behaviour, better name.&lt;/p&gt;

&lt;p&gt;There has been a lot of confusion around how middlewares work in Next.js. These middlewares are not your typical middlewares. You’re at the mercy of any network calls you make in these middlewares, as a single slow network call may block the initial load of your entire webpage, which is not ideal. Middlewares in Next.js are used to do something lightweight, for example, redirecting users based on the authentication cookies stored. Since the term middleware continued to cause issues, the Next.js team finally decided to rename it to proxy so that the purpose of using it is clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  Logging improvements
&lt;/h2&gt;

&lt;p&gt;Next.js 16 also improves logs, and not in a superficial “we added colours” way.&lt;/p&gt;

&lt;p&gt;Build and dev logs now show where time is spent, breaking down compilation, rendering, and optimization steps. So if your build suddenly feels slower, you can immediately tell which parts are to blame.&lt;/p&gt;

&lt;p&gt;It’s a quiet but practical improvement that makes day-to-day development just a little less frustrating.&lt;/p&gt;

&lt;h2&gt;
  
  
  Turbopack update
&lt;/h2&gt;

&lt;p&gt;Turbopack has officially graduated from beta and is now the default bundler for all new Next.js projects.&lt;/p&gt;

&lt;p&gt;It’s fast, like 2–5× faster builds and up to 10× faster Fast Refresh. For large projects, filesystem caching (currently in beta) further cuts down on startup times by reusing compiled artifacts between sessions.&lt;/p&gt;

&lt;p&gt;You’ll notice the difference most if you’re in that constant build, refresh–iterate loop all day. It’s less about benchmarks and more about getting back into flow faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Adapters API
&lt;/h2&gt;

&lt;p&gt;If you’ve ever had to deploy a Next.js app in an unusual environment, say, outside Vercel, this one’s for you.&lt;/p&gt;

&lt;p&gt;Build Adapters, now in alpha, let you hook into the build process and modify it without forking the framework. It’s especially handy for teams self-hosting or building custom pipelines.&lt;/p&gt;

&lt;p&gt;This update shows that Next.js is starting to take flexibility seriously for developers running the framework in different environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  React compiler support
&lt;/h2&gt;

&lt;p&gt;Next.js 16 now includes stable support for the React Compiler, which automatically memoizes components to cut down on unnecessary re-renders.&lt;/p&gt;

&lt;p&gt;You don’t have to sprinkle useMemo or useCallback everywhere. The compiler handles it. There’s a small tradeoff in build time since it uses Babel, but the performance gains in rendering make it worthwhile for complex UI-heavy apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Routing and Prefetching
&lt;/h2&gt;

&lt;p&gt;Routing has seen a major under-the-hood upgrade.&lt;/p&gt;

&lt;p&gt;Prefetching is now more efficient thanks to layout deduplication. Shared layouts download once, even if you prefetch dozens of links. And incremental prefetching ensures that only what's missing gets fetched instead of entire pages.&lt;/p&gt;

&lt;p&gt;It even cancels prefetch requests when links leave the viewport. You won’t have to change your code to benefit. Everything just feels snappier.&lt;/p&gt;

&lt;h2&gt;
  
  
  Refined caching APIs
&lt;/h2&gt;

&lt;p&gt;Caching APIs have been cleaned up and made more explicit.&lt;/p&gt;

&lt;p&gt;The updated revalidateTag() now takes a cache-life profile, letting you fine-tune how data revalidates. The new updateTag() API adds “read-your-writes” behavior, so when users make changes, they see them reflected right away. And refresh() handles refreshing uncached data like live counts or notifications.&lt;/p&gt;

&lt;p&gt;Together, these updates turn caching into a transparent system that behaves exactly how you expect, not how the framework guesses you want it to.&lt;/p&gt;

&lt;p&gt;React 19.2 and Core Updates&lt;br&gt;
Next.js 16 ships with React 19.2, which brings some nice quality-of-life improvements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;useEffectEvent() for cleaner effect logic&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;View Transitions for smoother navigation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The new  component for managing background UI states&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The release also updates core requirements. You’ll need Node.js 20.9+, TypeScript 5.1+, and modern browsers. Old features like AMP support and the next lint command are gone, making the framework leaner overall.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;Next.js 16 isn’t a release that changes how you build. It’s one that changes how your build feels. Caching is now predictable. Builds are faster. Routing is leaner. Logs are clearer.&lt;/p&gt;

&lt;p&gt;And with Appwrite Sites now supporting Next.js 16, you can deploy and host your latest projects right away, from development to production, on fully open-source infrastructure. Whether you’re experimenting with Cache Components, testing Turbopack, or building production apps, everything runs smoothly on Appwrite Sites.&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Fri, 01 Aug 2025 14:56:13 +0000</pubDate>
      <link>https://dev.to/alex-beygi/-iip</link>
      <guid>https://dev.to/alex-beygi/-iip</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/alex-beygi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1789094%2Fc98e157b-2180-45c8-a594-134585feb307.jpg" alt="alex-beygi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/alex-beygi/understanding-javascript-symbol-a-unique-identifier-ld1" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Understanding JavaScript Symbol - A Unique Identifier&lt;/h2&gt;
      &lt;h3&gt;Alex Beygi ・ Aug 1&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#frontend&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Understanding JavaScript Symbol - A Unique Identifier</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Fri, 01 Aug 2025 14:55:46 +0000</pubDate>
      <link>https://dev.to/alex-beygi/understanding-javascript-symbol-a-unique-identifier-ld1</link>
      <guid>https://dev.to/alex-beygi/understanding-javascript-symbol-a-unique-identifier-ld1</guid>
      <description>&lt;p&gt;In JavaScript, Symbol("Alex") is a way to create a unique identifier.&lt;/p&gt;

&lt;p&gt;Symbols are a special data type in JavaScript. Even if you create two symbols with the same description ("Alex" in this case), they will always be unique.&lt;/p&gt;

&lt;p&gt;Key Points About Symbols&lt;br&gt;
Creating a Symbol:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const mySymbol = Symbol("Alex");
console.log(mySymbol); // Outputs: Symbol(Alex)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Uniqueness:&lt;/p&gt;

&lt;p&gt;Even if you do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const symbol1 = Symbol("Alex");
const symbol2 = Symbol("Alex");
console.log(symbol1 === symbol2); // Outputs: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The two symbols are different, even if they have the same description.&lt;/p&gt;

&lt;p&gt;Why Use Symbols?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Object Properties:&lt;/strong&gt; Symbols can be used as unique keys for object properties. They avoid naming conflicts because no two symbols are the same.&lt;/p&gt;

&lt;p&gt;They are useful for creating "hidden" properties that won't conflict with other keys.&lt;/p&gt;

&lt;p&gt;Practical Example: Avoiding Key Conflicts&lt;br&gt;
Here's how to use a Symbol to avoid property name conflicts in an object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Example with Symbols
const symId = Symbol("id");

const user = {
   name: "Alex",
   [symId]: 12345 // Symbol is used as a unique property key
};

console.log(user); 
// Outputs: { name: 'Alex', [Symbol(id)]: 12345 }

// Accessing the Symbol property
console.log(user[symId]); // Outputs: 12345

// Another script cannot accidentally overwrite this property:
user["id"] = 67890; // Regular key
console.log(user.id); // Outputs: 67890 (regular key)
console.log(user[symId]); // Still Outputs: 12345 (symbol key is untouched)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key Benefits&lt;/strong&gt;&lt;br&gt;
Symbols Prevent Key Overlaps: The Symbol key (symId) and the regular string key ("id") don't clash.&lt;/p&gt;

&lt;p&gt;Hidden Properties: Symbols don't show up in regular for...in or Object.keys() loops.&lt;/p&gt;

&lt;p&gt;This makes symbols very useful for internal object properties that you want to stay hidden or unique.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Fri, 01 Aug 2025 12:41:21 +0000</pubDate>
      <link>https://dev.to/alex-beygi/-4c6e</link>
      <guid>https://dev.to/alex-beygi/-4c6e</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/alex-beygi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1789094%2Fc98e157b-2180-45c8-a594-134585feb307.jpg" alt="alex-beygi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/alex-beygi/redis-pubsub-vs-laravel-reverb-real-time-laravel-at-its-best-35f1" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Redis Pub/Sub vs Laravel Reverb: Real-Time Laravel at Its Best&lt;/h2&gt;
      &lt;h3&gt;Alex Beygi ・ Aug 1&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#laravel&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#websocket&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#redis&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#socketio&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>laravel</category>
      <category>websocket</category>
      <category>redis</category>
      <category>socketio</category>
    </item>
    <item>
      <title>Redis Pub/Sub vs Laravel Reverb: Real-Time Laravel at Its Best</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Fri, 01 Aug 2025 07:46:09 +0000</pubDate>
      <link>https://dev.to/alex-beygi/redis-pubsub-vs-laravel-reverb-real-time-laravel-at-its-best-35f1</link>
      <guid>https://dev.to/alex-beygi/redis-pubsub-vs-laravel-reverb-real-time-laravel-at-its-best-35f1</guid>
      <description>&lt;p&gt;Both Redis Pub/Sub and Laravel Reverb can be used for real-time functionality in Laravel applications, but they address different layers of the real-time stack and have distinct benefits and use cases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Redis Pub/Sub&lt;/strong&gt; is a messaging paradigm where publishers send messages to channels, and subscribers listen to those channels. It's fast, lightweight, and widely used for real-time messaging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Reverb&lt;/strong&gt; is Laravel's first-party WebSocket server introduced in Laravel 11, aiming to offer a robust real-time solution tightly integrated with Laravel’s broadcasting system.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Redis Pub/Sub&lt;/th&gt;
&lt;th&gt;Laravel Reverb&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Extremely fast (in-memory)&lt;/td&gt;
&lt;td&gt;Fast with persistent WebSocket connections&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency&lt;/td&gt;
&lt;td&gt;Sub-millisecond&lt;/td&gt;
&lt;td&gt;Sub-millisecond (depending on network/WebSocket load)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Horizontal Scaling&lt;/td&gt;
&lt;td&gt;Tricky (no persistence)&lt;/td&gt;
&lt;td&gt;Cluster support, queue integration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Message Durability&lt;/td&gt;
&lt;td&gt;None (ephemeral)&lt;/td&gt;
&lt;td&gt;Optional via queues and Redis&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Connection Type&lt;/td&gt;
&lt;td&gt;Stateless&lt;/td&gt;
&lt;td&gt;Persistent (WebSocket)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Redis Pub/Sub&lt;/strong&gt;&lt;br&gt;
Speed: Extremely fast due to being in-memory and low-overhead.&lt;/p&gt;

&lt;p&gt;Latency: Sub-millisecond for local setups.&lt;/p&gt;

&lt;p&gt;Horizontal Scaling: Pub/Sub doesn't support message persistence or    queuing, which can be a limitation in distributed systems.&lt;/p&gt;

&lt;p&gt;Load Handling: Handles high-throughput messaging, but can drop messages if subscribers disconnect.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Redis::publish('channel-name', json_encode(['message' =&amp;gt; 'Hello']));&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;em&gt;On the subscriber side, you'd need a separate process (often in Node.js or Go) to receive messages and forward to clients.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Laravel Reverb&lt;/strong&gt;&lt;br&gt;
Speed: Built on top of &lt;a href="https://frankenphp.dev/" rel="noopener noreferrer"&gt;FrankenPHP&lt;/a&gt; or &lt;a href="https://openswoole.com/" rel="noopener noreferrer"&gt;Swoole&lt;/a&gt;, it's designed for high concurrency and persistent WebSocket connections.&lt;/p&gt;

&lt;p&gt;Latency: Excellent for WebSocket-based communication; real-time delivery with persistent connections.&lt;/p&gt;

&lt;p&gt;Horizontal Scaling: Supports clustering and integrates tightly with Laravel queues and Redis.&lt;/p&gt;

&lt;p&gt;Reliability: Built-in reconnection and session handling. More resilient than raw Pub/Sub.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Broadcasting Event:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;event(new MessageSent($message));&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Client Side (with Laravel Echo):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Echo.channel('chat')
    .listen('MessageSent', (e) =&amp;gt; {
        console.log(e.message);
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verdict:&lt;/strong&gt;&lt;br&gt;
Redis Pub/Sub is ideal for backend-to-backend communication or ephemeral events.&lt;/p&gt;

&lt;p&gt;Reverb shines in persistent client communication and scales more gracefully in Laravel-native projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
If you're looking to build real-time features in Laravel, Laravel Reverb is the clear winner in terms of usability, integration, and developer experience. It’s made for Laravel, integrates with everything you already use, and takes away the pain of setting up a real-time infrastructure.&lt;/p&gt;

&lt;p&gt;That said, Redis Pub/Sub is still a great choice for lightweight, internal messaging systems or cross-service communication where WebSockets aren't needed.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>websocket</category>
      <category>redis</category>
      <category>socketio</category>
    </item>
    <item>
      <title>Leveraging Laravel Actions for Cleaner, Reusable Code</title>
      <dc:creator>Alex Beygi</dc:creator>
      <pubDate>Thu, 31 Jul 2025 21:26:45 +0000</pubDate>
      <link>https://dev.to/alex-beygi/leveraging-laravel-actions-for-cleaner-reusable-code-1kcc</link>
      <guid>https://dev.to/alex-beygi/leveraging-laravel-actions-for-cleaner-reusable-code-1kcc</guid>
      <description>&lt;p&gt;Laravel Actions are a design pattern used to encapsulate specific units of work—such as creating a user, sending an email, or processing a queue—into individual, reusable classes. Instead of bloating your controller or service classes, Actions help you isolate the logic into small, single-purpose files.&lt;/p&gt;

&lt;p&gt;Think of an Action as a method that does one thing and does it well, but it's wrapped inside a class to promote clarity, testability, and reuse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Laravel Actions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using Actions in Laravel can greatly enhance your codebase. Here’s why:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Separation of Concerns&lt;/strong&gt;&lt;br&gt;
Instead of having bloated controllers or services with mixed responsibilities, each Action handles a single task.&lt;/p&gt;

&lt;p&gt;Example: You can move the logic for creating a user from your controller into a CreateUserAction class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Reusability&lt;/strong&gt;&lt;br&gt;
Actions can be used across controllers, jobs, commands, or even tests without duplicating logic.&lt;/p&gt;

&lt;p&gt;Example: The same CreateInvoiceAction can be used in a web controller and a scheduled command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Testability&lt;/strong&gt;&lt;br&gt;
Since Actions are standalone classes, they can be easily tested in isolation without relying on the full controller or service environment.&lt;/p&gt;

&lt;p&gt;Example: You can write a unit test for SendWelcomeEmailAction without mocking any controller behaviour.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Cleaner Codebase&lt;/strong&gt;&lt;br&gt;
Controllers become thin and focused on request/response handling. Business logic lives in Actions.&lt;/p&gt;

&lt;p&gt;Example: A controller method becomes just 3 lines: validate, call action, return response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing Laravel Actions (by Loris Leiva)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can build Actions manually, but the &lt;a href="https://www.laravelactions.com/" rel="noopener noreferrer"&gt;lorisleiva/laravel-actions&lt;/a&gt; package makes it much more elegant.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require lorisleiva/laravel-actions&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Practical Examples:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt; Action for Validation and Creating a Post&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/Actions/Post/CreatePostAction.php

namespace App\Actions\Post;

use App\Models\Post;
use Lorisleiva\Actions\Concerns\AsAction;

class CreatePost
{
    /**
     * Handle the creation of a new post.
     */
    public function handle(array $data): Post
    {
        return Post::create($data);
    }

    /**
     * Validation rules for the request.
     */
    public function rules(): array
    {
        return [
            'title' =&amp;gt; 'required|string|max:255',
            'content' =&amp;gt; 'required|string',
        ];
    }

    /**
     * Invoke method used by Laravel's route to execute the action.
     */
    public function __invoke(Request $request): Post
    {
        $validated = $request-&amp;gt;validate($this-&amp;gt;rules());
        return $this-&amp;gt;handle($validated);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Route Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use App\Actions\Post\CreatePost;

Route::post('/posts', CreatePost::class);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example 2: Action for Running a Queue Job&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// app/Actions/User/SendWelcomeEmailAction.php

namespace App\Actions\User;

use App\Jobs\SendWelcomeEmail;

class SendWelcomeEmailAction
{
    public function execute($user)
    {
        SendWelcomeEmail::dispatch($user);
    }
}
Usage in Controller or Listener:

$action = app(SendWelcomeEmailAction::class);
$action-&amp;gt;execute($user);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How to Implement Actions&lt;/p&gt;

&lt;p&gt;There are multiple ways to structure your Actions:&lt;br&gt;
Manually create them in a Actions namespace.&lt;/p&gt;

&lt;p&gt;Example using the package:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:action CreateUser&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;And then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public function handle(array $data)
{
    // Business logic
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;When to Use Laravel Actions?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use Actions when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A piece of logic is repeated across different parts of your application.&lt;/li&gt;
&lt;li&gt;Your controller methods are growing too large.&lt;/li&gt;
&lt;li&gt;You want to improve unit testing and readability.&lt;/li&gt;
&lt;li&gt;You are building a service-oriented or domain-driven architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Laravel Actions are a powerful tool to improve the architecture of your Laravel application. They promote clean code, reusability, and testability, while reducing the cognitive load in your controllers. Whether you're validating requests, running queues, or performing business logic, wrapping that logic in Actions will lead to a more maintainable and scalable application.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>backenddevelopment</category>
    </item>
  </channel>
</rss>
