<?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: Harshit Mehta</title>
    <description>The latest articles on DEV Community by Harshit Mehta (@harshitmehta15).</description>
    <link>https://dev.to/harshitmehta15</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F558162%2F7f2416fc-d61b-467e-b1e9-0fa9db0c2543.jpeg</url>
      <title>DEV Community: Harshit Mehta</title>
      <link>https://dev.to/harshitmehta15</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/harshitmehta15"/>
    <language>en</language>
    <item>
      <title>MongoDB from One Machine to a Multi-Region Cluster</title>
      <dc:creator>Harshit Mehta</dc:creator>
      <pubDate>Thu, 24 Sep 2026 19:52:15 +0000</pubDate>
      <link>https://dev.to/harshitmehta15/mongodb-from-one-machine-to-a-multi-region-cluster-52d9</link>
      <guid>https://dev.to/harshitmehta15/mongodb-from-one-machine-to-a-multi-region-cluster-52d9</guid>
      <description>&lt;h2&gt;
  
  
  A beginner's guide to where data lives, how capacity grows, and what Atlas manages
&lt;/h2&gt;

&lt;p&gt;MongoDB can begin as one database process on one computer. As an application gets more important, you add copies for safety. As its data or traffic outgrows one machine, you split data across several groups of machines. When users are worldwide, you place those groups in more than one region.&lt;/p&gt;

&lt;p&gt;This article builds that picture slowly, first using MongoDB Atlas and then using a self-managed MongoDB Community deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Four ideas to learn first
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Term&lt;/th&gt;
&lt;th&gt;Plain-English meaning&lt;/th&gt;
&lt;th&gt;Main job&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Node&lt;/td&gt;
&lt;td&gt;One running &lt;code&gt;mongod&lt;/code&gt; or &lt;code&gt;mongos&lt;/code&gt; process, usually on one VM or one container/pod&lt;/td&gt;
&lt;td&gt;Performs one MongoDB role&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Replica set&lt;/td&gt;
&lt;td&gt;A group of nodes holding copies of the same data&lt;/td&gt;
&lt;td&gt;Survives node failures&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shard&lt;/td&gt;
&lt;td&gt;One slice of the total data in a sharded cluster&lt;/td&gt;
&lt;td&gt;Adds storage and write capacity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cluster&lt;/td&gt;
&lt;td&gt;The whole database system: shards, routers, config servers, and their networking&lt;/td&gt;
&lt;td&gt;Serves the application&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A node is not necessarily a physical machine. It is a running program. In a simple production design, one MongoDB data-bearing node normally gets its own VM or Kubernetes pod and persistent disk.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Stage zero: one computer, one database
&lt;/h2&gt;

&lt;p&gt;A local development setup can be as small as this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Laptop or one cloud VM
┌──────────────────────────────────┐
│ mongod                            │
│  * database engine                │
│  * data files on local disk       │
│  * indexes on local disk          │
└──────────────────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application connects straight to &lt;code&gt;mongod&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;App  ─────────►  mongod  ─────────►  disk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At this point, every collection, document, and index lives on one machine. It is easy to run, but it has two large weaknesses:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the machine or disk fails, the database is unavailable and data may be at risk.&lt;/li&gt;
&lt;li&gt;One machine has a fixed ceiling for disk, memory, CPU, and write throughput.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. First production step: a replica set
&lt;/h2&gt;

&lt;p&gt;A replica set is MongoDB's high-availability unit. The members hold the same logical data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    writes
App ─────────────► Primary
                     │
              replication stream
              ┌──────┴──────┐
              ▼             ▼
          Secondary A   Secondary B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The primary accepts normal writes. Secondaries continuously copy the primary's operation log and apply the same changes. If the primary disappears, the remaining members elect a new primary.&lt;/p&gt;

&lt;p&gt;A common three-member AWS layout is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AWS Region: eu-west-1

Availability Zone A       Availability Zone B       Availability Zone C
┌──────────────────┐      ┌──────────────────┐      ┌──────────────────┐
│ VM / pod          │      │ VM / pod          │      │ VM / pod          │
│ Primary           │      │ Secondary A       │      │ Secondary B       │
│ Persistent volume │      │ Persistent volume │      │ Persistent volume │
└──────────────────┘      └──────────────────┘      └──────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The three members are in the same AWS region but separate Availability Zones (AZs). An AZ is a distinct failure domain, roughly a separate data-center location within a region. If AZ A fails, B and C can elect a primary and continue.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is stored on each replica-set member?
&lt;/h3&gt;

