1. Scenario Description
This scheme is used for the efficiency problem of the system station's function module in millions user, only the backstage administrator sends the station letter to the front desk user, the sending between the user and the user is not discussed.
2. Programme details
Assuming that the system's user capacity reached 200W, active users of 10W, the system backstage administrator to send a thank-you note to all users, if the previous storage mode, Message Queuing needs to insert 200W data, but in addition to active 10W users, other users have forgotten that they have the site's account, He may no longer log on to the site, and the database-saved message queue is meaningless.
The present table structure is as follows:
Message table
Numbered ID number
Title title VARCHAR2 (50) # 50
Body CONTENTS VARCHAR2 (1000)
Forwarding Status Status number
Date Sent Send_date
Send mode Send_type number
Latest founder FCU VARCHAR2 (50) # 50
More new LCU VARCHAR2 (50) 50
Creation Time FCD Date
Latest update Time LCD DATE
Delete Tag Delete_tag CHAR (1) 1
Message Container
Numbered ID number
Station Letter ID message_id number
Recipient ID member_id Number
Whether Read_status number has been read
member Form
Primary Key ID Number
Member Number U_number
E-mail U_email VARCHAR2 (200) 200
Password u_passwd VARCHAR2 (50) # 50
Enterprise certification company_admit Number (1) # 1
Account disabled Number (1) 1
Create a person FCU number
Last Updated person LCU number
First creation time FCD date
Last Update time LCD date
Delete Tag Detele_tag char (1) 1
The
, if you try not to change the table structure, change the way the program writes the database:
Background administrator to send a station letter, receive objects for all members, the system to the station letter table inserted in a station letter, which sent the way to distinguish between the objects received (0 for all sent, 1 for the only sent to registered members, 2 is sent only to the enterprise members, 3 for the designated member to send, so that the letter sent to all members of the station within the temporary only generated a data.
When the foreground member lands, according to the member's own member type (ordinary member, Enterprise Member) inquiry station in the letter table of their own latest news (according to the latest time of the message that they hold the message table with the time to do), into the message container itself and the message associated with the data, the default is not unread , when the receptionist clicks on an unread station letter, the status of the corresponding station letter in the container is changed to read.
If the backend administrator only specifies the sending station letter to a few members, the letter to the station inside a station letter, the members and the station within the letter of the link directly to the message container to write the association, do not need to take the front desk members.
Another: Because you changed the way you send and receive, background administrator only designated within the sending station letter to a few members, but the station letter status has not been sent, but to save the draft, you need to add a field to the station inside the main table, save a designated member ID string, used to associate this draft with a designated member of the Association, The number required to send to a designated member is not too large to be limited here.
In this way, the millions user system, active 10% User login system, only generate 10W of data, user activity is lower, the efficiency of this scheme is more obvious, if it is 100% active degree, this scheme and existing methods no difference.