<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: John JustGo</title>
    <description>The latest articles on Forem by John JustGo (@justgodev).</description>
    <link>https://forem.com/justgodev</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%2F1508484%2Fe491b8ea-f240-4a24-b4fa-3154da79b641.jpeg</url>
      <title>Forem: John JustGo</title>
      <link>https://forem.com/justgodev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/justgodev"/>
    <language>en</language>
    <item>
      <title>Sharding Made Easy with MginDB in 5 Minutes</title>
      <dc:creator>John JustGo</dc:creator>
      <pubDate>Tue, 21 May 2024 14:23:20 +0000</pubDate>
      <link>https://forem.com/justgodev/sharding-made-easy-with-mgindb-in-5-minutes-11e7</link>
      <guid>https://forem.com/justgodev/sharding-made-easy-with-mgindb-in-5-minutes-11e7</guid>
      <description>&lt;p&gt;Hello, developers!&lt;/p&gt;

&lt;p&gt;Sharding can be a complex task, but with MginDB, it's a breeze. Today, I'll show you how to set up sharding with MginDB in just a few minutes. Whether you're scaling up or down, MginDB handles the heavy lifting for you and manages it automatically.&lt;/p&gt;

&lt;p&gt;Let’s get started!&lt;/p&gt;

&lt;h4&gt;
  
  
  Install MginDB
&lt;/h4&gt;

&lt;p&gt;Install MginDB on your master server and on all your shards:&lt;br&gt;
&lt;a href="https://mgindb.com/documentation.html"&gt;mgindb.com/documentation.html&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Sharding
&lt;/h4&gt;

&lt;p&gt;Sharding is a database architecture pattern that partitions data across multiple servers, enhancing the system's scalability and performance. MginDB will take care of everything automatically when you add or remove a shard and will redistribute the data without having to transfer any data manually nor changing the sharding scheme and keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up Sharding:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Configure Sharding Type:&lt;/strong&gt;
Open &lt;code&gt;config.json&lt;/code&gt; for all your servers and set &lt;code&gt;SHARDING_TYPE&lt;/code&gt; to &lt;code&gt;MASTER&lt;/code&gt; for your main server and &lt;code&gt;SHARDING_TYPE&lt;/code&gt; to &lt;code&gt;SLAVE&lt;/code&gt; for all your shard servers.
Or use the CLI command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   CONFIG SET SHARDING_TYPE MASTER
   CONFIG SET SHARDING_TYPE SLAVE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Adding a Shard:&lt;/strong&gt;
