Explore technology, the pursuit of the source, I am the summer of the city.

 

In this installment, we’ll look at what technologies and capabilities we need to master in order to become a Java architect and navigate the architecture and landing of the large Internet.

 

Our overall architecture is a separate architecture, so we’ll start with user access together.

 

First of all, initially the user will go through our browser or mobile phone or whatever, and then access our specific content, which is a piece of front-end content. User requests go through the front end to our back end, so for a request like that, it goes to our load balancer, which is Nginx.

 

Usually we have multiple Nginx, so why do we have multiple Nginx? This is mainly because Nginx is also a server, and it can go down and hang up. So we make a reserve by LVS +KeepAliveTime, so that one of our Nginx will not go down, even if it does have a spare machine to replace it.

 

Then the load balancer will process our request and send it to our back end, so in our back end, our back end is no longer a single unit, it is composed of many services. Examples are user service clusters, goods service clusters, and order service clusters.

 

Each service is a separate system and a separate service. The service will provide some corresponding interfaces to the external. Of course, our services and services can also communicate with each other.

 

So for our microservices, it’s a system in itself. Then a system would correspond to a corresponding database. So it will have a user database, a commodity database, and an order database. Each of them, in our user request volume is very large, each of their own library can do a read and write separation, master from the separation.

 

Between one of our application layers and our data layer, they have a cache that we usually build through Redis. This is mainly because we users request, in fact, when some data access, we can completely from our Redis, from our cache to get. Because this data is in our database, it hardly moves. So we tend to put the data in the cache and let our users read it. This will also relieve some of the burden on our database.

 

 

Between our services and services, we can actually communicate with each other. In addition, our services can also call some of our corresponding public resources. Public service resources, including some push, SMS and email, can be used as some public services, or when we go to connect to some third-party logistics, etc., these can be used as some of our corresponding public service resources. When it comes to getting rid of it, we usually do it through middleware, like RabbitMQ. A corresponding decoupling can be achieved through some MQ mechanisms, message queues, that is, producer and consumer patterns, and the invocation between them is an asynchronous invocation.

 

Of course, in our current system, it is itself a large distributed system. What we have to pay attention to in a distributed system. Such as a distributed lock, to ensure that our data is unified, like our commodity data can not be super beautiful. In other words, we control the uniqueness and consistency of our data through the mechanism of locking. And in our user session, actually, if we’re using singlers, we’ll have a session, which is itself a stateful session. When we’re in clustered and distributed systems, our user sessions, it’s stateless, so in our distributed environment, we have to adopt a distributed session technique to implement one of our user sessions.

 

Since our sessions exist throughout the distributed system, we will implement single sign-on. Single sign-on (SSO) ensures that when we log in at one end, all other systems will assume that we are already logged in.

 

For our data consistency, there is also a flow limiting at high concurrency, and distributed logging. We will be through the corresponding knowledge means to achieve. In addition, in distributed systems, idempotentiality is something that we have to think about.

 

In our entire service cluster, each service will involve some corresponding files. For example, in our user service, it may involve the uploading of some users’ avatar, and in our product service, it may involve the uploading of some product pictures, all of which are related to files. So we’ll have a distributed file system that can be built with FastDFS. For such a distributed file system, it can provide a very good service mechanism for our entire system. All of our files can be stored in a system like ours, and our FastDFS itself can be built into a cluster.

 

Distributed search engines typically use ElasticSearch, or ES. ES is a search engine, also because some of our users’ search requests are diverse. In the database query, fuzzy query is not in line with the user’s retrieval needs. Therefore, we will use ES to achieve a user retrieval, and it is a massive data retrieval, not only to retrieve the data, but also equivalent to our database to share some search query pressure.

 

In addition, Kafka log collection. In fact, in our entire system, whether it is Alibaba or JD, when one of our servers reaches hundreds or even thousands of units. In fact, each of our servers, every system it will have a log generation, this time we how to manage our log? We should collect logs, monitor them, and troubleshoot them. So this is a very big challenge for us to operate. In the old days, in traditional development, when we wanted to check for errors, we would just open up our server and see what errors were reported in our Tomcat. This was in a single unit situation. Once we had an infinitely large system and many servers, Then we would have to monitor one of our logs through log collection. In this way, all nodes in the distributed system can be monitored in one log.

 

