A, division of labor

1. Primitive society

When nature’s first hominids lived in nature (real wilderness), they lived in groups for survival, in caves for shelter from wild animals. Some primitive people run fast and bold to chase hunting, some people run slowly to open up the land, some primitive people like to invent and create stone tools, some primitive people ingenuity on the weaving of leaves clothes…

2. Social division of labor

Marx believed that the nature of the division of labor is the result of the continuous development of productive forces.

In his book Family, Private Ownership and the Origin of the State, Engels proposed three major divisions of labor in the late primitive society of the eastern continent: the separation of nomadic tribes from the rest of the savage people; The separation of handicraft and agriculture; The emergence of a merchant class.

3. Great division of technology

With the development of the Internet, the division of technology based on development language or platform is becoming more and more detailed, evolving into a variety of technology stack.

Front-end development: Html, Css, Js, React, Vue, etc

Mobile development: Android, iOS, React Native, Flutter, etc

Backend development: Java, C++, PHP, Go, Python, data collection, audio and video development, etc.

Second, the back end

I have done many years of iOS, this thought can be once and for all, or too simple to think.

It is true that you are never too old to learn. Refuse to set limits on yourself.

Last year, there was no big demand for iOS in the project, and I was curious about back-end development before, so I switched to back-end Java development for a year.

I participated in the whole process from the interface Crud (adding, deleting, modifying and checking) at the beginning, an interface development and a module development to the overall development, deployment, release, launch, tracking and iteration of a complete project.

Isn’t Java server development in the eyes of a mobile developer providing interfaces to clients?

You’re right! But more than that!

In addition to providing interfaces, there are other tasks

1. Service deployment (deploying Jar packages to different machines on test and online, that’s what o&M does)

Apply for machine, APPLY for LVS, apply for domain name (apply for configuration according to the company process)

Nginx load balancing deployment (like routing to different machines, configuring the Web startup page)

Service migration, database migration, database merge (that’s what DB does)

2. Data cleaning (sorting and merging thousands of Excel files in one year, isn’t that what big data engineers do?)

Database data import and export (import cleaned Excel or export Pm statistics)

3. Emergency response (if the business or machine is down, I will get up in the middle of the night to change, and then I realized the happiness of being a client)

4, write technical architecture, database design and other documents (for iSO9001 standards or government/enterprise government project acceptance documents)

5. Architecture abstraction (study the most suitable architecture, molecule the business, investigate different frameworks or tools)

6, security audit (same IP limit, request times limit, Https certificate, etc.)

7. Consider the series of problems caused by high concurrency (which is required for products with large daily/monthly lives)…

Here’s an example:

Just like the mobile terminal to develop a login function, according to PM, UI, UE design interface, only need to input the user name and password, and then wait for the response result.

Never mind login frequency limit, IP limit, verification code validity, password match, login session retention, security brush, etc.

Mobile only needs to care if the Http Status of your Api call is 200.

The logic on the back end is complex, and there are mature frameworks that can handle most scenarios.

The pursuit of the front end: beautiful interface, smooth page interaction, clear business logic, reasonable componentization, stable external SDK, etc.

The pursuit of the back-end: stable interface, reasonable architecture, clear business logic, reasonable module separation, support for high concurrency.

Third, history

The following are the different architectural patterns in Java enterprise-level project development. A year is not long, but I have been involved in the following architectural patterns.

1, JSP (front-end mixed development)

JSP, full name Java Server Pages, is a dynamic web development technology. It uses JSP tags to insert Java code into HTML pages. Tags usually start with <% and end with %>.

JSP is a Java servlet, mainly used to implement the user interface part of Java Web applications. Web developers write JSPS by combining HTML code, XHTML code, XML elements, and embedded JSP actions and commands.Copy the code

The JSP retrieves user input data through web forms, accesses databases and other data sources, and then dynamically creates web pages.

JSP tags have a variety of functions, such as accessing databases, logging user selection information, accessing JavaBeans components, and passing control information and sharing information across different web pages.

2. Spring Boot (independent service in the back end)

SpringBoot is a new, open source, lightweight framework that the Pivotal team began developing in 2013 and released its first release in April 2014. Based on Spring4.0 design, it not only inherits the original excellent features of Spring framework, but also simplifies the whole process of building and developing Spring applications by simplifying the configuration. In addition, SpringBoot integrates a large number of frameworks to solve the problems of conflicting versions of dependency packages and unstable references.