&lt;p&gt;Each data-bearing member stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The database documents assigned to that replica set&lt;/li&gt;
&lt;li&gt;The normal MongoDB indexes for those documents&lt;/li&gt;
&lt;li&gt;The operation log used to replicate changes&lt;/li&gt;
&lt;li&gt;Local runtime state and diagnostics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means storage is deliberately duplicated. If the replica set contains 1 TB of data, three fully data-bearing members require roughly three copies of that data, plus working space and backups.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. When one replica set is not enough: sharding
&lt;/h2&gt;

&lt;p&gt;Replication gives copies. It does not split the data load. If a single collection is too large or too busy for one replica set, MongoDB can shard it.&lt;/p&gt;

&lt;p&gt;A sharded cluster divides a collection into ranges of a chosen field, called the shard key. Each range is called a chunk, and chunks are placed on shards.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Collection: orders, sharded by customerId

customerId 0 ───────── 999       ► Shard 1
customerId 1000 ────── 1999      ► Shard 2
customerId 2000 ────── 2999      ► Shard 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each shard is usually itself a replica set, so each slice is safe against node failures.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                              Sharded cluster

                 ┌──────────────────────────────────────┐
App ───────────► │ mongos routers                        │
                 └───────────────┬──────────────────────┘
                                 │ consult metadata
                 ┌───────────────▼──────────────────────┐
                 │ Config server replica set (CSRS)     │
                 │ cluster map: shards, chunks, rules   │
                 └──────────────────────────────────────┘

   ┌────────────────────┐  ┌────────────────────┐  ┌────────────────────┐
   │ Shard 1 replica set│  │ Shard 2 replica set│  │ Shard 3 replica set│
   │ data range A       │  │ data range B       │  │ data range C       │
   └────────────────────┘  └────────────────────┘  └────────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The three special roles in a sharded cluster
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Shards&lt;/strong&gt; store the actual application documents and their normal indexes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Config servers&lt;/strong&gt; store the durable map of the cluster: which shards exist, which databases and collections are sharded, which chunks exist, and where those chunks belong. Config servers are a three-member replica set in a typical production deployment. They are metadata servers, not the place where normal application collection data lives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;mongos&lt;/code&gt; routers&lt;/strong&gt; are stateless request routers. Your application connects to them. A router uses the config-server metadata to decide which shard or shards need a request. It does not persist the collection data or the cluster map as its primary store.&lt;/p&gt;

&lt;p&gt;A cluster can have several &lt;code&gt;mongos&lt;/code&gt; routers for availability and connection capacity. They may run beside application servers, as dedicated services, or as Kubernetes pods.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. How data grows inside one region
&lt;/h2&gt;

&lt;p&gt;Suppose your &lt;code&gt;orders&lt;/code&gt; collection is growing. MongoDB initially spreads chunks among existing shards. When a shard is too full or a new shard is added, the balancer can migrate chunks to spread the data and workload.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Before adding capacity

Shard 1: [A][B][C][D][E]        Shard 2: [F][G]

After the balancer moves chunks

Shard 1: [A][B][C]              Shard 2: [D][E][F][G]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding a new shard gives the balancer another destination:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shard 1: [A][B][C]     Shard 2: [D][E]     Shard 3: [F][G]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is horizontal growth: more machines share the work. It is different from vertical growth, where you give one machine a larger disk or more CPU.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why the shard key matters
&lt;/h3&gt;

&lt;p&gt;The shard key determines how documents are distributed and how efficiently requests can be targeted.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A query that includes the shard key can often go to one shard.&lt;/li&gt;
&lt;li&gt;A query without it may need to ask every shard, called a scatter-gather query.&lt;/li&gt;
&lt;li&gt;A poorly chosen key can send most writes to one shard, creating a hotspot.&lt;/li&gt;
&lt;li&gt;A well-chosen key spreads writes and data predictably.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, an ever-increasing timestamp can concentrate inserts at the newest end of the data range. A hashed shard key can distribute inserts more evenly, while a ranged shard key can be useful for locality or range queries. The right choice depends on actual query and write patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Map: local, regional, and multi-region placement
&lt;/h2&gt;

