<?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: Salim Khengui</title>
    <description>The latest articles on DEV Community by Salim Khengui (@bagniz).</description>
    <link>https://dev.to/bagniz</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%2F2529478%2F0b469f40-2762-4909-8c6e-72fb62d0d64b.jpg</url>
      <title>DEV Community: Salim Khengui</title>
      <link>https://dev.to/bagniz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bagniz"/>
    <language>en</language>
    <item>
      <title>Atlas Device Sync</title>
      <dc:creator>Salim Khengui</dc:creator>
      <pubDate>Sat, 07 Jun 2025 13:31:01 +0000</pubDate>
      <link>https://dev.to/bagniz/atlas-device-sync-19oc</link>
      <guid>https://dev.to/bagniz/atlas-device-sync-19oc</guid>
      <description>&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%2Fod7184wo4sqpru1rkx19.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%2Fod7184wo4sqpru1rkx19.png" alt="Atlas Device Sync simple sync diagram" width="800" height="302"&gt;&lt;/a&gt;&lt;strong&gt;Ever built an app and struggled to keep data in sync across devices?&lt;/strong&gt; 😫&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syncing data across devices&lt;/strong&gt; is one of the biggest challenges in app development, and can quickly be a &lt;strong&gt;mess&lt;/strong&gt; that can be very difficult to get out of, from dealing with &lt;strong&gt;offline users, conflicting changes, to network issues.&lt;/strong&gt; To summarize, it is a &lt;strong&gt;nightmare&lt;/strong&gt;. &lt;strong&gt;BUT&lt;/strong&gt;, what if I can tell you that there is a tool out there that can resolve all these issues for you and &lt;strong&gt;automatically sync your data&lt;/strong&gt; … what if ?&lt;/p&gt;

&lt;p&gt;That’s where &lt;strong&gt;MongoDB Atlas Device Sync&lt;/strong&gt; comes in. It &lt;strong&gt;seamlessly and automatically&lt;/strong&gt; &lt;strong&gt;syncs data&lt;/strong&gt; across users and devices, even where &lt;strong&gt;they’re offline&lt;/strong&gt;, and the best part of all this is that you have to build complex sync logic or worrying about &lt;strong&gt;conflict resolution as it is handled automatically&lt;/strong&gt; also. If you have never heard of this amazing technology, here is what you need to know in a few bullet points.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is good about Atlas Device Sync ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;⭐️ &lt;strong&gt;Effortless Syncing&lt;/strong&gt; – Changes made on one device magically appear on others.&lt;/p&gt;

&lt;p&gt;⭐️ &lt;strong&gt;Offline-First Support&lt;/strong&gt; – Users can work without an internet connection, and changes sync when they’re back online.&lt;/p&gt;

&lt;p&gt;⭐️ &lt;strong&gt;Smart Conflict Resolution&lt;/strong&gt; – Built-in logic ensures data stays consistent, even when multiple users update the same data.&lt;/p&gt;

&lt;p&gt;⭐️ &lt;strong&gt;Efficient Data Transfers&lt;/strong&gt; – Only &lt;strong&gt;deltas&lt;/strong&gt; (small changes) are sent, reducing network usage.&lt;/p&gt;

&lt;p&gt;⭐️ &lt;strong&gt;End-to-End Security&lt;/strong&gt; – Data syncs over &lt;strong&gt;TLS 1.3 encrypted WebSockets&lt;/strong&gt;, with fine-grained permissions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s bad about Atlas Device Sync ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🔴 &lt;strong&gt;Sync pauses after 30 days of inactivity.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🔴 &lt;strong&gt;Maximum of 5,000 concurrent sync connections.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🔴 &lt;strong&gt;Not yet supported on sharded clusters.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🔴 &lt;strong&gt;It can only be used with MongoDB data.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For developers building &lt;strong&gt;real-time, offline-first applications&lt;/strong&gt;, Atlas Device Sync removes complexity, so you can focus on building great features for your users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Have you tried it yet? Are you thinking of taking a look more in depth ? It looks like an interesting technology right ? Well never mind using it, it’s DEPRECATED, it will reach end-of-life and be removed on September 30, 2025. You can find alternatives on the documentation page&lt;/strong&gt; 😁&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>cloud</category>
      <category>database</category>
      <category>programming</category>
    </item>
    <item>
      <title>🚀 Simplify your git workflow with Git Worktree!</title>
      <dc:creator>Salim Khengui</dc:creator>
      <pubDate>Thu, 05 Dec 2024 17:02:58 +0000</pubDate>
      <link>https://dev.to/bagniz/simplify-your-git-workflow-with-git-worktree-2pea</link>
      <guid>https://dev.to/bagniz/simplify-your-git-workflow-with-git-worktree-2pea</guid>
      <description>&lt;p&gt;Ever felt stuck juggling &lt;strong&gt;multiple&lt;/strong&gt; branches in a single repository ?&lt;/p&gt;

