Automate chain of processes that code goes through from developer to user, and make sure it works correctly.
POSiFLORA Sales accounting system
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.
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.
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.
- 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.
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.
|Can be handled without DevOps
|DevOps are needed not only on large projects, but also on small ones, for 3 to 4 developers
|Only very small teams of a couple of developers can do without the dedicated role of DevOps. Moreover, some of them will have to take over DevOps functions. In any case, you need to have a programming language interpreter, a database on the server, and set up a security policy.
|DevOps is needed where there is data exchange with servers: for the development of a website, web services, browser applications, and mobile applications like messengers and social networks.
|DevOps isn’t needed when developing mobile applications that don’t connect to the Internet. For example, for a photo editor, calculator, or simple game. In this case, the programmer writes the code, the application is tested by QA engineers, and then it is placed in the App Store, Google Play, or Windows Market, where the infrastructure is monitored by Apple, Google, and Microsoft.
- 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