📜 ⬆️ ⬇️

How-to: How the hosting provider infrastructure is built

image

Business hosting providers are extremely technological - in order to ensure uninterrupted operation of even the largest and most popular sites, it is necessary to create a powerful infrastructure. Today we will talk about the architecture of external systems of the project 1cloud .

Elements of infrastructure


When building the infrastructure, it was decided to maximize the separation of the various components of the product, which can be called “hosting services”. With increasing load, this approach will allow us not to break a single application and not to engage in complex migration, but simply to transfer the necessary service to a new server.
')
The 1cloud system consists of the following components:


When creating services used technology C #, ASP.NET MVC 5, Entity Framework 6.1. All the listed components are connected by a common software part called DataLayer - it contains information on models, static methods, common dictionaries. The same solution defines the so-called data facade for working with the database.

Schematically, the infrastructure can be represented in a similar way:

image

Click image to open in full size.

Consider the individual elements of the system in more detail.

External site and internal panel

The main site 1cloud , about the redesign of which we recently talked about , is used to attract new customers and serves as a showcase that visitors first see. To increase the conversion of pages on the site, important elements for users were added, such as a calculator, which allows calculating the cost of services (this decision was made on the basis of analyzing the behavior of visitors from the previous version of the site, where this page was divided into two).

The inner panel is focused primarily on typical operations for managing its servers and paying for services (integration with the Money Online payment gateway).

There is also the “administrative” part of the site, which is accessed by support staff.

Any action performed on the external site, “admin” or control panel is not executed immediately, but is put in a queue for asynchronous processing (in other words, a corresponding task is created - task). Only information entered in the database is instantly recorded.

Task processing service

Created task handles a special service. Processing is carried out using the fifo method in parallel mode. There are several types of handlers - it depends on the type which handler will interact with the incoming task. This service is responsible for working with the API of third-party systems.

During the processing of tasks, it is often necessary to send alerts that are also not sent immediately, but are queued for processing.

Notification service

This part of the system was originally designed with the expectation of working under conditions of significant loads. In particular, thanks to this, the service produces almost no analysis of the messages sent (there is only protection against sending duplicate notifications).

All correspondence parameters (to whom, from whom, subject, body of the message in html / plane text) are defined at the task processing service level. Notification service also works on the fifo principle.

Billing subsystem

One of the most important from the point of view of business elements of the system. This service is responsible for charging services and debiting customers. Every 10 minutes, the service collects the parameters of the ordered services, calculates the cost and, accordingly, writes off personal accounts of users. At present, the subsystem is not particularly difficult - and this is one of its main advantages, since such an architecture is easier to maintain (although the number of generated operations per day initially gave us difficulties that we had to cope with separately).

image

In the future, we will have to develop billing, since we plan to introduce new services and pay for you actually pay for resources (during this project we plan to work with VMware vSphere API.

Service for sending asynchronous messages

The hosting provider has to periodically disturb clients with automatic messages (for example, reminders about the removal of a blocked server after 14 days). Only “specially trained” service that receives information from other modules of the system can create such messages.

Monitoring system

The “chief diagnostician” of the system, which mainly monitors its internal health and looks for errors like hung tasks or failures during their processing, problems in billing, sending messages and parsing logs (log4net component is used for logging).

Plans


In the future, we are planning to launch a load balancing service, which will allow customers to order load balancing on an application running, including on servers in geographically separated data centers.

That's all for today. Write in the comments about what elements of the infrastructure of the hosting provider would you like to know more?

Source: https://habr.com/ru/post/244121/


All Articles