End of 2016 Summary

  summary

Order

About half of the time in 2016 will be in Shenzhen and half in Guangzhou. In 2015, about half of the time will be in Beijing and half in Shenzhen. It is also a symmetrical thing. After going around for a while, now I am back in Shenzhen, and I feel that I have returned to the starting point. It looks good, but many have lost continuity and are not very good.

Review

The key word of this year is job-hopping, and the dividing line is probably in the middle of the year, adhering to the idea that the Internet will change various industries, to non-internet companies.

First half

Let’s talk about this company in the first half of the year. In fact, it was mentioned in the summary of last year. In fact, last year I didn’t want to stay any longer. However, I didn’t want to change jobs frequently. I had a hard time staying through the New Year. Therefore, it is quite natural to change jobs. However, there aren’t too many companies to choose from here in Shenzhen, at least not as many as in Beijing. The main reason is that there aren’t many companies with engineer culture. Goose factory has a profound product culture and is not very friendly to engineers. I am too lazy to say anything about it. Others have expressed my heartfelt wishes:Tencent’s Feeling in One Year. Originally, I still held a more cautious attitude and didn’t have any words to say it out. I was afraid that it would be biased. However, I was relieved to see that my fellow countrymen also held the same view. Of course, senior officials are also aware that last year’s Christmas party stressed the need to guard against technology companies such as today’s headlines, which may subvert Tencent News in the future. This year, more emphasis has also been placed on technology.The boss said that this was Tencent’s largest shareholder meeting in history.“For the first time, Tencent is proposed to become a leading Internet technology company in the future”. Maybe it will change gradually, hoping to be better and better for engineers, such as 27-inch monitor +macbook.

second half

At the end of the first half of the year, I arrived at a non-internet company, but there was still some engineer culture, mac air+25-inch monitor+git. To be honest, I don’t like companies that don’t use mac or git very much. All the technological growth this year is here. There is no doubt that this is the advantage of job-hopping. Many new technologies, without atmosphere and actual combat scenes, are hard to be achieved by themselves. It mainly experienced the transformation from traditional SOA to micro-service, and also experienced it together because it had not experienced the separation of front and back ends before. Micro-service +docker+k8s, very strong flavor of devops. Of course, there are also some bumps and bumps, but the new technology is to try. In addition, from the former pure back-end to the whole project, basically, apart from the front-end development, other responsibilities are more or less involved, which is a broadening of vision and a little odd job. Let’s talk about them one by one.

1. Separation of front and rear ends

After the front and back ends are separated, the back end becomes simpler, basically providing a simple api, and the logic of the front end will be heavier, which requires higher capability of front-end engineers. In fact, logic moves to the front end. The advantage of java engineering is that the front end is naturally asynchronous and can request back-end api with finer granularity. This service is lighter and greatly reduces the problem of back-end service, which causes the whole page not to come out. Moreover, the front end is naturally asynchronous and can request concurrently, which can handle individual service failures well.

The second point after the separation of the front and back ends is to deal with the cross-domain problem. The front end has two kinds of ways to deal with this problem. One is to use nodejs. The front end itself can proxy the back end service, but this also increases the capability requirements for the front end engineers. However, the front-end technology has recently been updated too fast.What is the experience of being the front end in 2016. Originally, I wanted to learn from the front end a little, but later I was confused after a bit of trouble. Part of the front end is becoming more and more like the back end. There are too many new technologies and the feeling is somewhat complicated. Another way to deal with cross-domain is to use nginx forwarding. When the front-end project is developed locally, use node’s httpproxy and configure an address forwarding of nginx. In this way, all back-end interfaces are maintained by the back-end, and the front-end only needs to base on the request of relative path. Originally, I took a detour and let the front-end build nginx locally to forward it. The results showed that the front-end really knew nothing about nginx. In addition, I exposed the forwarding configuration of api to the front-end, which was not too friendly. Moreover, the development environment of the front-end was not too unified. Some used windows and some used mac, so various configurations were somewhat troublesome. Although I tried to use docker during the period. However, it also increased the requirements for front-end personnel, and finally returned to the front-end local development to use nodejs’s local agent for local development only, and the production environment was nginx.

When it comes to nginx, I’ve had a lot of contacts this year. I used to only do java backend, which didn’t involve so much. Now I’ve got to open up my eyes to nginx. Before, the company still used tengine of Taobao, but after a few years, openresty’s general trend rose. As a result, the nginx+lua development mode has been opened. For those who are used to java, I feel very relaxed about nginx’s second-level restart. At first, I was not too used to lua scripts. On the one hand, there was no ide to prompt and debug. On the other hand, I was not too familiar with lua and some of them were rejected. However, I gradually fell in love with it. It was mainly a second restart, which was very fast. In addition, nginx is used as api-gateway, which is quite mature. Unlike zuul of spring cloud, there are still many pits (for example, some previous versions do not support colons in url). In addition, java starts slowly, takes up a lot of memory, and some are not at ease. Therefore, the whole body still likes openresty very much. I hope to continue to advance next year, hoping to master it skillfully. Compared with zuul, the only bad thing about nginx is that it can’t automatically discover the service. however, this mainly depends on how you use it. there are also those that dynamically configure nginx through etcd. of course, we didn’t make it so complicated. the whole thing was thrown to k8s, which forwards it to the externalIP exposed by the service, and k8s handles the expansion and contraction of the service.

