[Some experiences and lessons of. Net System Architecture Transformation] technical points

Source: Internet
Author: User

[Some experiences and lessons on. NET System Architecture Transformation] several technical points of csdn transformation are as follows:

  • 1. The data layer abandons the SQL Server database and stored procedures and migrates all data to the MySQL database on the Linux platform;
  • 2. the cache no longer depends on the cache mechanism provided by. Net itself, and is migrated to the distributed redis deployed on the Linux platform;
  • 3. Call between services. Avoid using the. NET proprietary protocol and change it to a restful HTTP web API call;
  • 4. Static resource requests are not processed by IIS itself, but are separated from nginx on Linux;
  • 5. Change the file system to be read to the Distributed File System on Linux;
  • 6. Place the. Net code Windows Server behind LVS and use LVS for load balancing and failover.
Should the database adopt sqlserver or MySQL?

Web as a web application is never a bottleneck, and the bottleneck is always on the data end. According to the normal logic,. Net runs faster than PhP because. NET is compiled and PHP is interpreted. However, many large websites are currently deployed under PHP. There are many existing PHP solutions.
If a system encounters a problem, it is never a language problem, but an architecture problem, or an architect's problem. As a web service, most of the bottlenecks are on the database. When talking about the expensive SQL Server database authorization, you can go to qinfo to get a public comment. They use Asp.net and MySQL databases. In essence, both SQL Server and MySQL are structured databases, which is not very different for developers. The scalability of databases is roughly 1) database read/write splitting 2) Business horizontal partitioning 3) large table vertical partitioning. The other is the implementation in detail.

Whether the cache uses its own cache or distributed cache

Csdn migrates the cache to redis. I personally think this is not. net's own cache mechanism problems, if the distributed cache, whether using memcache or redis, is separated between machines, certainly no web server cache is fast, if the business volume is small, it is not cost-effective to use a cache server to replace the Web cache mechanism. When the system traffic reaches a certain level, its own cache mechanism cannot meet the requirements of the system, and it must be switched to the cache server. Of course, I think no one will use Windows server as the cache server. Whether it is. net, Java, or PHP. Is there any performance difference when using memchace/redis. The first version of csdn should be the blog system, which is used by both the blog system of the blog Park. However, it is no longer the original version. However, it is hard to think about how the. NET cache was supported by the large number of users of csdn blogs. After reading the blog on yunlu, we can see that the blog is using the memcached cache.

In my understanding, as a cache, when users are small, they can use the Web cache mechanism. When the cache reaches a certain level, when its caching mechanism cannot meet the needs of a large amount of data cache, it needs to switch to the distributed cache component. The principle is to bring data closer to users. Currently, many Internet services use memcached or the key-value database of the class to store all data in the cache, while MySQL and other structured databases are only used as Database backups, data is read from the database only when the cache is invalid.

System Protocol Selection

Microsoft is very fond of adding some of its own things to some protocols, and only has its own set of solutions available. It is indeed very convenient to choose a full set of Microsoft products, however, when we need something other than Microsoft, we will be able to do it. Web services are mainly HTTP Services With WebService or WCF. WebService is a set of open standards and XML-format protocols.

Web Service is a new technology that enables different applications running on different machines to exchange data or integrate with each other without additional, specialized third-party software or hardware. Applications implemented according to Web service specifications can exchange data with each other regardless of the language, platform, or internal protocol they use. A Web Service is a self-describing and self-contained available network module that can perform specific business functions. Web services are also easy to deploy because they are based on some common industrial standards and some existing technologies, such as XML and HTTP. Web service reduces the cost of application interfaces. Web Service provides a general mechanism for the integration of business processes across an enterprise or even multiple organizations.

In web transmission, JSON is shorter than XML format, and can be supported by JS native formats. In addition, there are many third-party support formats. JSON is better than XML as a carrier. Restful is a data access style for me. Make URL requests clearer. Instead of protocol. Therefore, in the web system, I prefer to use restful APIs and JSON as the carrier. If the full set of products are Microsoft products, I think that the best choice is for Microsoft WCF.

File System Selection

Put file servers in Linux is better than weindows. At least Linux does not need to process all kinds of file fragments. Well, I have never played with file services.

 

Are static resource requests sent from IIS or separately?

We know that IIS can only process static files. If a dynamic file such as the. aspx file is accessed, IIS will hand over the aspnet_isapi to process the request and then return the result to IIS. As a static file, nginx is superior to IIS. When processing static files, we usually merge and compress JS and CSS files and open one or more independent second-level domain names as image servers. Reduce the waiting process of the front-end. Or hand over the image service to youpai and qiniu for processing. Some time ago I studied and shot it again, and provided interfaces for rest and form APIs, so that I could easily integrate it. CDN acceleration is cheaper than static file servers.

 

Load Balancing...

When the Web server is not enough, You need to deploy a Server Load balancer for the Web server. Of course, there are many ways to deploy the Server Load balancer. I have never deployed such a service. It is hard to say that when a single web server cannot meet service requirements, load balancing must be achieved.

Summary

Therefore, except for the second point in the above six points, I think that the author does not have enough understanding of the system, and others are supported. A problem occurs in the system. It is not a language problem, but an architecture problem. Of course, this is just a personal idea. Maybe all I know is wrong.

 

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.