Blog: bugstack.cn

Precipitation, share, grow, let yourself and others can gain something! 😄

One, foreword

Architecture, the framework for development?

For those who are new to programming, it may not be clear how the architecture came about and what it includes. If you have to say architecture, it’s probably the project currently open in IDEA that is architecture.

Apart from the architecture in the technology circle, is the drawing of building a house architecture, the steps of making tofu architecture, the process of getting married architecture? Inductive conclusion, all of these steps in computational cost, consumables, execution, and output, then the architecture can be seen as a blueprint to complete the target results, now in on the level of the technical architecture, architecture is not only our developers use technical framework, also need to according to the scene, scale, set technology selection, implement standard, the deployment structure, Synthesize to complete a project delivery.

  • Application scenario: your application scenario is the first decision you use which kinds of architecture, which may include: electric business, trading, social networking, video, music, travel, food and so on, of course, in addition to the application of the Internet scene, there will be some based on the application of Internet of things, such as: PLC applications, I/o interface card, repeater code and are you familiar with the community to the cabinet.
  • The business scale: this determines the scope and size of your users, if you are in the moment is fire trill in the development of the mall, at the beginning of the base of the size of your users from online is particularly big, but if you were a small electrical business start-up team, so every day the QPS at 5 ~ 10, may be you don’t need at this stage can carry more DaTiLiang system architecture.This is similar to the joke on the network, the team at the beginning of the recruitment of a big factory boss, is the construction of the super structure, before the system development is finished, the company lost!
  • Type of service: Once the scenario and scale are set, the next thing to consider is the overall technical implementation level. Type of service may be the initial consideration of the whole team for the breakdown of the system and how to support it. Of course, if it is a small team, it is best to reduce this link, even if all the functions are developed into a system to quickly verify the market is the main.
  • Deployment structure: It is the deployment structure that determines the development mode, single deployment, cluster deployment, distributed deployment, cloud environment, etc., which will determine the technology selection and framework structure. For example, it is difficult to implement distributed deployment without referring to RPC, and it is also difficult to support data applications in distributed deployment without using sub-database, sub-table and big data environment.
  • Development framework: MVC, DDD, this should be the research and development personnel first come into contact with the code development part of the overall system architecture, which is the realization of a specific function layer, if such a basic MVC structure used is monomer is enough, but if it is DaTiLiang distributed deployment, then you could have a plenty of database operation of system development, have a plenty of doing business, Some are used to support distributed tasks and consume MQ messages.
  • Technology selection: In fact, the development framework, whether MVC or DDD, is not affected by the selection of technology, any language can be placed in the same framework for development, such as Java, PHP, GO, but they are in their own language under their own solutions.

To sum up, this is the core content that our research and development personnel should consider when designing the architecture. With the continuous iteration of our technology, there will be more and more updated ideas. For example, the low code hot in 20 years and 21 years are all for better implementation schemes to reduce the cost and increase the efficiency of the architecture.

But if you want to understand and learn about architecture, it’s best to start with it as a sapling, and see how it grows little by little. Having such an architecture in mind also helps people understand and design the architecture you need.

Second, architecture evolution

1. Single architecture

  • Size: ⭐
  • Technology: Tomcat, Weblogic, Java, Mysql, MVC
  • Description: My blog bugstack.cn is based on this architecture, but not in Java. This structure is suitable for small business scenarios, usually the websites developed by the big guys in the early days of the Internet, but now this model has not expired, it still has its application scenarios.

2. Separate the application from the database

  • Size: ⭐
  • Technology: Tomcat, Weblogic, Java, DB2, MVC
  • Description: There is not much variation in this phase of the split, mainly due to the original monolithic architecture applications and database deployed on a server, resulting in poor performance. The simplest and most efficient split is to separate the application from the database, allowing them to perform best on their respective servers.

3. Use cache restamina

  • Size: ⭐ ⭐
  • Technology: Tomcat, Weblogic, Java, Oracle, MVC, Redis
  • Description: At this stage, we found that we need to frequently pull data from the database, which is very costly in performance. An attempt was made to store some data in local memory, but this data was lost after the service was restarted. Therefore, the cache service like Redis is introduced, which greatly improves the performance of the overall service at this stage.

4. Multi-application deployment and Nginx reverse proxy

  • Size: ⭐ ⭐ ⭐
  • Technology: Tomcat, WebLogic, Java, Oracle, MVC, Redis, Nginx
  • Description: when a single service bearing dimension has to the limit, can think of is more than the service deployment, because these services are doing the same thing, databases and a set of uniform, then through the reverse proxy Nginx, can spread out the user’s request to the different service, greatly reduce the service pressure.