&lt;p&gt;A “region” is a geographic cloud location. AWS examples include &lt;code&gt;us-east-1&lt;/code&gt; (Northern Virginia), &lt;code&gt;eu-west-1&lt;/code&gt; (Ireland), and &lt;code&gt;ap-southeast-2&lt;/code&gt; (Sydney). A region contains multiple AZs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                         World map, conceptual

   North America                    Europe                       Asia-Pacific
┌──────────────────┐         ┌──────────────────┐         ┌──────────────────┐
│ AWS us-east-1    │         │ AWS eu-west-1    │         │ AWS ap-southeast │
│ Virginia         │         │ Ireland          │         │ Sydney           │
└──────────────────┘         └──────────────────┘         └──────────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Same-region, multi-AZ: the normal availability design
&lt;/h3&gt;

&lt;p&gt;For most applications, put members of every replica set across three AZs in one region. This gives low latency and withstands the loss of one AZ.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Region: eu-west-1

AZ A                 AZ B                 AZ C
[Primary]            [Secondary]          [Secondary]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Multi-region: choose the reason before the topology
&lt;/h3&gt;

&lt;p&gt;A second region is not automatically better. It adds network latency, cross-region transfer costs, operational complexity, and failure scenarios. Use it for a clear goal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disaster recovery: keep a copy far from the primary region.&lt;/li&gt;
&lt;li&gt;Read locality: let users read from a nearby region when the consistency model permits it.&lt;/li&gt;
&lt;li&gt;Data residency: keep certain users' data in a required geography.&lt;/li&gt;
&lt;li&gt;Low-latency writes for distinct regional data sets: keep each region's data near its writers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A common disaster-recovery layout looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Primary region: eu-west-1                 Recovery region: us-east-1

AZ A          AZ B          AZ C           AZ A
[Primary]     [Secondary]   [Secondary]    [Secondary / delayed or voting member]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cross-region member receives replication over a wide-area network. This can protect against a regional outage, but it will have higher replication lag than local members. The exact voting and election configuration must be designed carefully so a remote, lagging node does not unexpectedly become primary during a partial network split.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-region sharding: place data, not merely copies
&lt;/h3&gt;

&lt;p&gt;For a globally distributed workload, you can use zones (previously called tag-aware sharding) to associate shard-key ranges with geographic regions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shard-key range / zone              Preferred shard location
customers in EU  ► zone EU          EU shard(s)
customers in US  ► zone US          US shard(s)
customers in APAC ► zone APAC       APAC shard(s)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    Global application
                  /          |           \
             EU users      US users     APAC users
                |              |            |
        EU mongos/cluster   US ...       APAC ...
                |              |            |
       EU-zone data shards  US-zone     APAC-zone
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zones can help keep a particular shard-key range on selected shards. They are powerful, but they require a shard key that actually represents the desired placement, such as tenant region plus tenant ID. They do not magically route arbitrary documents geographically.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What this looks like on VMs versus Kubernetes pods
&lt;/h2&gt;

&lt;p&gt;The logical architecture is the same. The infrastructure packaging differs.&lt;/p&gt;

&lt;h3&gt;
  
  
  On virtual machines
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;EC2 VM 1: mongod, shard-1 member, attached EBS volume
EC2 VM 2: mongod, shard-1 member, attached EBS volume
EC2 VM 3: mongod, shard-1 member, attached EBS volume
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each node runs as an operating-system service. The database files live on durable attached storage such as EBS. A VM restart should not erase that storage.&lt;/p&gt;

&lt;h3&gt;
  
  
  On Kubernetes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;StatefulSet: shard-1

Pod shard-1-0  ──► PersistentVolumeClaim ──► PersistentVolume
Pod shard-1-1  ──► PersistentVolumeClaim ──► PersistentVolume
Pod shard-1-2  ──► PersistentVolumeClaim ──► PersistentVolume
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A pod is disposable. Its database data must not be stored only in the pod's temporary filesystem. Each &lt;code&gt;mongod&lt;/code&gt; pod needs persistent storage, stable network identity, resource limits, anti-affinity rules to avoid placing all replicas on one worker, and a backup plan.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mongos&lt;/code&gt; routers are different: they are stateless. They can typically run as a Deployment with multiple pods, and do not require persistent volumes for application data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;App pods ──► Service / load balancer ──► mongos pods ──► shard and config-server pods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Atlas: the managed version of this work
&lt;/h2&gt;

&lt;p&gt;MongoDB Atlas is a managed service. You choose the desired outcomes, and Atlas provisions and operates the underlying MongoDB deployment.&lt;/p&gt;

