Generally speaking, indexes should not have a very obvious impact on write performance. Of course, if you need to add a lot of indexes, that is another matter. If you haven't tried it before, it is recommended to try it first to see how much side effects the index you need brings, and whether it is within the acceptable range. If so, that's great, problem solved. If you can't accept it, you can consider the following two options:
Use sharding for transformation. You should already know what sharding is, no need to explain more. The problem brought by this solution is obviously that the number of servers will increase significantly, which is also the inevitable result of horizontal expansion. In the long run, if your business moves forward, this is the path you must take, so plan ahead.
Create different indexes on different replication set points If you are still running on a single node, it is recommended to upgrade to a replica set as soon as possible. There are many cases where single-node hardware failure causes data to be lost and cannot be recovered. Don’t wait until it happens before you regret it. Under the premise of replica sets, each result can be independently indexed.
Stop node
Remove the replica set configuration and start with different ports
Build the index you need on this node
Restart with original configuration
It should be noted that the replica set still needs to complete all write operations on the primary node, so too many indexes may still cause problems. Everything still needs to be tested by yourself to draw conclusions.
Generally speaking, indexes should not have a very obvious impact on write performance. Of course, if you need to add a lot of indexes, that is another matter. If you haven't tried it before, it is recommended to try it first to see how much side effects the index you need brings, and whether it is within the acceptable range. If so, that's great, problem solved. If you can't accept it, you can consider the following two options:
Use sharding for transformation.
You should already know what sharding is, no need to explain more. The problem brought by this solution is obviously that the number of servers will increase significantly, which is also the inevitable result of horizontal expansion. In the long run, if your business moves forward, this is the path you must take, so plan ahead.
Create different indexes on different replication set points
If you are still running on a single node, it is recommended to upgrade to a replica set as soon as possible. There are many cases where single-node hardware failure causes data to be lost and cannot be recovered. Don’t wait until it happens before you regret it. Under the premise of replica sets, each result can be independently indexed.
Stop node
Remove the replica set configuration and start with different ports
Build the index you need on this node
Restart with original configuration
It should be noted that the replica set still needs to complete all write operations on the primary node, so too many indexes may still cause problems. Everything still needs to be tested by yourself to draw conclusions.
Either add index or change to elasticsearch or hbase. It is recommended to change to elasticsearch as soon as possible