5. Read and write data of the database are separated

  • Size: ⭐ ⭐ ⭐
  • Technology: Tomcat, WebLogic, Java, Oracle, MVC, Redis, Nginx
  • Description: The read-write separation design of the database is more because some business scenarios require a large number of transactional writes, affecting the services that require read operations. However, the read/write separation design does not improve the performance of the system much, because most of the read operations are already resisted by Redis. However, such a design approach provides new ideas for subsequent architectural models.

6. Deploy applications in groups

  • Size: ⭐ ⭐ ⭐ ⭐
  • Technology: Tomcat, WebLogic, Java, Oracle, MVC, Redis, Nginx
  • Description: The number of users that can be carried by all businesses in one application has reached its limit, so the next best architectural approach is to split the different businesses into different applications, each with its own database and deployed on its own server. This greatly improves the overall load capacity.

7. Application branch library design

  • Size: ⭐ ⭐ ⭐ ⭐
  • Technology: Tomcat, Weblogic, Java, Oracle, MVC, Redis, Nginx, MyCat
  • Description: When the application is divided according to different business systems, the next bottleneck is that the number of independent application users is still large, and the number of hot connections to the database keeps increasing. Therefore, under the current conditions, we start to design the application of sub-database operation, and at the same time, we may also introduce sub-table operation at this stage. In this way, the load capacity of a single application has been greatly improved, but other technologies such as distributed transactions and data summary need to be introduced to solve the new problems of dewarehousing.

8. RPC distributed deployment

  • Size: ⭐ ⭐ ⭐ ⭐ ⭐
  • Technology: Tomcat, Weblogic, Java, Oracle, MVC, Redis, Nginx, MyCat, RPC, LVS/F5
  • Description: after the system constantly refines the design again, in fact, some service does not require constant even library operation, they may be more packaging business logic, at the same time these belong to the underlying the operation of the database layer application system, you can use this system for library operation, and upper service via RPC framework to connect to this service. Now, the overall service performance can be improved through distributed deployment.

9. Application segmentation and gateway introduction

  • Size: ⭐ ⭐ ⭐ ⭐ ⭐
  • Technology: Tomcat, WebLogic, Java, Oracle, MVC, Redis, Nginx, MyCat, RPC, LVS/F5, Gateway, MQ, Distributed Task, Elasticsearch
  • Description: From top to bottom, the whole process of architecture evolution, we continue to split applications, separate deployment and application segmentation, are constantly improving the ability of application services, let each application body responsible for independent things. This phase has begun to embody the capabilities of microservices, and this phase has also introduced unified gateway access at the upper level and data usage at the lower level.

10. Low code programming and reuse

  • Size: ⭐ ⭐ ⭐ ⭐ ⭐
  • Technology: Tomcat, WebLogic, Java, Oracle, MVC, Redis, Nginx, MyCat, RPC, LVS/F5, Gateway, MQ, Distributed Task, Elasticsearch, SDK, Low code, Support Services
  • Description: At this stage, the service framework is basically able to support the user volume, so we start to consider how to develop and deliver more efficiently. This introduces service choreography, service governance, and common modules, components, and middleware. And these design basic is compressed to see before you actually develop an application, but all non-business logic function of commonality split out, again through the subdivision component and service ability of choreography, provide the required interface, thus will greatly improve the efficiency of the integrated sustainable delivery.

3. Structure diagram 📚 download

Some friends gave feedback on the architecture drawing and had some ideas of their own, but when they started to draw, they were confused and didn’t know where to start. So little Fu Ge to draw the architecture of the original map to share with you, you can let interested partners download and use.

Download the way

  • The public no. :Bugstack wormhole stackReply:Architecture diagramTo obtain the latest download link.Subsequent updates and additions will replace the link
  • Add Fustack, note:Architecture diagram

Four,

  • This chapter is also a summary of the content information of the series structure of Brother FuNew code farmersHave an understanding of architecture from small to large. In the summary of the arrangement is also combined with the current structure to simplify part of the content, because only peeling the silk to understand the most backbone of the content, we can continue to expand the branches and leaves.
  • From the process of evolution, we can see that business size will affect deployment, deployment pattern will change architecture, architecture will respond to development mode, the final language is only the most suitable tool for a certain architecture, and the application of various technology stacks also exists for technical needs.
  • Finally, if you want the picture to convey your meaning, try drawing and summarizing to find a structure that works for you.

Five, series recommendation

  • Have you been working for two or three years and have no idea what the architecture diagram is?
  • Technical literacy: Design and analysis for sustainable delivery of low-code programming
  • Scheme design: Based on IDEA plug-in development and bytecode staking technology, realize automatic analysis of r&d delivery quality
  • Half a year recruitment screening 400+ resume, tell you how to write easy to be flirted!
  • “Java Face book Manual” PDF, 417 pages 115,000 words, complete & release!