<?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: Aris Kurniawan</title>
    <description>The latest articles on DEV Community by Aris Kurniawan (@arisdolanan).</description>
    <link>https://dev.to/arisdolanan</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%2F265916%2F3ed6734e-767c-441c-b23d-9d6e740bcb89.png</url>
      <title>DEV Community: Aris Kurniawan</title>
      <link>https://dev.to/arisdolanan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arisdolanan"/>
    <language>en</language>
    <item>
      <title>Home Labs #2: Setup Raspberry Pi with Cloudflare Zero Trust (Managed Tunnel)</title>
      <dc:creator>Aris Kurniawan</dc:creator>
      <pubDate>Wed, 30 Jul 2025 03:09:51 +0000</pubDate>
      <link>https://dev.to/arisdolanan/home-labs-2-setup-raspberry-pi-with-cloudflare-zero-trust-managed-tunnel-k7</link>
      <guid>https://dev.to/arisdolanan/home-labs-2-setup-raspberry-pi-with-cloudflare-zero-trust-managed-tunnel-k7</guid>
      <description>&lt;p&gt;Want to securely access your Raspberry Pi from anywhere without port forwarding?&lt;br&gt;&lt;br&gt;
This tutorial walks you through setting up &lt;strong&gt;Cloudflare Zero Trust&lt;/strong&gt; with a &lt;strong&gt;managed tunnel&lt;/strong&gt; to expose your Pi’s services safely.&lt;/p&gt;


&lt;h2&gt;
  
  
  📝 0. Prerequisites: Register Cloudflare Zero Trust
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your &lt;strong&gt;Cloudflare Dashboard&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Sign up for &lt;strong&gt;Zero Trust&lt;/strong&gt; (Free plan is enough)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Buy a domain&lt;/strong&gt; (e.g., from Hostinger or Namecheap)
&lt;/li&gt;
&lt;li&gt;Add the domain to Cloudflare:

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Add a Site&lt;/strong&gt; in Cloudflare
&lt;/li&gt;
&lt;li&gt;Enter your domain
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Quick scan → Free Plan → Continue&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fov6ly1cg8dycfssf7q87.png" class="article-body-image-wrapper"&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%2Farticles%2Fov6ly1cg8dycfssf7q87.png" alt=" " width="800" height="724"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fld77a8h2sshofiysgah6.png" class="article-body-image-wrapper"&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%2Farticles%2Fld77a8h2sshofiysgah6.png" alt=" " width="800" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Cloudflare will provide &lt;strong&gt;nameservers&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Update your domain's &lt;strong&gt;nameservers&lt;/strong&gt; via your registrar (e.g., Hostinger)
&lt;/li&gt;
&lt;li&gt;Wait for DNS propagation (~10 min–24 hours)
&lt;/li&gt;
&lt;li&gt;Once active, you’re ready to create your tunnel&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2F186fu4t3u7dlbponolaq.png" class="article-body-image-wrapper"&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%2Farticles%2F186fu4t3u7dlbponolaq.png" alt=" " width="800" height="247"&gt;&lt;/a&gt;  &lt;/p&gt;


&lt;h2&gt;
  
  
  🔧 1. Install Cloudflare Connector on Raspberry Pi
&lt;/h2&gt;

&lt;p&gt;SSH into your Raspberry Pi and run:&lt;/p&gt;
&lt;h3&gt;
  
  
  Add GPG key
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nt"&gt;--mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0755 /usr/share/keyrings
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://pkg.cloudflare.com/cloudflare-main.gpg | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /usr/share/keyrings/cloudflare-main.gpg &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Add Cloudflare repository
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared any main'&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/cloudflared.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Install &lt;code&gt;cloudflared&lt;/code&gt;
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;cloudflared &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🌐 2. Connect Tunnel to Cloudflare
&lt;/h2&gt;

&lt;p&gt;In Cloudflare Dashboard (Zero Trust → Networks → Tunnels), create a new tunnel.&lt;br&gt;&lt;br&gt;
Then run the command provided, e.g.:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cloudflared service &lt;span class="nb"&gt;install&lt;/span&gt; &amp;lt;TUNNEL-TOKEN&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This registers and installs the tunnel as a systemd service.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ 3. Enable and Start the Tunnel Service
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;cloudflared
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start cloudflared
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status cloudflared
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🌍 4. Install Nginx on Raspberry Pi
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default page is served on &lt;strong&gt;&lt;a href="http://localhost:80" rel="noopener noreferrer"&gt;http://localhost:80&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧭 5. Add a Public Hostname in Cloudflare
&lt;/h2&gt;

