Author: Jia Tang, background development engineer of Tencent IEG

1. Scope of background development

To put it simply, background development involves four aspects: network, data, business logic, operation and maintenance. If the extension and extension, can be divided into the following categories:

(1) Network – distributed system – parallel computing

(2) Business logic -WEB- game – transaction – search

(3) Data-cache-db-keyValue – File storage service

(4) O&M – Load Balancing – Fault tolerance – Disaster Recovery – O&M tool

Different types of businesses have different requirements for the above four points. A brief summary of some of the highlights of the company’s existing servers:

It should be said that every successful business server has various characteristics. A smart programmer or designer can choose appropriate architecture, manpower and resources according to different business characteristics and invest in the most core and critical function points or modules of his business.

2. Characteristics of background development

A. Background development is relatively stable

We know that in the area of user interface and presentation, change is very fast. Users always like fresh, better performance. There is also a lot of competition from companies trying to tie users to their platforms. Various third-party components and engines emerge in an endless stream.

Microsoft, for example, is constantly releasing apis and development languages. When Apple took off, it catapult an obscure Objective-C to number 3 on the charts.

Because the background development basically does not involve the presentation layer, mainly deals with the network, data and messages. It is less affected by “fashion” and “fashion”. Whether it is Windows, MAC, IOS, Android, the impact on the background architecture is not big. The development language is also relatively stable, the mainstream is C/C++.

B. Stability is the primary guarantee

Background service program is online service for many people at the same time, so its reliability requirements are particularly high. In contrast to a client application, if a process or machine fails, the client only affects a user’s experience.

In the case of a server, it could be thousands of people’s experiences, or even the entire service if unfortunately a critical node fails. There are too many examples of games failing because of servers.

As a programmer, you tend to be performance obsessed and always want to support as many people as possible with as few servers as possible. This is not to say that performance is not important, but to distinguish according to the situation.

For example, an anti-war game server, regardless of performance, can support only 200-300 people on a C1 server, or even less than 100 people on a complex PVE mode, and the cost of the server alone can drag the project down.

For The Royal Dragon, one of its key selling points compared to its competitors will be completely lost if it does not address the pressure of system broadcast when thousands of people are on the same screen. For some problems that are not expected to be stressful or that can be solved simply by scaling up, you should not worry about server performance in the early stages. You should focus on stability and scalability and solve performance problems when necessary.

For performance issues that relate to the fundamentals of the system and the core experience, it takes first priority. Of course, there may be a service that grows from humble to important as users like it or the business grows. At this point, its performance and stability become very important.

One of the more famous phrases in the company’s massive data series, “Resist first, optimize later,” has a similar meaning. Make sure the system is stable and usable first, otherwise, the initial users will already be lost, and there will be no opportunity for optimization later.

Of course, if we consider the stability of the critical path of the system fully at the beginning of the design; As the business evolves, optimization will be orderly and manageable.

C. Impact of emergencies

The server also faces the problem of an avalanche of user visits during certain activities at certain times. From a few years ago, SMS New Year, to double 12 promotion, 12306 grab tickets, the Spring Festival wechat red envelope and other activities. The peak of visits in a short period of time is 100 times or even thousands of times higher than normal.

Once the number of concurrences increases, errors, miscalculations, and limit cases that are implicit in the system will all pop up. I’ve even had an important server go down in the middle of a rush.

An important part of a server’s performance is being able to provide normal service during peak periods. So much of our work is geared toward those few hours of “peak time.”

3. Background development needs long-term accumulation

The technical point that the computer theory education of the school and actual operation need to apply is met some discrepancy. Therefore, many people after graduation to work units at the beginning of the work is “make up lessons”.

Such as C/C++ development and debugging, script voice learning, Linux operating system familiar, simple DB operation and analysis, supplement hardware related knowledge. The focus of the work is mainly data statistics, operation and maintenance script writing, small functions and small requirements development. If everything goes well, we can basically undertake the development of an independent module. Two years have passed.

About a year of independent module development, experienced basic architecture design, and planning bargaining, online instability, user access to sudden growth, server downtime, configuration file errors, and so on, finally have a deep understanding of online system development.

At this point, you can probably upgrade to the company’s T8-T9. After at least 3 years of effort, backend development is ready to get started. In the later stage, it is necessary to accumulate gradually through time and projects.

The accumulated experience of the server, including ideas, architecture, and code design, can only be proven through practical verification. There are always surprises online. Often well-thought out plans fall through; And users are always in unexpected places.

As the saying goes, you’ve never eaten pork, you’ve always seen a pig run. But the backstage accumulation requires us to eat the pork, not just watch the pig run.

Opportunity is another important factor. If the PCU is stuck at 10,200,000, there will never be a 100W online experience. In the process of the gradual increase of the number of users, there will be a variety of problems, and the process of solving problems one by one is the process of gradual accumulation and sublimation of experience. Of course, the business can develop to what extent, this depends on everyone’s choice and luck.

4. Do not neglect operation and maintenance

Generally speaking, as a background programmer in the early days tend to be more concerned about the network, business logic and data. Operation and maintenance. Anyway, they take care of the network, machine and configuration.

If you think this way, expect to be interrupted by phone calls at 2 or 3 in the morning. When I was with my family, I was called back to work overtime. Program mismatch, all kinds of blame; When it comes to performance reviews, unstable procedures, poor year-end bonuses…

When writing code, have you ever considered the following questions:

Is the service I wrote working properly? How do you know it’s normal?

If the running server goes down, how can the service continue?

If the network is down, is there a backup link?

What if I fill in the configuration sheet incorrectly?

There are too many machines, and I accidentally mismatched the corresponding relationship.

The operation and maintenance students matched the server of Telecom into the IP of China Unicom, and the complaint card of external players.

Except for the IP configuration problem, other problems, operation and maintenance students can not help you solve. A lot of things have their own consideration and solution. Clearly, there is no savior, and responsibility for system stability rests primarily with the project development team.

5. Initiative is the only magic bullet

The front bits and pieces of so much, in fact, the final fall on a point: active.

The program function is complete, only 20 percent of the work of background development. Background students should also take the initiative to care about the actual operation of their own programs, whether there is abnormal log, whether there are bottlenecks and improper processing.

Pay close attention to the performance of your programs when hardware and network exceptions occur. Whether the proposed new features have any impact on existing applications, and whether some pre-refactoring is required; When you make a mistake, you should not only solve the problem, but also consider how to avoid making a similar mistake in the next time.

These dribs and drabs of accumulation, is not overnight, is not the leadership of your requirements. But need in the work of the process of continuous summary and improvement, and sometimes even a little “self-abuse” spirit.

That’s all for today, thank you!

** In addition to learning programming or working friends, if you want to better improve your programming ability or change careers, learn C language C++ programming! Overtake on the curve, one step faster! The author here may be able to help you ~

C language C++ programming learning exchange circle, **QQ group [464501141] ** wechat public number: C language programming learning base

Share (source code, project actual combat video, project notes, basic introduction tutorial)

Welcome to change careers and learn programming partners, use more information to learn and grow faster than their own thinking oh!