It is designed to simplify the initiation and development of new Spring applications. The framework is configured in a way that eliminates the need for developers to define boilerplate configurations. In short, Spring Boot brings all the frameworks together by providing default configurations, making it easier, faster, and easier to build applications.

3. Spring Cloud (microservice)

Microservices is an architectural style in which individual applications are divided into small service units that use HTTP apis for resource access and operations. This is similar to SOA.

Microservices architecture emphasizes that business systems need to be thoroughly componentized and servitized. A component is a product that can provide services independently. Microservices deemphasize the ESB enterprise Service Bus, which is heavy in traditional SOA architectures. Microservices emphasize that each microservice has its own independent operating space, including database resources. The microservices architecture itself has its roots in the Internet, so the services that components publish to the outside world emphasize the HTTP Rest API approach. Compared to SOA, the fragmentation granularity of microservices is smaller.

Therefore, microservice architecture is an extension of SOA architecture ideas, with more emphasis on the independence of individual services and smaller fragmentation granularity.

4. Spring Cloud Alibaba (Alibaba Microservice)

Spring Cloud Alibaba is a one-stop solution for micro-service development provided by Alibaba, which is the integration of Alibaba’s open source middleware and Spring Cloud system.

Ali Open source Components

Sentinel: Traffic is taken as the entry point to protect the stability of services from multiple dimensions such as flow control, circuit breaker degradation and system load protection.

Nacos: A dynamic service discovery, configuration management, and service management platform that makes it easier to build cloud-native applications.

RocketMQ: An open source distributed messaging system based on highly available distributed clustering technology that provides low-latency, highly reliable messaging publishing and subscription services.

Dubbo: Apache Dubbo™ is a high-performance Java RPC framework.

Seata: Alibaba’s open source product, an easy-to-use, high-performance microservice distributed transaction solution.

Alibaba Cloud ACM: An application configuration center that centrally manages and pushes application configurations in a distributed architecture environment.

Alibaba Cloud OSS: Alibaba Cloud Object Storage Service (OSS) is a massive, secure, low-cost, and reliable Cloud Storage Service provided by Alibaba Cloud. You can store and access any type of data in any application, at any time, anywhere.

Alibaba Cloud SchedulerX: A distributed task scheduling product developed by Ali Middleware team, which provides second-level, accurate, highly reliable and highly available timing (based on Cron expressions) task scheduling service.

Four, project

View the relevant corresponding process of the project engineering code is as follows…

1, JSP project

Github.com/GeeTeam/gt-…

2. SpringBoot project

Github.com/xkcoding/sp…

3. Spring Cloud Project

Github.com/mxdldev/spr…

4. Spring Cloud Alibaba project

Github.com/funtl/sprin…

Five, the contradiction between

As products and services, the back end and the front end are interdependent, and it is hard to avoid some conflicts of love and murder.

1. No documentation

Use Swagger or Mook, and update and sync any changes.

2. Incomplete documentation

Suggested that such

{code: 0/1/2/3, // 0: normal, 1: parameter error, 2: user does not exist, 3: user does not have permission, etc. MSG: 'XXXX ', // indicates the message of this operation. [], // count: x // count: x}Copy the code

3. Version problem

For example, a /user interface can be added with a version number, such as /user/1.3, in order to adapt to different phases of the client interface.

4. Verify interface parameters

For example, enter an ID number, the client can verify, the server on the interface side can also do the verification. Both sides are recommended to do verification, so the most safe, afraid of both sides are not to do verification, it is nonsense.

5. Interworking with the faulty interface

The client locates the problem, can accurately locate those details through the agent or browser extension function, with the fact screenshots timely communication.

Need buck-passing

For example, if there is a requirement, the client can implement it, and the back end can also implement it. In this case, it is recommended to do the backend, because the backend can be unified to do, the logic is consistent, reduce risks, save labor costs. If the risk of change is changed, the client, especially the iOS client, is more troublesome to review the release version, and the back end is equivalent to hot update effect after the release version is changed directly.

Six, the summary

To sum up, the mobile terminal itself has a complete knowledge system. When it comes to the backend system, it can see the similarities and differences between the back end and the front end. Each role has its own strengths and weaknesses, and it’s interesting to look at technology from a full-stack perspective.

After mastering one language, one can dabble in many. The underlying rules of the language are similar, after all, many of the architectural patterns design ideas are similar.

Learning and time to practice, not also said?