&lt;p&gt;In Cloudflare Dashboard:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Zero Trust → Networks → Tunnels&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select your tunnel → click &lt;strong&gt;Public Hostnames&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add a Hostname&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hostname:&lt;/strong&gt; &lt;code&gt;example.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service:&lt;/strong&gt; &lt;code&gt;http://localhost:80&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fxsz0pjt04btuoe639xfb.png" class="article-body-image-wrapper"&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%2Farticles%2Fxsz0pjt04btuoe639xfb.png" alt=" " width="800" height="410"&gt;&lt;/a&gt;- Save and deploy&lt;/p&gt;

&lt;p&gt;This will expose your Pi’s Nginx page to the internet.&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ 6. Test It!
&lt;/h2&gt;

&lt;p&gt;Now try visiting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the default Nginx page securely tunneled through Cloudflare!&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Optional: Customize Nginx Page
&lt;/h2&gt;

&lt;p&gt;Edit the default HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /var/www/html/index.nginx-debian.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then restart Nginx:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔒 7. Access Securely with Zero Trust Policies
&lt;/h2&gt;

&lt;p&gt;Want to &lt;strong&gt;restrict access&lt;/strong&gt; to only you or your team?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Zero Trust → Access → Applications&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Add a new &lt;strong&gt;Web&lt;/strong&gt; or &lt;strong&gt;SSH&lt;/strong&gt; application&lt;/li&gt;
&lt;li&gt;Set rules: e.g., Google login, email domain, OTP, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, services like SSH or a web dashboard can only be accessed by authenticated users.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Why Use Cloudflare Tunnel?
&lt;/h2&gt;

&lt;p&gt;✅ No port forwarding&lt;br&gt;&lt;br&gt;
✅ Works behind NAT/CGNAT&lt;br&gt;&lt;br&gt;
✅ End-to-end TLS by default&lt;br&gt;&lt;br&gt;
✅ Easy dashboard management&lt;br&gt;&lt;br&gt;
✅ Supports access policies (SSO, OTP, etc.)&lt;/p&gt;




&lt;p&gt;Happy homelabbing! 🧪🌐&lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>cloudflare</category>
      <category>homelab</category>
      <category>linux</category>
    </item>
    <item>
      <title>Home Labs #1: Install Raspberry Pi OS Lite (64-bit) on Raspberry</title>
      <dc:creator>Aris Kurniawan</dc:creator>
      <pubDate>Wed, 30 Jul 2025 03:01:06 +0000</pubDate>
      <link>https://dev.to/arisdolanan/home-labs-1-install-raspberry-pi-os-lite-64-bit-on-raspberry-1137</link>
      <guid>https://dev.to/arisdolanan/home-labs-1-install-raspberry-pi-os-lite-64-bit-on-raspberry-1137</guid>
      <description>&lt;p&gt;Want to set up a headless server or lightweight IoT project using Raspberry Pi?&lt;br&gt;&lt;br&gt;
This guide walks you through installing the &lt;strong&gt;64-bit Lite version&lt;/strong&gt; of Raspberry Pi OS on a &lt;strong&gt;Raspberry Pi 3 Model B+&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧰 1. Download Raspberry Pi Imager
&lt;/h2&gt;

&lt;p&gt;👉 &lt;a href="https://www.raspberrypi.com/software/" rel="noopener noreferrer"&gt;https://www.raspberrypi.com/software/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose the installer based on your OS:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Windows&lt;/strong&gt; → &lt;code&gt;.exe&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;macOS&lt;/strong&gt; → &lt;code&gt;.dmg&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux&lt;/strong&gt; → &lt;code&gt;.deb&lt;/code&gt; / &lt;code&gt;.rpm&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Install it as usual.&lt;/p&gt;




