Recommend a 👍 :
- Close to 100K Star’s Java Learning/Interview guide
- Github 95K + liked Java interview/learning manual. PDF
Today I recommend a friend’s open source interview question brush system to my friends.
In this article, I will introduce the open source project in detail from the system architecture design level, and introduce some commonly used technologies of microservices. Even if you’re not interested in the project, there’s a lot you can learn about microservices. A fun!
Last night liver for a long time ~ original is not easy, if have help, beg praise beg forward ah!
I have to say, there is something about this system, and you really deserve it! Firstly, this is a microservice project, and secondly, this system covers mainstream technologies commonly used in the market, such as SpringBoot, Spring Cloud, etc. (more on this later).
Whether you want to learn distributed technology, or you want to practice on a real project or use it as your own project experience, this project is perfect for you.
Plus, because the project author provides detailed technical documentation, you don’t have to worry about getting started!
rendering
Let’s take a look at the effect of this interview brush question system. Here we only show the front end of the system (wechat small program), the background management system is not shown here.
As you can see, the UI is pretty, except for a few ugly color combinations.
Technology stack
Back to the big question: “What is the technology stack for this system?” .
The system uses mainstream technology that companies are using today: SpringBoot (infrastructure), Spring Cloud (microservices), MyBatis (ORM framework), Redis (cache), MySql (relational database), MongoDB (NoSQL), RabbitMQ (message queue), Elasticsearch (search engine). Moreover, the system is deployed in a Docker containerized manner. Very practical!
System Architecture Design
After understanding the technology stack, it is necessary to have a brief understanding of the architecture design of the whole system, which is the soul of the system (source: PassJava official documentation).
The gateway
The gateway is responsible for authentication and authorization, traffic limiting, fusing, degradation, request distribution, and load balancing. In general, gateways provide these functions.
The Spring Cloud Gateway is used as the Gateway. Spring Cloud Gateway is the second generation Gateway framework officially launched by Spring Cloud to replace Netflix’s Zuul Gateway.
Registry and configuration center
The registry and configuration center uses Alibaba’s open source Nacos. Nacos is currently a member of Spring Cloud Alibaba. It is used to discover, configure, and manage microservices, similar to Consul and Eureka. In addition, it provides distributed configuration management function.
The basic description of Nacos is as follows:
Take a closer look at the two core features Nacos provides in this project:
- Registries: The API gateway gets the routing address of the service in real time through the registry and accurately routes requests to individual services.
- Configuration center: In traditional configuration mode, the service needs to be restarted. If there are many services, you need to restart all services, which is very inconvenient. With Nacos, we can dynamically configure services. Moreover, Nacos provides a simple and easy-to-use UI to help manage the configuration of all services and applications.
In addition to Nacos, there are Apollo, SpringCloud Config, K8s ConfigMap to choose from.
Distributed link tracking
Unlike a single architecture, in a distributed architecture, requests need to be invoked across multiple services, and troubleshooting problems can be cumbersome. We need a distributed link tracking system to address this pain point.
The distributed link tracing piece uses Twitter’s Zipkin, combined with Spring Cloud Sleuth.
Spring Cloud Sleuth just does some data records related to link tracing, and we can use Zipkin Server to process these data.
Related reading: 40 Graphs to understand distributed tracking System principles and Practices.
The monitoring system
Monitoring systems help us monitor the status of our applications and alert us to risks before they occur.
The monitoring system used Prometheus + Grafana. Prometheus collects monitoring data, and Grafana displays monitoring data. We simply selected Prometheus as the data source for Grafana.
For a more detailed description of the technology selection for monitoring systems, see the article “Monitoring System Selection is enough! Prometheus or Zabbix?” .
The message queue
As we know, message queues provide three main benefits to the system:
- Improve system performance (reduce response time) by asynchronous processing.
- Peak clipping/current limiting
- Reduce system coupling.
The common message queues are: RabbitMQ (the system’s scheme), Kafka, RocketMQ.
The cache
Caching in this case is Redis, but I won’t go into that anymore.
In addition, in order to ensure the high availability of cache service, we use Redis Sentinel, an official Redis cluster solution, to manage Redis cluster.
The database
The database here uses MySQL, and uses the master-slave mode to achieve read and write separation, to improve read performance.
Object storage
Since it is a distributed system, the traditional uploading of files to the local machine has not been able to meet our needs.
Since it is difficult to build a distributed file system by ourselves, we use Ali Cloud OSS for object storage, which is mainly used to store some files such as pictures.
Rapid development of scaffolding
In addition, renren-fast is used here for the rapid development of scaffolding for the background. Using this scaffolding in conjunction with the code generator Renren-Generator, we can quickly generate about 70% of the front and back end code. It is a great tool for fast development and delivery of projects and private work.
I have also recommended this scaffold in the past, please see the following two articles for details:
- I hear you’re taking a private job? Guide overnight put together the scaffolding for the rapid development of five open source, free Java projects.
- Free hands, here are five quick development scaffolding for Java project development! Project experience and private work are not a worry!
conclusion
In this article, I mainly analyzed the open source micro-service-based brushing system of my friend from the perspective of architecture design.
Of course, the main purpose for my friend to develop this project with micro-services is to practice the knowledge related to micro-services by himself, and also to provide a learning project for friends who need micro-services related actual combat project experience. Otherwise, just use the monomer and it will support the concurrency of the project for the time being and the foreseeable future.
- Project address: github.com/Jackson0714…
- Address: document jayh2018. Gitee. IO/passjava – le…
One more time! Last night liver for a long time ~ original is not easy, if have help, beg praise beg forward ah!
My Github address: snailclimb-Overview