2. Microservice Architecture

Before, it was still soa (single architecture). I didn’t expect microservices to be so popular this year. I felt that if I hadn’t changed jobs, I wouldn’t have come into contact with microservices so quickly. Therefore, this is also a benefit of job-hopping. The relationship between microservices and SOA is different in level and is not very good to compare. However, it is generally believed that SOA is partial to architecture level, and microservices is a specific method of SOA, just like XP/SCRUM to agile development.
Simply list the benefits of microservices:

  1. The amount of code will not be huge, it is easy to maintain, and whether it can be rewritten in 2 weeks is the measurement target.

  2. According to the characteristics of the service, the most suitable technology can be selected for implementation, and new technologies can be boldly tried.

  3. Simplify deployment, can quickly iterate release, upgrade, rollback, the impact limit is relatively small. For a large single structure, one small change will result in release, which is too expensive to release frequently. Multiple changes will be upgraded together, resulting in high risks.

  4. The service structure can be adapted according to the size and organizational structure of the team members to ensure that the team members can hold micro services of the corresponding size.

  5. Microservices are easy to aggregate and reuse.

  6. From the aspect of personnel training, more people can be given the opportunity to be responsible for a single service, and when these people get enough exercise on a single service, they can be given more responsibilities, thus helping them gradually achieve their professional goals, and at the same time, by sharing responsibilities, they can prevent a person’s burden from being too heavy.

The main thing is to simplify the complex, de-center, deconstruct, and micro-service the previous single structure and heavyweight services. After the coupling between the services is less, the services can be freely updated. There is no need to worry about which old functions will be affected after the system is upgraded. It is necessary to return carefully. The service is more cohesive and the scope of influence is controllable. Of course, not all services can do this, such as some public infrastructure services, such as login services.

We mainly use spring cloud’s whole family barrel for micro-service. Thanks to netflix oss’s technology stack, small and medium-sized companies can use spring cloud without having to build a wheel for themselves. Of course, this is also due to the rise of springboot. Considering that in the company before, we had to study how to deal with different configuration files in different environments, and then how to encrypt the database password in the configuration files, springboot’s profile can easily solve the environment configuration problem. The encrpt function of configer server of spring cloud can easily solve the encryption problem. all of a sudden, you will find that the things you studied hard before were easily surpassed in front of the big wave. Many things in spring are relatively easy to use, such as spring session, which can easily solve the problem of distributed session. It is ok to simply add a few dependencies and comments. There are also spring data series and similar repository, which shield the details of the underlying database through the agreed findByXXX and so on. Of course, there are some holes in it, such as mongo’s findOne. One will be taken automatically, and jpa’s findOne will report errors if there are many, but it is still quite good on the whole. For example, the paging function is very easy to use. The common method is to switch from pg to oracle, and change the driver to ok. There is no need to deal with oracle’s troublesome paging method at all. In addition, regarding the fusing between services, hystrix provides good support, is very easy to use, and greatly improves the high availability of services.

Spring Boot foundation

Spring Cloud series

I can’t help but say a few words about Spring Cloud series, that is, eureka’s design is AP, emphasizing high availability. However, this depends on the scene, and some may like CP’s design, so eureka is not so suitable. One of the things I especially want to complain about in the process of using is that eureka, which has to wait for a period of time to do service discovery through eureka, is a bit laborious. In addition, if it is used together with k8s, then some functions of Spring Cloud family bucket will overlap with k8s, such as service route discovery. Therefore, relatively speaking, if there is no cross call between back-end services, it may not be appropriate to use Spring Cloud’s ribbon and eureka. Of course, hystrix is still very useful, but there is also misjudgment.

SpringBoot application series articles

Srping Data JPA series

Spring Data Mongo series

Spring Data Redis series

Spring Data Elasticsearch series

Spring Boot configuration property series

3. Docking everything

Docker is also one of the major gains this year, especially most of the services produced are run on docker, including pg, redis, kafka, etc. It feels very cool. Docker is here to simplify development and devops.

Docker foundation series

Docking series of basic components

How do you say, after using docker, individuals can study many clusters of things, which is incomparable to the previous use of visualbox or vmware, is very convenient, new technology is good.

Of course, after using docker, we still need a driver. We use k8s, G’s stuff.

Although I wrote several articles on how to install it on the mac, they all proved that it could not be started normally, so they went away. It seems that if you want to do it on the mac, you have to follow vargant’s way honestly.

Inventory and Prospect

In general, this year is mainly to extend the technical vision, keep up with the new technologies of docker, k8s, spring boot and cloud, and add an openresty. If the technology is deep, it is not enough. We need to focus on it next year.

Last year’s wish was realized, that is, “the reputation of sg has broken 1000”, and the rest still needs to be worked on. Looking ahead to next year:

  • In-depth system design, this is the secret weapon to resist the rapid change of technology.

  • Lay a solid foundation, such as computer networks, algorithms, etc.

  • Go deep into some common things: Spring Cloud, Redis, Mongo, PG

What about specific indicators?

  • Continue daily sg blog, continue to enhance sg reputation

  • Answer stackoverflow’s Questions More

  • Technical restart every weekend

  • I still need to continue running in summer, hoping to learn to swim.

  • Less overtime, more promotion time and project management ability

Well, let’s just leave it at that. The cafe has been writing all afternoon and is ready for dinner.

doc