&lt;h2&gt;
  
  
  💾 2. Prepare microSD Card &amp;amp; Raspberry Pi
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use at least an &lt;strong&gt;8GB&lt;/strong&gt; microSD (Recommended: &lt;strong&gt;16GB or more&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;In this tutorial, I use a &lt;strong&gt;32GB&lt;/strong&gt; microSD.&lt;/li&gt;
&lt;li&gt;Make sure you have a microSD &lt;strong&gt;card reader&lt;/strong&gt; ready.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 3. Launch Raspberry Pi Imager
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Insert the microSD card into your computer.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;Raspberry Pi Imager&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fqmtyenr05q3x8ngjxaf7.png" class="article-body-image-wrapper"&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%2Farticles%2Fqmtyenr05q3x8ngjxaf7.png" alt=" " width="585" height="436"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 4. Choose OS
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;"Choose OS"&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select:
&lt;code&gt;Raspberry Pi OS (Other)&lt;/code&gt; → &lt;code&gt;Raspberry Pi OS Lite (64-bit)&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ "Lite" means no desktop environment — it's CLI only!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  💽 5. Choose Storage
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;"Choose Storage"&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select your microSD card&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⚙️ 6. Configure Settings (Optional but Recommended)
&lt;/h2&gt;

&lt;p&gt;Click the &lt;strong&gt;gear icon ⚙️&lt;/strong&gt; at the bottom right to set:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ Enable &lt;strong&gt;SSH&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;👤 Set &lt;strong&gt;username and password&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;📶 Enter your &lt;strong&gt;WiFi SSID and password&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🌍 Set &lt;strong&gt;Locale, Timezone, and Keyboard layout&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;📝 These settings will apply automatically when you boot. No manual config needed!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  📥 7. Flash the OS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Write&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Wait for the process to complete&lt;/li&gt;
&lt;li&gt;Eject the microSD card safely&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧾 8. Boot Your Raspberry Pi
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Insert the microSD card into your Raspberry Pi&lt;/li&gt;
&lt;li&gt;Power it up and wait for it to boot&lt;/li&gt;
&lt;li&gt;Login using terminal or SSH (if enabled)
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Username: pi
Password: &lt;span class="o"&gt;[&lt;/span&gt;your password]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔗 &lt;strong&gt;Next Up: Home Labs #2: Setup Raspberry Pi with Cloudflare Zero Trust (Managed Tunnel)&lt;/strong&gt;  &lt;/p&gt;

</description>
      <category>raspberrypi</category>
      <category>linux</category>
      <category>homelabs</category>
      <category>webdev</category>
    </item>
    <item>
      <title>RabbitMQ with Web MQTT Plugin vs. Node.js : Performance and Memory Usage Comparison</title>
      <dc:creator>Aris Kurniawan</dc:creator>
      <pubDate>Tue, 29 Oct 2024 05:37:27 +0000</pubDate>
      <link>https://dev.to/arisdolanan/rabbitmq-with-web-mqtt-plugin-vs-nodejs-performance-and-memory-usage-comparison-4jea</link>
      <guid>https://dev.to/arisdolanan/rabbitmq-with-web-mqtt-plugin-vs-nodejs-performance-and-memory-usage-comparison-4jea</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In applications that require real-time, efficient data communication, two commonly used technologies are RabbitMQ with the Web MQTT Plugin and Node.JS (Socket.IO). RabbitMQ with the Web MQTT Plugin allows for communication using the MQTT protocol over WebSockets, while Node.JS (Socket.IO) provides a JavaScript runtime that efficiently handles events in real-time. This article compares the performance and memory usage of RabbitMQ with the Web MQTT Plugin and Node.JS (Socket.IO), particularly for handling 36 events such as notifications, data reloads, and queue management. It also analyzes whether this setup is optimal or requires further adjustments.&lt;/p&gt;




&lt;h3&gt;
  
  
  Overview of RabbitMQ with Web MQTT Plugin
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is RabbitMQ with Web MQTT Plugin?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;RabbitMQ is a message broker that supports multiple protocols, including MQTT. The Web MQTT Plugin in RabbitMQ enables clients to communicate with the broker via WebSockets using the MQTT protocol. This is particularly useful for web-based applications that need real-time, two-way communication, such as notifications or data queuing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Functions of RabbitMQ with Web MQTT Plugin&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;WebSocket Communication&lt;/strong&gt;: Allows web-based clients to use MQTT over WebSockets, enabling direct communication between the server and browser clients.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Queue and Topic Management&lt;/strong&gt;: Supports queue and topic configurations for effective message traffic management.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retained Messages&lt;/strong&gt;: Stores the last message so that newly connected clients can receive the latest information without re-requesting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High Scalability for Lightweight Messages&lt;/strong&gt;: Ideal for applications sending real-time notifications with low latency, like data reloads and notification queues.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Overview of Node.JS (Socket.IO)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;What is Node.JS (Socket.IO)?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Node.JS (Socket.IO) is a JavaScript runtime built on Chrome's V8 engine, designed to handle non-blocking I/O operations. In this context, &lt;code&gt;server.js&lt;/code&gt; is used to manage notification events, data reloads, and queues via WebSocket or HTTP protocols, depending on the application requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Functions of Node.JS (Socket.IO)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Non-Blocking I/O&lt;/strong&gt;: Allows handling multiple requests simultaneously without blocking other operations, ideal for event-driven applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-Driven Architecture&lt;/strong&gt;: Reduces resource consumption by running code only when specific events occur.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two-Way Communication&lt;/strong&gt;: Node.JS (Socket.IO) is well-suited for real-time applications that require continuous two-way communication between the client and server via WebSocket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Efficiency and Responsiveness&lt;/strong&gt;: Efficiently handles large numbers of I/O-based connections, such as managing notifications and queues.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Challenges and Limitations
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;RabbitMQ with Web MQTT Plugin&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Resource Consumption&lt;/strong&gt;: RabbitMQ, especially with the Web MQTT Plugin, can consume a lot of memory and CPU to handle high message volumes. In this test, RabbitMQ showed a CPU usage of about 5.2%, which is relatively high but reasonable for a message broker.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Latency under High Load&lt;/strong&gt;: Under extremely high loads, there might be a slight latency in message delivery, which can impact applications heavily reliant on real-time performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More Complex Configuration&lt;/strong&gt;: Compared to Node.JS (Socket.IO), RabbitMQ with Web MQTT Plugin requires more initial configuration, especially for setting up queues, topics, and bindings.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Node.JS (Socket.IO)&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Single-Threaded&lt;/strong&gt;: Node.JS (Socket.IO) uses a single thread, so CPU-intensive operations can become a bottleneck. In testing, CPU usage reached 50.5%, which is high for a single-threaded application and may cause delays.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Leaks&lt;/strong&gt;: If not managed properly, a Node.JS (Socket.IO) application can experience memory leaks, especially in long-running applications with high event activity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency on External Libraries&lt;/strong&gt;: Node.JS (Socket.IO) often relies on many third-party libraries which, if not maintained, could affect overall performance.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Performance Analysis with Glances
&lt;/h3&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2Fvbzbuejx2mthnsyg2yi4.png" class="article-body-image-wrapper"&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%2Farticles%2Fvbzbuejx2mthnsyg2yi4.png" alt=" " width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="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%2Farticles%2F0sva0gojbw4k8ul87syf.png" class="article-body-image-wrapper"&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%2Farticles%2F0sva0gojbw4k8ul87syf.png" alt=" " width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Overview of the Processes&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RabbitMQ with Web MQTT Plugin&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;CPU usage: 5.2%&lt;/li&gt;
&lt;li&gt;Memory usage: 2.8% (5.97 GB Virtual, 887 MB Resident)&lt;/li&gt;
&lt;li&gt;Uptime: 18 hours and 26 minutes&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Node.js (&lt;code&gt;server.js&lt;/code&gt;)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;CPU usage: 50.5%&lt;/li&gt;
&lt;li&gt;Memory usage: 0.4% (1.04 GB Virtual, 257 MB Resident)&lt;/li&gt;
&lt;li&gt;Uptime: 4 hours and 1 minute&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;These numbers give an initial impression of how each service is consuming resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CPU Usage Comparison&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RabbitMQ&lt;/strong&gt; is relatively light on CPU, only consuming 5.2%, even though it is managing 36 events (notifications, data reloads, and queue management tasks). This low CPU usage is characteristic of RabbitMQ, as it is optimized for message handling and asynchronous communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js (&lt;code&gt;server.js&lt;/code&gt;)&lt;/strong&gt; is consuming significantly more CPU, at 50.5%. This high usage suggests that &lt;code&gt;server.js&lt;/code&gt; may be handling more compute-intensive tasks, possibly related to managing WebSocket connections, processing requests, or handling real-time data. This high CPU usage could impact the server’s performance under higher load or when additional applications are running concurrently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Memory Usage Comparison&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RabbitMQ&lt;/strong&gt; shows higher memory usage with 887 MB resident memory, which is reasonable for a messaging broker handling continuous WebSocket connections and MQTT messaging through the Web MQTT Plugin. Its virtual memory footprint (5.97 GB) is high, but this is typically due to pre-allocation and not actual memory in use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js (&lt;code&gt;server.js&lt;/code&gt;)&lt;/strong&gt; has a much lower memory footprint, with only 257 MB resident memory. Node.js applications generally have a small memory footprint but can grow based on the complexity of tasks. Its relatively low memory usage here suggests it is well-optimized for handling tasks, though the high CPU usage may indicate some inefficiencies in CPU-bound tasks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Uptime and Stability&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RabbitMQ has an uptime of over 18 hours, and it’s using minimal CPU, indicating that it is stable and efficient over longer periods.&lt;/li&gt;
&lt;li&gt;Node.js (&lt;code&gt;server.js&lt;/code&gt;) has only been running for 4 hours but is consuming a large percentage of the CPU. If this CPU usage trend continues, it could become a bottleneck and may require restarting or optimization, especially for a production environment that expects high uptime.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Implications on System Performance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RabbitMQ with Web MQTT Plugin&lt;/strong&gt; appears to be less demanding on the CPU and moderate in memory usage. This makes it well-suited for applications that require high-throughput messaging with minimal latency. The current resource usage does not seem excessive, but monitoring memory over longer uptime periods is advised, as message brokers can accumulate memory usage with a high volume of persistent messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js (&lt;code&gt;server.js&lt;/code&gt;)&lt;/strong&gt; at 50.5% CPU usage suggests that it could be CPU-bound, which could affect other processes or reduce system responsiveness under high load. If &lt;code&gt;server.js&lt;/code&gt; handles WebSocket connections, optimizing the code for asynchronous tasks or offloading some processes could reduce CPU usage. High CPU usage in Node.js might also suggest the need for load balancing across multiple instances, especially if the server needs to scale to handle more events.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Recommendations for Optimization&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RabbitMQ&lt;/strong&gt;: Although RabbitMQ's memory usage is moderate, monitoring is recommended to ensure it doesn't grow unbounded over time, especially with increased event volumes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.js (&lt;code&gt;server.js&lt;/code&gt;)&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Optimize CPU Usage&lt;/strong&gt;: Review code for any CPU-intensive operations or synchronous code that might benefit from asynchronous handling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benchmark and Load Test&lt;/strong&gt;: Conduct stress tests to see if &lt;code&gt;server.js&lt;/code&gt; CPU usage increases further with more concurrent events. This could help identify specific code bottlenecks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scaling&lt;/strong&gt;: Consider horizontal scaling for &lt;code&gt;server.js&lt;/code&gt; by running multiple instances behind a load balancer, especially if high CPU usage persists under typical workloads.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Latency&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RabbitMQ with Web MQTT Plugin&lt;/strong&gt;: Generally has low latency, especially in real-time communication for lightweight messages, which is ideal for notification and data reload scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.JS (Socket.IO)&lt;/strong&gt;: Low latency, but high CPU load can introduce delays, especially if the application handles CPU-intensive events.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;RabbitMQ with Web MQTT Plugin&lt;/strong&gt; is a good choice for applications that require real-time message handling, particularly for the 36 events including notifications, data reloads, and queue management. With around 5.2% CPU usage, RabbitMQ is stable for high message delivery loads, especially when low latency and two-way communication are needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node.JS (Socket.IO)&lt;/strong&gt; is suitable for applications needing an event-driven architecture with two-way communication. However, with CPU usage reaching 50.5%, applications may face limitations in scenarios requiring high CPU processing. Therefore, solutions like clustering or worker threads could be considered if usage continues to grow.&lt;/p&gt;

&lt;p&gt;Overall:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;RabbitMQ with Web MQTT Plugin&lt;/strong&gt;: Highly recommended for applications with large messaging and notification needs. It also simplifies managing connections and messages through WebSockets efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node.JS (Socket.IO)&lt;/strong&gt;: Ideal for web applications that require fast responses and two-way communication but may require further adjustments to reduce CPU load.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With performance analysis through Glances, both technologies have demonstrated results by capturing the &lt;strong&gt;highest CPU usage&lt;/strong&gt; values from &lt;strong&gt;each process&lt;/strong&gt;, which is quite suitable for this scenario. However, regular monitoring is necessary to prevent spikes in CPU or memory usage that could impact the overall system performance.&lt;/p&gt;

&lt;p&gt;please correct me if I'm wrong 😁&lt;/p&gt;

&lt;p&gt;Note : If you have any suggestions for testing, please comment below, and feel free to recommend other tools for real-time communication between the client and server 😊.&lt;/p&gt;

&lt;p&gt;Documentation:&lt;br&gt;
&lt;a href="https://www.rabbitmq.com/docs/web-mqtt" rel="noopener noreferrer"&gt;https://www.rabbitmq.com/docs/web-mqtt&lt;/a&gt;&lt;br&gt;
&lt;a href="https://socket.io/docs/v2/" rel="noopener noreferrer"&gt;https://socket.io/docs/v2/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rabbitmq</category>
      <category>node</category>
      <category>javascript</category>
      <category>erlang</category>
    </item>
  </channel>
</rss>
