Migrating web service to Yandex.Oblako with AWS

    Hello! My name is Vitaly Davydov, I am the founder of Poteha Labs.

    At the end of last year, Yandex launched a new product for developers, Yandex.Oblako , which provides computing power and related services for processing and storing data. In this article, I will talk about how we evaluated the transfer of one of our projects to the Cloud, about its features and tariffs.

    Overview of Yandex. Cloud

    There are two ways to deploy your web service or mobile app. Consider the example database (as one of the parts of the web service):

    • Self-managed - we rent a car and deploy our PostgreSQL on it. The postgres has both pluses and minuses: if the loads are small, then such a solution will be enough. But the more volumes, the more maintenance is needed, and at some point it will require a separate DevOps engineer.
    • Fully-managed - we choose a cloud provider and use PostgreSQL as a service. In this case, the cloud provider assumes the support of the entire infrastructure and ensures that everything will work in accordance with the SLA (agreement on the level of service provision, which limits the maximum unavailability time, the maximum total unavailability time per period ). There are no problems with infrastructure support.

    Those who choose the cloud option are familiar with the three major service providers: Microsoft Azure , Amazon Web Services (AWS) and Google Cloud . They provide an unlimited number of virtual machines and dozens of convenient services, and from three options, you can choose the right solution for the price. We usually work with AWS, which recently have several inconveniences when used in Russia.

    The first feature of AWS in Russia is associated with active blocking of the RKN, which many services suffered in 2018, from startups to banking systems ( Viber, Skyeng and others ).

    In addition to this, since the beginning of 2019, Amazon has begun to chargefrom Russian companies VAT (20% of the price) for the use of their cloud solutions. This is not specifically Amazon-specific: Microsoft, Google and other foreign Internet companies are already collecting VAT, but this is in any case unpleasant for companies for price increases for the usual set of services.

    In addition to well-known international companies, there is also the Russian market for cloud systems: the Mail.Ru Cloud Solutions platform , Selectel and some smaller players. So far, many provide only rental of iron, which is not equal to cloud computing. A full-fledged cloud provides not only rental cars, but also a set of accompanying services to simplify the infrastructure (for example, such as managed databases).

    Russian market

    In Russia, full-fledged cloud solutions are few (namely, two): MCS from mail.ru and the recently launched Yandex.Oblako .

    Yandex is approaching the issue of providing services already in order to lease an ecosystem of services. The cloud out of the box offers not so many services as in AWS: computers, data storage, databases, load balancer (alpha), container orchestration (alpha), plans to add a serverless platform. The proposed set of services allows you to design and scale a large number of business solutions faster than on your own infrastructure, and the number of services is also constantly increasing. Cloud has three data centers, so you can create geographically distributed systems.

    At the end of 2018, Cloud started publicly and first opened the connection through an affiliate program (in which we became one of the first partners), and since December 7, 2018 has become available to everyone. When you connect now Cloud gives users a grant for acquaintance - 4000 rubles for 2 months . Thanks to early access, we looked at the opportunities, rates, and made calculations to transfer one of our services from AWS to Cloud.


    Now our web service works in production on AWS and consists of two components: the front and the back, so consider the transfer to the Cloud component by component. We are migrating an application with the following technology stack:

    - Frontend . Written on React, rendering takes place on the client. Static files (html, scripts and styles) are stored on the Simple Storage Service (S3). AWS Frontend Architecture

    - Backend . Django application that runs in docker containers on Elastic Compute Cloud (EC2) virtual machines. The machines are managed by Elastic Container Service (ECS, free container orchestrator), for databases we use PostgreSQL in the Relational Database Service (RDS). For load balancing - Elastic Load Balancer (ELB).AWS backend architecture
    We do application deployment via GitLab CI, using AWS CLI to update the service on ECS and statics on S3.

    How the service architecture will look on Yandex. Cloud:

    - Frontend . Instead of S3, Yandex Object Storage is used, from which you can also distribute site statics. Frontend architecture on Yandex.Oblaque

    - Backend. Instead of EC2, Yandex Compute Cloud is used, which is similar: there is also block storage, which exists separately from the machines. There is currently no ready-to-use ECS analogue for the Cloud (but there are Yandex Instance Groups in the alpha version, on the basis of which they promise to provide a managed container service). Therefore, for now, instead of ECS, Kubernetes or Rancher should be used, which you need to deploy yourself. Yandex Load Balancer in the Cloud is also in alpha, so for now you can use nginx, raised on a separate machine, as a balancer. For PostgreSQL, the Cloud has Yandex Managed Service for PostgreSQL.Backend architecture on Yandex.Oblaque

    Cost estimate

    After studying the possible architecture, we made an estimated calculation of the cost of service on the Cloud (the official tariffs are here ). In the table below, the approximate cost of each item for our service (prices do not include VAT).

    whatHow much is, rub. ($) / month
    Load Balancer
    (1 pc., 1 GB RAM, 1vCPU 100%, 10 GB SSD)
    1,300 (20)630 (10)
    Application instances
    (2 pcs., 4 GB RAM, 1vCPU 100%, 20 GB SSD)
    7,400 (115)2,350 (36)
    Instance for container containers container
    -630 (10)
    (2 pcs., 4 GB RAM, 1vCPU 100%, 100 GB SSD)
    12,800 (198)630 (10)
    Object storage
    (10 GB, 1 000 000 PUT, 10 000 000 GET)
    585 (9)470 (7)
    Public IP
    (2 AWS, 4 Yandex.Oblako)
    470 (7)380 (6)
    Outgoing traffic
    (500 GB)
    2,925 (45)635 (10)
    Total25 480 rub. ($ 392)9 695 rub. ($ 149)

    For our parameters, the Cloud turned out to be 2.6 times cheaper than AWS. Financially switching to the Cloud for the service is exactly profitable (detailed calculations for the Cloud, for AWS, you can use the online calculator ).

    Features of Yandex. Cloud services

    • Yandex Compute Cloud differs from EC2 by the fact that on EC2 you can increase the power of a machine by RAM and CPU only simultaneously, and in the Cloud they are independent (for each vCPU you can choose from 1 to 8 GB RAM), which gives more flexibility.
    • Yandex Object Storage is compatible with API S3. Of the minuses, it is not yet possible to configure an https-certificate for your domain. The problem is solved using the Cloudflare certificate, then the traffic from the user to the external API layer will be protected. This is a quick and easy option. You can also configure server-side rendering, so we are waiting for the Cloud to add this feature.
    • In the cloud, there is no service for asynchronous centralized logging (analogous to AWS CloudWatch), so third-party solutions must be connected to collect and analyze logs.
    • Resource Access Control: in AWS, this is done through roles that are created in the Identity and Access Management (IAM) service and are automatically assigned to all instances within the ECS cluster. The Cloud also has its own IAM , but as granular rights as in AWS are not yet available.
    • While there are no GPU machines for computing.


    In conclusion, we highlight the reasons for trying Cloud from Yandex:

    • Potentially large set of infrastructure services;
    • For some services, an AWS-compatible API is available, which greatly simplifies the transition;
    • Tariffs are lower than Western counterparts, there is no link to the dollar;
    • Protection against sudden blockages;
    • The data center in Russia, thanks to which the law on the protection of personal data of users is always implemented.

    For 2019, Cloud has big plans for releases of the declared services and adding new ones. We think that with such a set of opportunities and tariffs it can become a strong competitor of Amazon in the Russian market.

    Thank you for your attention, I will answer questions in the comments.

    Thanks to Zhenya ( pruzhinkina ) and Cyril ( kpotehin ) for help in preparing the review .

    Also popular now: