asp.net application Millions optimization Method-Database optimization (1/3)

Source: Internet
Author: User

ASP.net website Optimization Tutorial Series database Tutorial Optimization measures use master-slave library (full)
To the detailed page of the Watercress book for the hypothetical scene, you can click here to see the structure of the page (I am not the technology of watercress, here just take this page for example)
We analyze the data needed to render this page and the actual requirements of the data
1 The detailed information of the book timeliness requirements: Timely request
2) Watercress members of the commonly used label effectiveness: Do not need to be very timely
3 like to read this book people also like to read the book belongs to analysis data, do not need to be very timely
4 The latest book review request timely
5 Read this book a few users of timeliness is not high
6 The people who like this book often go to the group belongs to analyze the data does not need to be very timely
From the above analysis can be seen only 1, 4) two data need to read from the main library, while 2), 3, 5, 6) for the non-timely data from the library read it. Of course, we can cache these data with low efficiency.

2. Forum posts list page for the hypothetical scene, play the Forum people like top stickers, put your posts on the first page to make more people concerned, and for 50 of pages after the post is very few people read back, we can based on this business logic characteristics to determine the first 50 pages of post list data to read from the main library, When a user accesses more than 50 pages of data, the query is made from the library.

3. Take orders for example, usually more than three months of orders will not be changed, assuming that we design the order number in date format, according to the order number to query orders can be based on the order number to determine whether the access to the main library or from the library.

With a few suitable scenarios, let's take the third scenario as an example and write a simple schematic code to see


Copy code code as follows:
The orderNo format is 20100528120105000001 YYYYMMDDHHMMSS + serial number
Public OrderInfo GetOrder (string orderNo) {
String connstring = Connstringgetter.getfororder (orderNo);
using (SqlConnection conn = new SqlConnection (connstring))
{
...
}
}

Home 1 2 3 last
Related Article

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: info-contact@alibabacloud.com 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.