What tasks does DevOps solve?

Using the example of a platform for a flower business

In brief

Task

Automate chain of processes that code goes through from developer to user, and make sure it works correctly.

Project

POSiFLORA Sales accounting system

Expert

DevOps-engineer

What tasks it solves for the project

  • Increases speed of downloading updates to the server
  • Reduces errors
  • Reduces downtime

System results for business

  • Platform is used by 8,500 flower shops
  • 3.2 million API requests daily
  • Uptime — 99.95%
  • Possible emergency down time — no more than one hour per year

Over the past decade, the development cycle has become more complicated, and a new profession has appeared: DevOps engineer. It combines the functions of a developer and a system administrator. He or she prepares the server infrastructure for deploying programs, helps developers upload code to the server, and makes sure that everything runs correctly.

Previously, developers wrote the program code and put in on the server themselves. The sysadmin managed a server: changed drivers, and set up databases and network protocols
This is what one modern approach to development looks like: developers write code, test id, and give it to QA. A DevOps uploads the code to an external server, and ensures its correct execution.

How DevOps delivered 35 days of uptime for the POSiFLORA Platform

POSiFLORA is a sales accounting and control system designed specifically for the floristry business. It’s a single online platform with which you can manage all business processes at the same time:

  • Plan purchases, and keep records of flowers received and stock balances
  • Make bouquets, place orders, and accept payment from buyers
  • Analyze sales, stimulate customer loyalty, and allocate shifts to florists

DevOps task #1: Prepare a programming environment — an isolated area for a project on the server

Previously, the server was simply an iron box for storing data. Now, cloud servers are increasingly used, such as Google Cloud or Amazon Web Services. As an example, the POSiFLORA code is stored in Yandex. Cloud data centers.

In order for the code on the server to be executed, the DevOps prepares the environment for it: installs databases, programming languages, and application programs. For example, to run the POSiFLORA server-side powered by PHP, the DevOps must first install the language interpreter in the server.

An important task of a DevOps is to make configuration files. These are like text files that describe the infrastructure. If code contains commands that the program executes, then the configuration files contain commands that the server executes. For example, in order for the system to see the disks with databases connected to the MySQL server, it must be described in the configuration file.

This configuration file describes which drives exist, and how they are connected to one of the MySQL servers.

How this helps businesses

As the infrastructure is always ready to upload new code, a CI/CD approach is implemented — continuous integration and delivery. As soon as the developers complete the code for a new function, it’s tested and uploaded to the external server. This reduces release time: new platform functions reach POSiFLORA users faster, and they increase sales earlier with the help of these new functions.

DevOps task #2: Automate downloading updates to an external server

The DevOps uses the Docker tool to organize the packaging of code into containers. As they have standard dimensions, ordinary real-world freight containers are stacked as a constructor on the deck of any dry cargo ship. Inside the virtual containers is a code that «travels» to the server to be executed there. The DevOps also sets up a container management system. For POSiFLORA this is Swarm. Swarm monitors their condition, joint operation, and distributes the load.

Sample Docker file: take a base node image here, add NGINX to it, copy some files, and declare variables (ENV)

Containerization helps:

  • Avoid code conflicts with other system components, so you no longer hear programmers spout the legendary phrase, «It works on my machine!»
  • Increase the speed of uploading code to the server, as the container is already prepared for work at startup
  • Quickly return to the previous version if problems are found in a new version: upload the old containers and everything works again.

Automation of routine processes reduces human error. For example, a person, having posted the code, may forget to add the corresponding changes to the database. The system will not forget.

As a result, programmers can focus on their main task: development. And the DevOps helps you go the rest of the way: collecting verified codes in a container, sending it to the server, and adding it to an already running program.

How it helps businesses

Users encounter fewer bugs and incompatibilities, and enjoy a more positive experience from working with the platform. And programmers are busy only with the code: they don’t think about its future path or compatibility problems. This means they spend less working time on peripheral issues.

DevOps task #3: make sure the «conveyor» is working

What it does:

For POSiFLORA and other OrbitSoft projects, we chose the Zabbix monitoring system, because it can monitor both the server infrastructure and the program deployed in it. It also has convenient tools for setting up requests and notifications:

1. Server monitoring

Built-in Zabbix tools allow you to monitor the parameters of the server on which POSiFLORA is loaded: whether it’s available, whether it is overloaded with processes, and whether there’s enough free space and RAM.

2. Monitoring the program.

POSiFLORA is built on microservices. It’s set of functions is assembled from separate, independent modules, each of which performs its own task, such as working with a basket, placing orders, paying, and so on. This is convenient because if one module fails, the others continue to work. To test the operation of each module, we created a request-response system and configured notifications for them.

  • Query system.

By sending a request to the module, we are asking «How are you?». Some of the responses related to this request come from the module: «Everything is fine» or «I have a problem». For example, to test the system’s performance, you need to send a POST request with a client identifier to a previously created «test» client: catalog.posiflora.com/api/v1/status. In response, you will receive the current HTTP status — 200 or 201, which means «the request was successfully processed», and the client status itself is in json format. Here it’s important for us that the response, in principle, is returned: this means that the system is working. If the request reveals a problem, a script written by DevOps converts it into an event in the monitoring system

  • Notification system.

In order not to miss important events and to respond to them as soon as possible, the DevOps engineer sets up sending events from monitoring to e-mail through OrbitSoft’s own mail server. In order for notifications to come to Telegram, the DevOps wrote a script and created a bot. But the latest version of Zabbix already has such a function, so the script was disabled.

Notification of the monitoring system in Telegram about high load on the processor

How it helps businesses

Monitoring identifies faults and bottlenecks before everything breaks down. This helps to avoid «conveyor» accidents, and downtime during repairs. Thus, uptime for POSiFLORA is 99.95%, and possible emergency stop time is no more than one hour per year.

Advice from OrbitSoft: which projects need DevOps, and which ones can do without it.

Technical block

  • Docker containerization and orchestration, Docker Compose, Docker Swarm
  • Linux based servers
  • Monitoring on Zabbix, and tracking the speed of request processing by servers of the Grafana cluster
  • Logging Elasticsearch plus Greylog

Get a free consultation

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store