&lt;p&gt;In Atlas, you typically choose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud provider and region(s)&lt;/li&gt;
&lt;li&gt;Cluster tier and storage capacity&lt;/li&gt;
&lt;li&gt;Replica-set or sharded-cluster topology&lt;/li&gt;
&lt;li&gt;Number of shards, when sharding is needed&lt;/li&gt;
&lt;li&gt;Multi-region placement and regional priorities&lt;/li&gt;
&lt;li&gt;Network access, private connectivity, encryption, backups, and alerting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Atlas then manages work that a self-managed team would otherwise own:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;Atlas&lt;/th&gt;
&lt;th&gt;Self-managed Community deployment&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Provision VMs/pods and storage&lt;/td&gt;
&lt;td&gt;Atlas does it&lt;/td&gt;
&lt;td&gt;Your team does it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Place nodes across AZs&lt;/td&gt;
&lt;td&gt;Atlas does it from your topology choice&lt;/td&gt;
&lt;td&gt;Your team designs and enforces it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Run/configure config servers and &lt;code&gt;mongos&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Atlas does it&lt;/td&gt;
&lt;td&gt;Your team runs them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Monitoring and alerting&lt;/td&gt;
&lt;td&gt;Built in&lt;/td&gt;
&lt;td&gt;Your team builds/operates it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backups and restore workflows&lt;/td&gt;
&lt;td&gt;Managed options&lt;/td&gt;
&lt;td&gt;Your team designs, tests, and operates them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Patching and upgrades&lt;/td&gt;
&lt;td&gt;Managed workflow&lt;/td&gt;
&lt;td&gt;Your team plans and executes them&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Replica-set elections and recovery&lt;/td&gt;
&lt;td&gt;MongoDB behavior, with Atlas operating the hosts&lt;/td&gt;
&lt;td&gt;MongoDB behavior, with your team operating the hosts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Atlas does not remove application-level decisions. You still must choose good data models, indexes, access patterns, shard keys, retention policies, security roles, and regional requirements. Atlas makes the infrastructure and operational layer substantially easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Self-managed MongoDB Community: what you configure
&lt;/h2&gt;

&lt;p&gt;MongoDB Community can run replica sets and sharded clusters. You supply the infrastructure and configure the processes.&lt;/p&gt;

&lt;p&gt;At a high level, a self-managed sharded cluster comes up in this order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create machines/pods, networking, DNS, persistent disks, certificates, monitoring, and backups.&lt;/li&gt;
&lt;li&gt;Start the three config-server replica-set members.&lt;/li&gt;
&lt;li&gt;Start the replica-set members for each shard.&lt;/li&gt;
&lt;li&gt;Start one or more &lt;code&gt;mongos&lt;/code&gt; routers, pointing each at the config-server replica set.&lt;/li&gt;
&lt;li&gt;Connect to a &lt;code&gt;mongos&lt;/code&gt; router and add the shard replica sets to the cluster.&lt;/li&gt;
&lt;li&gt;Enable sharding for the database and collection, choosing a shard key.&lt;/li&gt;
&lt;li&gt;Test failure, recovery, backup restore, monitoring, and scaling before production use.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A &lt;code&gt;mongos&lt;/code&gt; is told how to find the config servers, not every shard directly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongos
  │
  └── config server replica set address
          │
          └── cluster metadata identifies the shard replica sets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cloud locations themselves are configured outside MongoDB: AWS account/region/AZ selection, VPCs, subnets, routing, security groups, DNS, and Kubernetes scheduling. MongoDB is configured with network addresses that let its members communicate.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. A practical growth path
&lt;/h2&gt;