Before we deploy large sites, we will involve a Docker containerization. So in fact, in the early stage, if we have fewer nodes, we need a lot of middleware, so that some services can be configured and installed separately when we deploy and go online. Containerization is also a very popular method nowadays. Our microservices and some of our middleware can also be deployed and installed through Docker, and there is no problem.

 

 

To be an architect is not only to have the corresponding technology stack, but also to have certain other capabilities.

 

  • First, we need comprehensive and broad technology. As architects, we need to learn more about some of the techniques and use the ones that are more appropriate for the business. When the product manager designs a module, we should think about how to use the appropriate technical solution to solve the problem, to implement the problem.

 

  • Secondly, we should pay attention to cutting-edge technologies. This is mainly to keep ourselves hungry. We should pay attention to cutting-edge technologies and understand the trends of cutting-edge technologies. For example, spend 1-2 hours a day to read some technical documents in English, or some basic information in English.

 

  • The third point is to anticipate the overall situation. In the development process of our work, each business is a small point. When these small points are put into the whole, it may seem insignificant. But we also need to control each business point in the overall situation, just like the military in the sand table to guide the strategy. We have to anticipate, anticipate a lot of plans in advance.

 

  • Fourth, keep the team busy without chaos. As architects, we should not only have technical responsibilities, but also be able to manage and manage people. We should be able to arrange troops in a large number without chaos, and be able to guide operations.

 

  • Fifth, system decomposition and module splitting, splitting and decoupling is one of the most basic and common patterns. A good separation of business, then you can better decouple the code. This can also be reflected in the microservices phase.

 

  • Sixth, guidance and training. While guiding development, we also need to train and cultivate some new people to maintain the consistency of the overall comprehensive level of our team. In this way, you can better lead the team to do something.

 

  • Seventh, communication and coordination, the architect is not only a technical person, but also a manager, is an organizer. You need to communicate with your boss, and you need to communicate with your subordinates. Qualified architects make better decisions by taking into account the ideas of their superiors and superiors.

 

  • Eighth, abstract, example and drawing, we need to make technology highly abstract. Because in the ordinary work process, will certainly communicate with the boss, talk about some things. As a boss, certainly do not understand technology, so at this time we need to explain to the leader, we need to abstract, more examples, more drawings. Explain some techniques to the leader in a more concise form, so that the leader can better understand your intention. Of course, we also need to pay attention to our own thoughts to our subordinates, at the same time, we should also let our subordinates to understand, to appreciate our ideas and intentions.

 

  • And finally, soft skills, soft skills are actually a little bit more project management oriented. First of all, let’s talk about our subordinates. In fact, as an architect, you want your subordinates to understand you and trust you. This, after we had a class at ordinary times or in his spare time, we can go to better organize some activities, such as dinner, KTV, go to climb mountains, these are for our later work well a better matting, when our team cohesion is high, your subordinates would be better to support your work, it is very necessary. Secondly, for our superiors, that is, some leaders and bosses, in fact, you should go to the right time, to the appropriate to say some good things. Some programmers may say that when you do a good job of your own, and your technology is very good, you do not need to do something like flattery, in fact, is wrong. As long as we in the workplace, whether you are a programmer or not, flattery is indispensable. If you speak well of your leader, your leader will support you in certain situations, because in the company, there may be more than one architect, and there will be conflicts and some competition among architects. So it’s best if your boss is willing to help you. And then there’s the ability to negotiate, which is also a soft skill. Therefore, in our daily work, whether we are dealing with subordinates, leaders or some of our third-party competitors, our negotiation ability is reflected, mainly in our communication. If your subordinate is leaving, at this time you need to negotiate with your subordinate, to communicate, you want to keep him, this is actually a negotiation. If you’re dealing with your leader, let’s say your job, you need your leader’s support, you need to negotiate. If you’re asking for a raise for the team, you should also negotiate with your manager. In this process, your communication skills are essential. Secondly, when meeting some third-party companies and competitors, it is inevitable to negotiate. In addition, in the process of our daily work, in fact, we met the most opponents are product personnel, product personnel will put forward a lot of requirements and functions to us developers. Of course, some of the requirements are actually unreasonable, so at this point, if you are a very strong negotiator, you can control some of the corresponding business boundaries.

Pay attention to avoid getting lost

The article continues to be updated. You can search the WAY of IT background on wechat, and get more interview resources, learning videos, etc. Interested partners are welcome to follow

If you find this article useful to you, thank you for a “like” on this article, thank you very much!!