Sub-Library Solution-Actual operation

Source: Internet
Author: User


    • Flow chart
    • Database design
    • Test Data Description
    • Problems and difficulties

First, the flowchart


1, after the information data summary, has the processing program processing, according to the algorithm, distributes the index library on the database server specified by the algorithm until it is stored in the data storage table below the corresponding index library.

2, each region is the country, the following can have more than one data server, but this region (country) The following index library cannot be duplicated. Because it is convenient for subsequent data query.

3, when there is data to reach the index library, the need to store data in case. By default, the table is not stored under the index library. At this point the program creates the first storage table. When the data reaches the storage limit we specify for this storage table, a second storage table is created, and subsequent data is stored in the second storage table. And so on

Second, the database design

1. Database Server Configuration table: DBServer

[ID]: Primary key

[Dbtypeid]: Database type ID (for example: domestic 1=d1, domestic 2=d2, foreign 1=h1)

[ServerIP]: Database server IP

[UID]: User name

[PWD]: Password

[Remark]: Remarks description

[Maxdatadbcount]: Maximum number of data storage tables can be created

[Sequence]: Sort


Why do I have a [maxdatadbcount] field? --Limit the creation of data store tables because each server performs differently. Requirements are not the same.

Why do I have a [Sequence] field? --Adjust database sequencing to facilitate data insertion

[Dbtypeid] and [ServerIP] relationship--Here the database type we can be compared to the region, a region can be distributed multiple databases.

2. Index Database Configuration table: Indexserverconfig

[ID]: Primary key

[Dbtypeid]: Database type ID (for example: domestic 1=d1, domestic 2=d2, foreign 1=h1)

[Indexdbno]: Index library number

[ServerID]: Database server ID where the current index library resides

[Hashvalues]: Data generated by the algorithm hashvalues (0~255)

[Currentdatadbno]: Data store table number corresponding to the current index library

[Maxdatacount]: Maximum data storage for the corresponding current Datastore table


1, [hashvalues]: Is that we based on the data characteristics and definitions of related algorithms generated corresponding values, here [hashvalues] is these worthy of collection.

2, [Indexdbno] and [hashvalues] the corresponding relationship

For example:

Indexdbno hashvalues

1 0,1,2,3,4,5,6,7

2 11,12,13

5 221,222,223,224,225

3, as shown in the flowchart above, each geographical country [Dbtypeid] can correspond to more than one database server, but the region below the index [indexdbno] and "hashvalues" one by one corresponding cannot be duplicated.

3. Storage Information Database configuration: Dataserverconfig

[ID]: Primary key

[Dbtypeid]: Database type ID (for example: domestic 1=d1, domestic 2=d2, foreign 1=h1)

[Datadbno]: Data storage table number

[Indexdbno]: Index library number

[ServerID]: Server number

[Maxdatacount]: The maximum amount of storage that is customized for the current data store table

Third, the test process

Database Server Configuration table: DBServer

Index Database Configuration table: Indexserverconfig

Storage Information Database configuration: Dataserverconfig

After a piece of information is passed through the algorithm into hashvalue=2, this information is the national territory number dbtypeid=1 data.

According to hashvalue=2 and Dbtypeid=1, we find the relevant index data in the Index Database configuration table: Indexserverconfig

The first data we see conforms to our criteria, which corresponds to the database server number indexdbno=1,serverid=11

So that we can according to Dbtypeid=1 and Serverid=11 and indexdbno=1. Locate the data store table under the Index library in the specific region of the database.


Data storage

Data query:

Iv. issues and difficulties--follow-up supplement

Sub-Library Solution-Actual operation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.