&lt;p&gt;A sensible progression for a new team is usually:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with one replica set in one region, distributed across three AZs.&lt;/li&gt;
&lt;li&gt;Monitor disk growth, working-set memory, slow queries, CPU, replication lag, and backup/restore performance.&lt;/li&gt;
&lt;li&gt;Improve schema design and indexes before assuming sharding is needed.&lt;/li&gt;
&lt;li&gt;Scale the replica-set hardware when that is sufficient.&lt;/li&gt;
&lt;li&gt;Shard only when capacity or throughput truly exceeds what one replica set can reasonably serve, and only after choosing a proven shard key.&lt;/li&gt;
&lt;li&gt;Add multi-region placement when there is a concrete recovery, latency, or residency requirement.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Sharding is an architecture choice, not merely a “large database” switch. It makes storage and writes scale horizontally, but it also introduces routers, metadata, balancing, chunk movement, and more operational complexity.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Key takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A cluster is the whole system, not one machine.&lt;/li&gt;
&lt;li&gt;A shard is normally a replica set that stores one portion of total data.&lt;/li&gt;
&lt;li&gt;Replica-set members are separate processes on separate VMs or pods, each with durable storage.&lt;/li&gt;
&lt;li&gt;Config servers store the sharded-cluster map; &lt;code&gt;mongos&lt;/code&gt; routes requests using that map.&lt;/li&gt;
&lt;li&gt;Same-region, multi-AZ placement is the usual first high-availability design.&lt;/li&gt;
&lt;li&gt;Multi-region deployment should serve a clear purpose and be designed around latency, recovery, and data placement.&lt;/li&gt;
&lt;li&gt;Atlas manages the operational machinery; self-managed Community requires your team to build and run it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.mongodb.com/docs/manual/core/sharded-cluster-components/" rel="noopener noreferrer"&gt;MongoDB Manual: Sharded Cluster Components&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mongodb.com/docs/manual/replication/" rel="noopener noreferrer"&gt;MongoDB Manual: Replication&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mongodb.com/docs/manual/core/zone-sharding/" rel="noopener noreferrer"&gt;MongoDB Manual: Zones&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.mongodb.com/docs/atlas/cluster-config/multi-cloud-multi-region-config/" rel="noopener noreferrer"&gt;MongoDB Atlas: Multi-Region Deployments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>replicaset</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Earn While You Learn - Opportunities at Topcoder</title>
      <dc:creator>Harshit Mehta</dc:creator>
      <pubDate>Tue, 12 Jan 2021 03:16:58 +0000</pubDate>
      <link>https://dev.to/harshitmehta15/earn-while-you-learn-competition-opportunities-at-topcoder-2hjn</link>
      <guid>https://dev.to/harshitmehta15/earn-while-you-learn-competition-opportunities-at-topcoder-2hjn</guid>
      <description>&lt;p&gt;Hey Learners,&amp;nbsp;&lt;/p&gt;

&lt;p&gt;Now that you have landed here to learn. I am sure you understand that the tech landscape is changing more rapidly than ever. The need for upskilling and reskilling is becoming all the more important. With the growing digital economy, there is a tremendous opportunity for growth. But, let’s not forget that growth opportunities come with a need for upskilling the existing and potential workforce.&lt;/p&gt;

&lt;p&gt;Once you have realized the importance of and need for upskilling, you’ll quickly learn that you need to practice those skills. The most beneficial form of practice comes from solving real-world problems. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.topcoder.com/community/learn" rel="noopener noreferrer"&gt;&lt;strong&gt;Topcoder&lt;/strong&gt;&lt;/a&gt; gives you just the right opportunity to do that. Not only can you practice skills, you can also earn money while you apply what you have learned in competitions. While you compete your Topcoder profile keeps improving, with verified skill badge additions and an increasing Topcoder rating.&lt;/p&gt;

&lt;p&gt;I am sure your next question will be:&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Topcoder?&amp;nbsp;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  And how do I get to do work on real-world projects? How can I earn while I learn?
&lt;/h2&gt;

&lt;p&gt;Topcoder is a marketplace where we connect talent (like you) with companies that are seeking innovation from our community. We have several Fortune 500 clients like NASA, IBM, T-mobile, Adobe, etc., that give us interesting problems to solve. We then turn those problems over to the Topcoder community members in the form of challenges and gig work opportunities.&lt;/p&gt;

&lt;p&gt;While it may be easy to think that large organizations like T-Mobile, &lt;a href="https://www.topcoder.com/case-studies/microsoft/" rel="noopener noreferrer"&gt;Microsoft&lt;/a&gt;, and &lt;a href="https://www.topcoder.com/case-studies/macys/" rel="noopener noreferrer"&gt;Macy’s&lt;/a&gt; have the inner depth and scale to tackle projects solo, we find innovative Fortune 500 companies are always looking for ways to launch faster and maximize their development outputs. For example, for &lt;a href="https://www.youtube.com/watch?v=7_0FPLOOTYA" rel="noopener noreferrer"&gt;T-Mobile&lt;/a&gt;, Topcoder delivers the scale they need to increase their in-house teams’ productivity and throughput.&lt;/p&gt;