&lt;p&gt;If you have then the git command you used to manage and work on these different branches &lt;strong&gt;simultaneously&lt;/strong&gt; was most likely &lt;code&gt;git stash&lt;/code&gt; . Unfortunately though, the &lt;code&gt;git stash&lt;/code&gt; command can be complicated to keep up with the more branches you have. Sur, if your changes were added to the staging area, using the &lt;code&gt;git stash&lt;/code&gt;  command will automatically map the changes to the branch so won’t need to remember which change was stashed on which branch, but, what if you forgot to add the changes to the staging area, then the fear is real, the fear of losing your previous changes will eat you alive (i’m just joking, or am i ?). So, isn’t there a better solution ? well there is, git is again here to help. What is this solution you might ask. may i present &lt;code&gt;git worktree&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;What is &lt;code&gt;git worktree&lt;/code&gt; . Well its a git command, obviously, that based on the official git website, allows you to manage multiple working trees that are attached to the same git repository.&lt;/p&gt;

&lt;p&gt;You might ask what does that mean. Well, simply put, it allows you to &lt;strong&gt;switch&lt;/strong&gt; to a branch from your repository juste like &lt;code&gt;git switch&lt;/code&gt; but unlike it, instead of switching to the branch in your default local repository, it creates a new folder that contains the new branch on a path that you specify, leaving your default local repository &lt;strong&gt;untouched&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Still not clear enough. Well, lets take on the example we talked about in the first paragraph or this poste to showcase how &lt;code&gt;git worktree&lt;/code&gt; solves the issue.&lt;/p&gt;

&lt;p&gt;Imagine that you are an experienced full-stack developper (feels good huh) working on a branch called &lt;strong&gt;feat/top-dev&lt;/strong&gt;, and you have changes that are not yet committed, during this serene coding session, your noob colleague puts on a merge request (or pull request for our Github friends) for his branch called &lt;strong&gt;feat/noob-dev&lt;/strong&gt; and asks you to review it urgently, and like any &lt;strong&gt;good self respecting reviewer&lt;/strong&gt; you want to pull his code to test it locally, but you did not finish you work on your branch yet, so what do you do.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;git stash&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;We add the current changes to the staging area with &lt;code&gt;git add&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;We stash the changes using &lt;code&gt;git stash&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;We switch the review branch using &lt;code&gt;git switch feat/noob-dev&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;We do our review and testing&lt;/li&gt;
&lt;li&gt;Once done, you switch back to your branch using &lt;code&gt;git switch feat/top-dev&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;And you bring back your previously stashed changes using &lt;code&gt;git stash pop&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Using &lt;code&gt;git worktree&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;We run the following command &lt;code&gt;git worktree add ../review feat/noob-dev&lt;/code&gt; , this will create a new folder outside of our local repository called &lt;strong&gt;review&lt;/strong&gt; and checkout the &lt;strong&gt;feat/noob-dev&lt;/strong&gt; branch into it&lt;/li&gt;
&lt;li&gt;We open the &lt;strong&gt;review&lt;/strong&gt; folder in a new window or our preferred IDE (or text editor)&lt;/li&gt;
&lt;li&gt;We do our review and testing&lt;/li&gt;
&lt;li&gt;Once done, we run the following command &lt;code&gt;git worktree remove ../review&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Now, notice that using the &lt;code&gt;git worktree&lt;/code&gt;  command, &lt;strong&gt;our branch&lt;/strong&gt; and its &lt;strong&gt;changes&lt;/strong&gt; are &lt;strong&gt;never touched&lt;/strong&gt;, meaning you can go back to your work after the review without manipulating any stash or any file, neat right ?&lt;/p&gt;

&lt;p&gt;Now, obviously this a simple example, but, this can have many use cases, code reviews, debugging … etc, all without disturbing your primary environment. &lt;/p&gt;

&lt;p&gt;If you want to learn more about this git command and its use cases, i would highly recommend you read the official documentation obviously (&lt;a href="https://git-scm.com/docs/git-worktree" rel="noopener noreferrer"&gt;duh&lt;/a&gt;) and try using the command yourself, just be sure to share your favorite use case, and any other tips in the comments for others to learn from your experience.&lt;/p&gt;

</description>
      <category>git</category>
      <category>beginners</category>
      <category>learning</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
