Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Plan of springboot Cluster Scheme for small and Micro Enterprises

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces you to the plan of the small and micro enterprise springboot cluster solution. The content is very detailed. Interested small partners can refer to it for reference. I hope it can help you.

1. Characteristics of small and micro enterprises

Internet small and micro enterprises, to the high level is the new cutting-edge enterprises, to the low level is the poor B enterprises, no matter what, anyway, the characteristics are the same:

There aren't many developers. One less is one.

There is no full-time position, DBA, operation and maintenance, testing, what are these? Anyway, they are all shoulders of developers (if the boss hates it, he will add, full stack)

I don't have my own hardware. Anyway, if I can build it myself, I won't build it myself (if the boss has asked, he will say, Shangyun)

Be quick (if the boss is annoying, add, be agile)

Under such conditions, competent programmers expressed great challenges and voted with their feet to Tencent and Ali. And those who do not have the ability to code farmers (such as me), are not afraid of challenges, determined to survive in this harsh environment (mainly big factory do not).

In fact, in a long development stage of the enterprise, the performance of a single machine can bear the performance pressure, so our first solution is simple.

2、PLAN A

Purchase a domain name required by a company from a cloud service provider and configure the domain name to point to the purchased server IP

Buy a Cloud Virtual Machine from a cloud service provider, install nginx and java environments, configure the domain name pointing to nginx, and configure the cloud database address pointed to by the program

Buy cloud database services from cloud service providers, such as mysql, which is the most used.

The above three kinds of goods can be completed in a cloud service provider, and all you need to do is buy them. And the price is still good, an ordinary Cloud Virtual Machine in 5000 or so (1 year cost), database in 6000 (1 year cost), domain name cheap, as long as dozens of pieces, and run up is also very simple, as long as the program package can run up.

If you still need to save money, of course, you can build mysql on the Cloud Virtual Machine, so the cloud database will save money, but considering the following points, I still think it is necessary to separate the server and database at first:

Enterprise developers have high employment costs. If you build your own database on a Cloud Virtual Machine, you need to be familiar with the database. However, most developers use a lot of databases, so they are generally built, and even if they are built, it is difficult to master the exchange of reference and allocation of permissions. In order to save labor costs, they can spend money to buy services.

Internet companies often have more value for data than applications, so for the sake of data security, it is better to separate them from application servers to compare insurance.

The value of cloud services is reflected in the flexibility of performance scaling, and the database is the most common performance bottleneck. If the application server and the database are on the same machine, it is likely that even if the server configuration is improved, the problem cannot be solved in the shortest time because the resources are not allocated to the database (this requires a high level of database configuration personnel). If they are separated, once the database performance bottleneck is located, the performance improvement can be directly targeted at the database.

In fact, although this architecture is very low, in fact, many small enterprises have no problems at all. Performance bottlenecks can be improved in real time directly by spending money. The pressure can be said to be very small. Many enterprises I know have not used up the performance of application servers before falling down, so it can be seen that application server performance is definitely not the short board of small enterprises. But the shortcomings are also obvious, that is, a single point problem, the whole company's technical system in a server, in case there is a good or bad, the enterprise will be naked without technology.

3、PLAN B

This is the simplest cluster, adding a server and throwing some services to the cloud service provider. The specific situation is as follows:

Buying more than one server, in fact, a very important judgment of the cluster is whether it can be quickly and easily expanded horizontally. When there is a performance bottleneck in the server, the problem can be solved by quickly adding servers. The business development of small and micro enterprises is a kind of exhaust type. I don't know when it will suddenly increase, so it is the happiest to solve the performance problem directly by adding server horizontal expansion.

Multiple servers will have the problem of load polling. If it is very poor, then of course you can build your own nginx cluster, but considering that most programmers also use more nginx and configure less, this work can also be directly thrown to the Load Balancer service provided by cloud service providers, and generally also provide the weight of load distribution interface, which is much more convenient than self-built. It will also be used later to do gray online.

Load Balancer provided by cloud service providers generally has a virtual IP. Point the domain name to this virtual IP. If there are multiple applications on the Cloud Virtual Machine that play different ports, then one's own nginx must be set up on the server as a local proxy.

On a single server, session and cache are not a problem, but in the cluster environment this is a matter ah, although spring boot simplifies a lot of work in this regard, but the change has to be changed, the allocation has to be matched, here through redis to get session and cache, if very poor, redis can also cluster itself, but also most people redis also used more, with less, this work is also thrown to cloud service providers.

In addition to caching, there is also a file that needs to be shared by multiple machines. Files that cannot be uploaded by server 1 cannot be seen by server 2. If you are poor, you can build your own distributed file system (such as TFS,FastDFS), but still that sentence, why use the distributed file service provided by the cloud service provider.

In fact, there is also a cluster will encounter a problem is the timing task, but this can not be solved by buying, but spring quartz has a solution, this is the programmer's job, do not trouble the cloud service provider.

Although it doesn't look like a cluster solution for small enterprises, which is all about buying and buying, compared with labor costs, this kind of service that costs only a few thousand yuan a year (Load Balancer, redis and distributed file system can be paid according to the amount) is actually very cheap, and if you pay according to the amount, you can ensure that the enterprise will have an increase in expenses when the business volume rises. And if business volume rises, is money still a problem?

About the small and micro enterprise springboot cluster plan to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report