&lt;p&gt;Other than competing, there’s actually a lot you can do at Topcoder. Read more below in the last section.&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%2Fi%2F0o81362rem1v61gek2tr.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%2Fi%2F0o81362rem1v61gek2tr.png" alt="Alt Text" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to get started: Still a beginner? Don’t Worry!
&lt;/h2&gt;

&lt;p&gt;There are two ways to jump right into the mix of things at Topcoder.&amp;nbsp;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="http://topcoder.com/challenges" rel="noopener noreferrer"&gt;Topcoder Challenges&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.topcoder.com/gigs" rel="noopener noreferrer"&gt;Topcoder Gig Work Opportunities&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Topcoder consists of the best developers, designers, and data scientists from all over the world; but that is not a reason to feel nervous or not good enough. Consider the Topcoder platform as an opportunity to learn and grow with the best. The community is always welcoming and helps newbies get up to speed, learn and start winning. They love tough competition and are constantly helping each other to grow that competition.&lt;/p&gt;

&lt;p&gt;Topcoder offers you things no other company can offer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No background, experience check or CV to start competing and learning&lt;/strong&gt;. Some traditional companies will reject your CV just because they believe you are not experienced enough or offer you a small fixed pay for the next year until you gain the necessary experience. Topcoder encourages you to join and try your skills on real problems right away, and to win money consistent with your skills.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No discrimination. Ever.&lt;/strong&gt; Your location, sex, or anything else makes no difference! From day one you are judged only by the quality of the output you deliver. That’s how the community gets to know you and is the only thing that matters for your success at Topcoder.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Incredibly rapid learning curve&lt;/strong&gt;. The power of community: even when you lose a challenge, you gain priceless experience. You can ask the copilot (the technical coordinator of the challenge), other competitors and community members if you are stuck with something and you can see the winning submission after the challenge. If you take it seriously, after each challenge, you will presumably learn enough to perform well in the next challenge of the same kind. Also, the diversity of technologies and problems offered by Topcoder clients helps you gain wide experience, unlike most of the job roles at conventional companies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A power-packed tournament and a fully paid-trip&lt;/strong&gt;. &lt;a href="https://tco21.topcoder.com/" rel="noopener noreferrer"&gt;Topcoder Open&lt;/a&gt; that will allow you to prove yourself as the best of the best. Regular Competing helps you earn points and win a fully-paid trip to the United States, where you compete with the best of the best  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In short, at Topcoder you can easily solve the right problems and find the right guidance. But, Topcoder is not only about competing. Imagine a readily available community for you to be a part of, discussing the challenges with the best and at the end of the competition &lt;strong&gt;getting access to the winning submission&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s a link to our &lt;a href="https://www.topcoder.com/community/practice" rel="noopener noreferrer"&gt;practice challenges&lt;/a&gt; and &lt;a href="https://www.topcoder.com/challenges?bucket=openForRegistration&amp;amp;search=Skill%20Builder&amp;amp;tracks[DS]=true&amp;amp;tracks[Des]=true&amp;amp;tracks[Dev]=true&amp;amp;tracks[QA]=true&amp;amp;types[]=CH&amp;amp;types[]=F2F&amp;amp;types[]=TSK" rel="noopener noreferrer"&gt;Skill Builder Challenges&lt;/a&gt; designed specifically to practice/test the skills you are learning which will help you get started on Topcoder Challenges.&lt;/p&gt;

&lt;p&gt;Also, when you have some time, check out this article about a member’s &lt;a href="https://www.topcoder.com/my-first-year-as-a-topcoder-member/" rel="noopener noreferrer"&gt;first year at Topcoder&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Will my Topcoder experience help me get jobs outside of Topcoder?&amp;nbsp;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Yes, your Topcoder profile will help you!
&lt;/h2&gt;

&lt;p&gt;Topcoder profiles and ratings have been used by many customers and clients at Topcoder. Companies like Google, Yahoo, Nvidia, Brooks Automation, Microsoft, Paypal, Verizon, Citigroup, J.P. Morgan, Cryptic Studios, Facebook, etc. have hired Topcoder talent in the past.&lt;/p&gt;

