Startups find it important to quickly demonstrate the feasibility of their business direction with market actions. For a technical team in a startup, a team that supports services, the design principles should be:

On this premise, Lao Fu based on Ali cloud service practice (practice is not YY) a set of technical architecture, if you have the misfortune to walk here, I hope the picture below does not harm you.





It’s more scaffolding than architecture, because what you see are the most commonly used frameworks and technologies, with the possible difference of using some aliyun services.

For the above picture, my husband answers some questions that may exist.

Q1: What does Nginx do with Ali Cloud load balancing (SLB)?

SLB’s main purpose is load balancing, and nGINx can do the same. If only considering load balancing, Aliyun’s SLB superiority is higher.

But nginx can do more, such as reverse proxy, HTTP server, more flexibility. So if you want to simplify, the SLB of Aliyun can indeed be removed.

In practice, I use both Nginx and SLB. In addition to the reverse proxy, Nginx also assumes the HTTP service for a static site.

Question 2: Can Nginx be replaced with Apache?

Don’t talk nonsense, cabbage radish each likes, about nginx and Apache comparison yourself Google go.

Question 3: In the figure, does one Aliyun ECS deploy only one Tomcat service?

That’s right. There is no universal solution here, you can choose to open multiple Tomcat ports on one server, and for me, one Tomcat configuration on one server is more streamlined, and the ECS will not fail as a cluster.

Q4: How does Spring Session work?

It is difficult for the Technical architecture of the Internet not to involve distribution, and the technical solution of session sharing must be considered, which requires a complete set of session framework to do this. Spring Session provides a set of distributed Session solutions. By default, Redis is used to manage sessions (currently, the latest version supports DB, Redis, mongodb, Gemfire and other ways to store and manage sessions).

In the actual practice, Cookie and Header schemes of Spring Session are used together, and Session stores Aliyun Redis. So far, we have not encountered any obstacles.

Question 5: What does Swagger mean?

If you are involved in APP development, you must be involved in API management and document writing. Swagger is a framework for managing API interfaces in projects. If you want to manage API documentation better, try Swagger and you’ll love it. Oh, and forgot to tell you, he actually uses Springfox- a SwaggerUI based library.

Q6: How to evaluate the Ari Cloud REDis, OSS, MQ?

In distributed session solutions, the optimal location for storing sessions is Redis. If the initial number of users is small, you can even store sessions in the database. Memcached is not recommended. For start-up companies, it is not recommended to maintain a set of Redis cluster environment, the cost is slightly higher. So if you can use Aliyun’s services, use them.

As for the object storage OSS of Ali Cloud, it should come from TFS inside Tao System, and the effect of using Ali Cloud CDN is beyond doubt. And we basically use the most is the image, CSS, JS storage, the industry has a lot of free and stable storage, start-up companies are more inclined to qiniu Cloud storage. Compared with OSS, the free quota is higher, the documentation is more complete, basically need to support, such as image compression, watermarking, voice and video sharding, etc.

MQ, message queue service. It didn’t work because I replaced it with A Reactor, which is at least satisfying for my current business, but there’s no denying the importance of distributed message queues, which startups have more leverage over running them themselves than using them directly.

After the business volume comes up, how to play?

First ha ha, and then put a picture, you welcome downstairs PK

The old man took a deep breath of smoke and slowly spit out a cloud circle, muttering in the heart: the support of the business can catch up with Taobao……

Friendship note: the above aliyun services can be replaced by open source implementation or self-implementation and operation and maintenance at different stages of the company.