To add a new server to the shard list, use the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   CONFIG SET SHARDS ADD serverip/domain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command registers &lt;code&gt;serverip/domain&lt;/code&gt; as a new shard where data can be distributed.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Removing a Shard:&lt;/strong&gt;
To remove an existing server from the shard list, use the command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   CONFIG SET SHARDS DEL serverip/domain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This removes &lt;code&gt;serverip/domain&lt;/code&gt; from the list of shards, redistributing any data it held to remaining shards.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Activating Sharding:&lt;/strong&gt;
To activate sharding and start distributing data across the configured shards, execute:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   CONFIG SET SHARDING 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure you add the necessary shards before activating sharding to distribute data evenly.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deactivating Sharding:&lt;/strong&gt;
To deactivate sharding and consolidate all data back to the master server, use:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   CONFIG SET SHARDING 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command centralizes the data, ceasing its distribution among shards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Sharding Commands:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backup and Rollback:&lt;/strong&gt; Data is always backed up before resharding. If an error occurs, it rolls back to the last backup, ensuring data integrity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sharding Batch Size:&lt;/strong&gt; Set the size of commands sent to shards per batch (default: 100):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  CONFIG SET SHARDING_BATCH_SIZE value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each of these commands needs to be executed on each server where MginDB is installed, either using the Web CLI (&lt;code&gt;client.html&lt;/code&gt;) or Server CLI (&lt;code&gt;mgindb client&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;These settings play a crucial role in managing the distribution of data and the operational scale of your system, allowing for flexibility in handling workload and data management strategies.&lt;/p&gt;

&lt;p&gt;Feel free to reach out with any questions or feedback. We're excited to see what you'll build with MginDB!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Link&lt;/strong&gt;: &lt;a href="https://mgindb.com"&gt;mgindb.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Documentation&lt;/strong&gt;: &lt;a href="https://mgindb.com/documentation.html"&gt;mgindb.com/documentation.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>sharding</category>
      <category>database</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>MginDB: In-Memory, Schema-less, and Limitless</title>
      <dc:creator>John JustGo</dc:creator>
      <pubDate>Tue, 21 May 2024 04:15:20 +0000</pubDate>
      <link>https://forem.com/justgodev/mgindb-in-memory-schema-less-and-limitless-6nb</link>
      <guid>https://forem.com/justgodev/mgindb-in-memory-schema-less-and-limitless-6nb</guid>
      <description>&lt;h3&gt;
  
  
  Hello, Developers!
&lt;/h3&gt;

&lt;p&gt;Redis and SQL are amazing, but what if you need the best of both all in one?&lt;/p&gt;

&lt;p&gt;If you like the speed of Redis and the power of SQL, you're going to love MginDB. It’s a hybrid in-memory database system that combines the agility of NoSQL systems with the robustness of traditional databases. Let’s dive into what makes MginDB a game-changer for your development stack.&lt;/p&gt;

&lt;h4&gt;
  
  
  What is MginDB?
&lt;/h4&gt;

&lt;p&gt;MginDB is designed for developers who need rapid data access and flexible management. Whether you're building web, mobile, or IoT applications, MginDB’s in-memory storage mechanisms minimize access times and maximize throughput, making your data operations lightning-fast.&lt;/p&gt;

&lt;h4&gt;
  
  
  Schema Flexibility
&lt;/h4&gt;

&lt;p&gt;One of the things you'll appreciate about MginDB is its support for schema-less data storage. This flexibility allows you to manage your data the way you want, without being constrained by rigid schemas. You get to decide how your data should be structured, using relational indices to keep things organized.&lt;/p&gt;

&lt;h4&gt;
  
  
  Advanced Querying
&lt;/h4&gt;

&lt;p&gt;MginDB’s powerful querying functions are built to handle complex relational data efficiently. Whether you're doing simple lookups or running intricate analytical queries, MginDB has you covered. This makes exploring and analyzing your data not just possible, but straightforward and efficient.&lt;/p&gt;

&lt;h4&gt;
  
  
  Scalability &amp;amp; Sharding
&lt;/h4&gt;

&lt;p&gt;As developers, we know the importance of scalability. MginDB is designed with horizontal scalability in mind, supporting sharding to meet growing demands and volumes. As your application grows, MginDB grows with it, allowing you to scale your data operations seamlessly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Real-time Updates
&lt;/h4&gt;

&lt;p&gt;For those of us who need real-time data capabilities, MginDB’s WebSocket connections ensure that you receive data updates instantly. This is backed by a robust publish/subscribe mechanism, keeping your data synchronized across your applications.&lt;/p&gt;

&lt;h4&gt;
  
  
  Usage
&lt;/h4&gt;

&lt;p&gt;Integrating MginDB into your development stack can transform your data handling capabilities. From simple CRUD operations to complex transactions and real-time updates, MginDB’s comprehensive toolset supports it all. Ensuring data integrity and consistency, even in distributed environments, makes MginDB a reliable choice for modern applications.&lt;/p&gt;

&lt;h4&gt;
  
  
  CLI / GUI
&lt;/h4&gt;

&lt;p&gt;MginDB offers a user-friendly web interface that simplifies executing complex queries and accessing real-time data insights. Monitor and manage your in-memory databases, analyze and update data, execute deep queries, and scale instantly. You can write, test, and validate your queries before deploying them, ensuring smooth and efficient data operations.&lt;/p&gt;

&lt;h4&gt;
  
  
  Ready to Get Started?
&lt;/h4&gt;

&lt;p&gt;Explore MginDB and take your data operations to the next level. For more details, visit our &lt;a href="https://mgindb.com/documentation.html"&gt;documentation&lt;/a&gt; and get started today.&lt;/p&gt;

&lt;p&gt;Feel free to reach out with any questions or feedback. We're excited to see what you'll build with MginDB!&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Link&lt;/strong&gt;: &lt;a href="https://mgindb.com"&gt;mgindb.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Documentation&lt;/strong&gt;: &lt;a href="https://mgindb.com/documentation.html"&gt;mgindb.com/documentation.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>database</category>
      <category>sql</category>
      <category>data</category>
    </item>
  </channel>
</rss>