&lt;p&gt;While your Topcoder background helps you get these opportunities, adding your Topcoder rating and skills to your CV gives it that all-important edge to stand out from the pack. Imagine a CV which showcases experience of working for clients like NASA, IBM, T-Mobile and many more. Who would not pick that CV up?&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%2Fi%2Fd0ua7nprs93y7aoh0u4a.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%2Fi%2Fd0ua7nprs93y7aoh0u4a.png" alt="Alt Text" width="800" height="474"&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%2Fi%2F8bgy0d84rr67bln28f1l.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%2Fi%2F8bgy0d84rr67bln28f1l.png" alt="Alt Text" width="800" height="667"&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%2Fi%2Fatlakdv2j5h7khbmvvfc.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%2Fi%2Fatlakdv2j5h7khbmvvfc.png" alt="Alt Text" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why even search for a job? You can also compete and perform other roles at Topcoder for a living. Many of our members do just that.&amp;nbsp;&lt;/p&gt;

&lt;h2&gt;
  
  
  Does Topcoder sound interesting? Gig Work and Challenges are not the only things you can do at Topcoder.&amp;nbsp;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  So, what else can you do at Topcoder?
&lt;/h2&gt;

&lt;p&gt;There are a number of different avenues you can take as a Topcoder community member. You can start out by taking on some gig work or trying out some challenges to get accustomed to our platform. Just remember that is not all you can do. This article is a great way to learn all about the different roles you can take on at Topcoder to grow your career or earn extra money. Take a look at &lt;a href="https://www.topcoder.com/the-many-roles-you-can-take-at-topcoder/" rel="noopener noreferrer"&gt;The Many Roles You Can Take At Topcoder&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You should definitely check out how Topcoder members around the world become friends and travel together. Join our &lt;a href="https://www.facebook.com/groups/topcoder.nation" rel="noopener noreferrer"&gt;Topcoder Nation&lt;/a&gt; Facebook group to be even closer to the community, &lt;a href="https://www.topcoder.com/topcoder-nation-three-idiots-travel-asia-pilot/" rel="noopener noreferrer"&gt;establish new friendships, learn, travel and grow together.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, now that 2021 is here with opportunities missed out in 2020, check out some of the things we have planned for the community this year and pick the ones you can benefit from.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://us02web.zoom.us/meeting/register/tZMsdO-rrDMiHNPnEbEksD-259GbzAuTbid7" rel="noopener noreferrer"&gt;Weekly chats with the community team&lt;/a&gt; every Monday at 10:00 UTC -5. Kick-off each week with the latest at Topcoder and talk to us face to face for help, networking, or to just say "Hello".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.topcoder.com/community/member-programs/beta-testers" rel="noopener noreferrer"&gt;Beta Testers group&lt;/a&gt; - access to the latest features of the Topcoder platform and help us with new testing experiences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Our &lt;a href="https://www.topcoder.com/community/member-programs/crowd-for-good/yerc" rel="noopener noreferrer"&gt;Crowd for Good initiative&lt;/a&gt; for the Yellowstone Economic Research Center (YERC).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interesting timed SRM-like contests for Software Developers - &lt;a href="https://www.topcoder.com/thrive/articles/rdm-competition-faqs-and-rules" rel="noopener noreferrer"&gt;Rapid Development Matches&lt;/a&gt; (RDMs) focus on making you practice and get better at web/mobile development languages, technologies, libraries and frameworks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;New Topcoder Skill Builder challenges where you can ramp up on new technologies, get the verified skill added to your profile, practice for &lt;a href="https://www.topcoder.com/thrive/articles/rdm-competition-faqs-and-rules" rel="noopener noreferrer"&gt;RDM&lt;/a&gt;s and help you get a gig.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;More &lt;a href="https://www.topcoder.com/community/events" rel="noopener noreferrer"&gt;Rookie SRMs&lt;/a&gt; for newbies to get motivated for competitive programming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;More &lt;a href="https://www.topcoder.com/thrive" rel="noopener noreferrer"&gt;THRIVE&lt;/a&gt; articles for you to digest with plans to top the over 1,000 we added in 2020.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.topcoder.com/community/member-programs/webinars" rel="noopener noreferrer"&gt;New webinars&lt;/a&gt; with field experts and professional speakers looking to help you advance your career, your skills, and your personal brand.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At Topcoder, we are not just some website you can earn money from or learn on, we truly are a community of like-minded folks cheering each other on for success. We will welcome you and help you grow into what you want to be.&lt;/p&gt;

</description>
      <category>topcoder</category>
      <category>javascript</category>
      <category>react</category>
      <category>angular</category>
    </item>
  </channel>
</rss>
