In MongoDB, a set of replicated nodes is called a replica set. One of the nodes in a replica set is the primary node, and the other nodes are secondary nodes. Read requests are distributed between each of the nodes. However, only the primary node can be written to, and updates made to the primary node are then replicated to the other nodes.
Do you have an application with a growing user base, or do you have an application that you anticipate will grow in the future? If so, then the load on your database is most likely growing as your application saves larger amounts of data. Whether it’s the number of connections needed, the amount of data to be stored, or the increased processing power, any database will eventually hit a limit on what it can handle.
Scalability is the ability to expand or contract the capacity of system resources in order to support the changing usage of your application. This can refer both to increasing and decreasing usage of the application.
The first action you might take to address the need for increased capacity is application and database optimization. Examples include optimizing the application code, caching, and appropriately indexing your query patterns . These optimizations increase the efficiency of your application and should bring some relief. However, there comes a point when system resource limits are reached. At this point, you will want to consider scaling your database vertically, horizontally, or both.
What’s the Difference Between Horizontal and Vertical Scaling?
What is Vertical Scaling?
Vertical scaling refers to increasing the processing power of a single server or cluster. Both relational and non-relational databases can scale up, but eventually, there will be a limit in terms of maximum processing power and throughput. Additionally, there are increased costs with high-performance hardware, as costs do not scale linearly.
There is also a physical limit on the amount of CPUs, memory, network interfaces, and hard-drives that can be used on a single machine. For those scaling up using a cloud platform provider, you will eventually reach the highest tier of machine available.
What is Horizontal Scaling?
Horizontal scaling, also known as scale-out, refers to bringing on additional nodes to share the load. This is difficult with relational databases due to the difficulty in spreading out related data across nodes. With non-relational databases, this is made simpler since collections are self-contained and not coupled relationally. This allows them to be distributed across nodes more simply, as queries do not have to “join” them together across nodes.
MongoDB horizontal scaling (sharding) tries to be as transparent as possible, but may require application architecture and code changes. How you store and query the data can significantly affect your application performance.
Database systems that are scaled horizontally are also more complicated to manage and maintain, leading to more work for you and your team. This is where MongoDB Atlas can help with its out-of-the-box sharding.
Definition: Scaling technique is a method of placing respondents in continuation of gradual change in the pre-assigned values, symbols or numbers based on the features of a particular object as per the defined rules. All the scaling techniques are based on four pillars, i.e., order, description, distance and origin.
An interval scale is also called a cardinal scale which is the numerical labelling with the same difference among the consecutive measurement units. With the help of this scaling technique, researchers can obtain a better comparison between the objects.
For example; A survey conducted by an automobile company to know the number of vehicles owned by the people living in a particular area who can be its prospective customers in future. It adopted the interval scaling technique for the purpose and provided the units as 1, 2, 3, 4, 5, 6 to select from.
One of the most superior measurement technique is the ratio scale. Similar to an interval scale, a ratio scale is an abstract number system. It allows measurement at proper intervals, order, categorization and distance, with an added property of originating from a fixed zero point. Here, the comparison can be made in terms of the acquired ratio.
For example, A health product manufacturing company surveyed to identify the level of obesity in a particular locality. It released the following survey questionnaire:
Select a category to which your weight belongs to:
|Particular||Nominal Scale||Ordinal Scale||Interval Scale||Ratio Scale|
|Characteristics||Description||Order||Distance||Description, Order, Distance and Origin|
|Sequential Arrangement||Not Applicable||Applicable||Applicable||Applicable|
|Fixed Zero Point||Not Applicable||Not Applicable||Not Applicable||Applicable|
|Multiplication and Division||Not Applicable||Not Applicable||Not Applicable||Applicable|
|Addition and Subtraction||Not Applicable||Not Applicable||Applicable||Applicable|
|Difference between Variables||Non-Measurable||Non-Measurable||Measurable||Measurable|
|Mean||Not Applicable||Not Applicable||Applicable||Applicable|
Other Scaling Techniques
Scaling of objects can be used for a comparative study between more than one objects (products, services, brands, events, etc.). Or can be individually carried out to understand the consumer’s behaviour and response towards a particular object.
A paired comparison symbolizes two variables from which the respondent needs to select one. This technique is mainly used at the time of product testing, to facilitate the consumers with a comparative analysis of the two major products in the market.
For example, A market survey was conducted to find out consumer’s preference for the network service provider brands, A and B. The outcome of the survey was as follows:
Brand ‘A’ = 57%
Brand ‘B’ = 43%
Thus, it is visible that the consumers prefer brand ‘A’, over brand ‘B’.
For example, A soap manufacturing company conducted a rank order scaling to find out the orderly preference of the consumers. It asked the respondents to rank the following brands in the sequence of their choice:
Q-sort scaling is a technique used for sorting the most appropriate objects out of a large number of given variables. It emphasizes on the ranking of the given objects in a descending order to form similar piles based on specific attributes.
It is a graphical rating scale where the respondents are free to place the object at a position of their choice. It is done by selecting and marking a point along the vertical or horizontal line which ranges between two extreme criteria.
For example, A mattress manufacturing company used a continuous rating scale to find out the level of customer satisfaction for its new comfy bedding. The response can be taken in the following different ways (stated as versions here):
Itemized scale is another essential technique under the non-comparative scales. It emphasizes on choosing a particular category among the various given categories by the respondents. Each class is briefly defined by the researchers to facilitate such selection.
- Likert Scale: In the Likert scale, the researcher provides some statements and ask the respondents to mark their level of agreement or disagreement over these statements by selecting any one of the options from the five given alternatives.
For example, A shoes manufacturing company adopted the Likert scale technique for its new sports shoe range named Z sports shoes. The purpose is to know the agreement or disagreement of the respondents.
For this, the researcher asked the respondents to circle a number representing the most suitable answer according to them, in the following representation:
|Statement||Strongly Disagree||Disagree||Neither Agree Nor Disagree||Agree||Strongly Agree|
|Z sports shoes are very light weight||1||2||3||4||5|
|Z sports shoes are extremely comfortable||1||2||3||4||5|
|Z sports shoes look too trendy||1||2||3||4||5|
|I will definitely recommend Z sports shoes to friends, family and colleagues||1||2||3||4||5|
The above illustration will help the company to understand what the customers think about its products. Also, whether there is any need for improvement or not.
From the above diagram, we can analyze that the customer finds the product of superior quality; however, the brand needs to focus more on the styling of its watches.
With the help of the above scale, we can say that the company needs to improve its package in terms of value for money. However, the decisive point is that the interface is quite user-friendly for the customers.
Joey is working on creating a scale model of his house. He is using uniform scaling to build his scale model. He is using a scaling factor of 1:24. So his miniature house is going to be really small compared to his life-size house. Right now, Joey is working on converting a roof measurement of his life-size house to the roof measurement of his scale model miniature house. He uses the math calculation discussed in this lesson. His life-size roof measurement is 13 feet.
Making his calculation, he finds that his miniature house has a roof measurement of 0.54 feet with a scaling factor of 1:24. Joey can also use this same calculation to find a life-size measurement if he only knows the model measurement. For example, say Joey has built a little model of a future boat he wants to build. The scaling factor is 1:8 for the boat, and the model boat has a width measurement of 6 inches. The variable for the math calculation in this case will be on the bottom.