The invention discloses a rapid horizontal extending method for databases, which belongs to the field of
data migration and storage. The method comprises the following steps: a
monitoring and control system carries out monitoring on the
disk storage space of the existing
database, and when the
disk size reaches a preset storage capacity threshold, the
monitoring and control system triggers a hardware storage increasing action so as to make a hardware environment preparation for
data migration; and a
routing protocol carries out a modular computation on the instance number N of the current
database according to a major key ID to be inserted currently, and routes the line number of data to be inserted into a specified
database, and when the number of inserted lines exceeds a preset storage number threshold, the
routing protocol triggers a database segmentation action so as to migrate specified data into a new database, thereby completing the rapid horizontal extending of the database. The method disclosed by the invention can be applied to disk databases or memory databases, and the method is easy to use and simple, and avoids the problem that hotspots are distributed nonuniformly caused by traditional horizontal extending of databases; in addition, as the scale of migration of data segmented each time is small, the extending speed is improved. In conclusion, the overall architecture meets the requirements on
high availability, high reliability, high speed, high efficiency and the like.