By dint of force, a pair of heavy--abandon the programmer's innate conceit

Source: Internet
Author: User
Tags failover

Working for a few years, and a few companies, has been thinking about a problem recently: how to borrow force, a pair of heavy. Programmers, there is always a conceit: always feel that the system is better than others, write their own code than people elegant, and then re-implement a similar system, write similar code, encountered a type of problem, and even more than others stepped on a few big pits, only to realize why others have to do so. System design, software implementation, in fact, is a trade-off, compromise process.

All kinds of design, various implementations have the balance of the realization of the consideration, a responsible, thoughtful designers will have their own design, realize the original intention, trade-offs. We should not prejudge. This kind of programmer's conceit is not an abomination.

This with the use of force, one or two of the capacity of the thinking seems to have no half-dime relationship, in fact, this is related. If you do not abandon the mentality of conceit, is unable to borrow force, one or two to dial the heavy. But how can a programmer use force to make a couple of a ton of hard work? Here, I'll talk about my work sentiment.

I, 20,008 years to 2012 in the domestic a well-known storage software company engaged in storage software development design. In these four years, I found a habit of the company, such as our department to engage in a project of software development, old colleagues, always ask other team colleagues, whether there is reusable code, whether there is a reusable system design, and then from other departments can be reused code, system design, or from other departments to design experience: such as the design of similar systems will step on which pits, and then in the early system design to consider the solution.

This reuse strategy, the reference is only some small, from the bigger is this company advocated the normalization design. What is a normalized design? Because is engaged in the storage system design, the storage divides into the blade, the array, the server. Different types of storage, in fact, can use the domain model to think, in addition to CPU, memory, hard disk parameters, the others are the same. such as drives, interfaces, slots. Therefore, the idea of normalization design is to use this feature, for blades, arrays, servers, respectively, designed different platforms, various types of platforms, loaded with different CPUs, memory, hard disk, the same product line for high, medium and low-end storage devices. This normalized design in addition to cost-saving, fast shipping, and from the user's point of view: to provide users with a unified user interface, the use of manuals, reduce the user's successor new equipment learning, use costs.

A design, in the mobile phone industry more famous examples, I think is MTK (MediaTek), K910 (Huawei HiSilicon). The core concept of the design is that the software, technology mature stage of the modular, component, platform system design, more advanced is the design of the program.

However, I left the company at the end of 12, to the domestic famous Internet company, into the company's e department. In e department, I learned this department xxplatform, this is based on the RPC mechanism of rapid application service development platform, using this platform can quickly develop service-based (SOA) applications, and have a unified configuration center for distribution, application deployment, it is quite convenient to use, But to form such a platform is going to cost some, and there are some problems that are not resolved: disaster recovery, failover. Later, I also found a phenomenon from the internal channel: different departments always like to engage in a similar platform, O Department, S Department, W Department, I departments have their own similar platform, later, I went to the C department, found that the C department is also to achieve a similar platform, and special rotten: There is no unified public library, various pits, disaster tolerance, Automatic fault switching also planned, performance with machines piled up, recently in a project, almost all of them are working overtime. In fact, it is well known that the company S department can simultaneously handle 200 million plus users online, disaster tolerance, failover is the most mature, and also has more than 10 years of history, according to the truth should become a normalization of the company, different departments on the use of the program to promote business quickly, the result is the opposite, different departments always repeat the wheel, Then step on the pit, pits, the so-called technical challenges.

In fact, the personal feeling, everyone's ability is almost, others engaged so long, the formation of the program, platform can use, take to use, quickly launched business is the king, and then challenge, will not exceed the number of predecessors. Unless you have updated, groundbreaking original capabilities, but in China's software development environment, I don't think that's the case yet.

For example, the distributed design of the CAP features, consistency (C), availability (A), Partition fault tolerance (reliability) P, these three in a distributed system, is not fully satisfied. So is there a department for designing a reusable distributed system, do you use it, or do you challenge it again and get one?

Personally think, can reuse, on the reuse, the rapid promotion of business is the hard truth, unless the department design system is really rotten, otherwise the programmer why embarrass themselves? Let's take a look at the overall view of the distributed system:

All of the distributed systems, whose complete view should be similar, need to address several of the following issues, as well as the current common solutions:

1: The domain name to the IP address of the resolution, this is through the DNS server to resolve.

2: Internal system to the external isolation, to solve the security risks. The common practice is to implement some application gateways through gateway type mode, exposing to the public network, thus isolating the internal core system and data.

3: Data disaster tolerance, especially the cross-region disaster tolerance, to achieve data security, reliability, to resolve unexpected events caused by service unavailability, unrecoverable problems.

4: Load balancing between the same types of services, using the client front-end invoke intelligent selection, LVS, load Balancer Coordinator. Different systems are based on the system features chosen, when using LVS is already an example.

5: Application, switch availability, the common practice is of course redundant hot spares: Standby or activity. In standby mode, you need to discover master availability, a common practice is a heartbeat, and then update the configuration through the configuration center to alert the front-end call to change the access IP and port.

6: Service access mode: The original socket call, now the mature practice is to use RPC, and then implement platform, framework to quickly promote business development. Open-source RPC has zero-C ice, and the Ace's DAO (? TAO).

Network communication from the client to the server access mode, and the server-side mode can be modular, platform-based.

7: To solve the problem of database access performance, the use of sub-database sub-table, really does not, using similar memcached with speed-up access, and the adoption of such a solution data consistency solution.

From the entire view, from the top down, we can see out of the specific business, different business from the security, performance, reliability, disaster tolerance and other problems are consistent, no difference, basically can be modular, platform, programmatic, for other groups, the Department of Force, a pair of heavy, fast business promotion.

But a small company that just started is not going to be able to do a chatty system that would kill a small company. However, a little bit of a small company in any case to component is the data: DB, File system. Data security, reliability is the bottom line that cannot be broken. Early component, platform-based data for the subsequent business security, reliability brings a fundamental, strong guarantee.


By dint of force, a pair of heavy--abandon the programmer's innate conceit

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.