author img

Michał Kloczkowski

WHY HOSTING IN E-COMMERCE IS NOT ENOUGH

9 key aspects of professional maintenance for Magento 2 and other platforms

Magento 2 is considered a mature and highly comprehensive e-commerce system. However, the software itself and its development, in a programming sense, do not guarantee that our online store will be well-secured in case of failures, perform optimally, and be embedded in an infrastructure suitable for efficient growth.

Over the years of working with our own stores and those of our clients, we have developed a set of standards that ensure the above aspects. Taking over existing online stores, we realized that they can be far from those standards. Therefore, we decided to share some key guidelines.

Below you will find 9 points that should be on your checklist to work through with the people responsible for maintaining and developing your store. We hope that this list will help you identify gaps, support you in constructing a backlog that will ensure better security for your business or provide greater convenience for your customers when using your store.

#1 Optimization of applications supporting Magento 2 engine

Magento 2 is the core application that drives the entire operation of an online store, but it cannot function without supporting applications. Apart from the most basic one - the MySQL database - we also have Elastic Search (required since a few latest versions of Magento 2), Redis, PHP, and optional elements like Varnish or RabbitMQ. Each of these applications can contribute to both speeding up and slowing down your website. Here are two systems that require special attention:

Elastic Search: A powerful engine that forms the foundation of Magento's search and catalog indexing. Its usage is often expanded with additional modules. While it enables efficient product catalog work, its technical aspects consume a significant portion of server resources due to Java being the language on which Elastic is based. Ensure that Elastic behaves properly and there are no bottlenecks when it consumes all resources needed for the essential functioning of basic applications. Reasons for such behavior can be various, and before troubleshooting in the code, you can mitigate unwanted effects by limiting Elastic's activity.

Varnish: Varnish Cache is an essential, though optional, element of e-commerce infrastructure. It allows speeding up the loading of web pages, improving the shopping experience for customers. By caching static resources like images, style sheets, and scripts, Varnish reduces the load on the server, resulting in faster page loading times and increased website performance. It is capable of handling a large number of requests, making it an ideal solution for high-traffic online stores.

#2 Ensuring store continuity: auto-installers and disaster recovery

Have you ever asked yourself how much time it would take to rebuild your website from scratch in case of, for example, a data center fire that hosts your services? Such scenarios stopped being unthinkable after a significant outage caused by the OVH fire a few years ago.

A good practice is to maintain auto-installers for your services. Tools like Ansible can be used for this purpose. In case of emergency situations that generate stress, it is better for the administrator not to struggle to remember what to do, but rather execute an automated script to recover the application. Auto-installers are also useful in daily work during deployments or when installing additional test/stage environments.

Additionally, it is essential to have a well-defined disaster recovery process, aimed at restoring the normal operation of the system after a total or partial failure. The goal is to minimize losses and downtime. It includes processes for creating backups, planning emergency tests, and defining recovery procedures in case of failure. This enables companies to prevent disasters and minimize their impact, which is especially critical for the continuity of e-commerce businesses.

#3 Using Zabbix for server and application monitoring

Zabbix is a popular and versatile monitoring system that can be used not only for monitoring servers and applications but also for monitoring online stores and e-commerce systems. In today's world, customers expect fast and seamless online shopping experiences, making monitoring performance and availability a necessity for business owners.

While Zabbix is often associated with monitoring server performance and triggering alerts in case of failures, it can also be used to monitor the application itself. By setting up triggers to monitor the availability of critical pages on your website, you can ensure that your online store is functioning properly and users can access it without any issues.

#4 Maintaining non-production environments and managing data security

Self-hosting the "production" environment (production environment) is only half of the success in running an efficient and reliable online business. In addition to the production environment, other environments such as testing, staging, and local are crucial for testing and deploying changes in a secure and controlled manner.

These environments allow for independent development and testing of changes and safe deployment of entire versions. A good environment is not just a working online store in "sandbox" mode but also includes all integrations related to modules and functionalities in our e-commerce platform. However, having multiple environments also creates its challenges, including issues related to data privacy.

Data security is critical for any company, especially those running online stores. Proper management of backups is one of the essential elements in data security, as backups are used to restore data in case of system failures or to recreate certain errors that occurred in the production environment.

Backups from production environments often contain sensitive information, such as customer personal data or financial data. Therefore, securely storing and limiting access to backups to authorized personnel are critical for the smooth functioning of the business. To achieve this, every online store should have a database anonymizer that removes customer personal data and sensitive business data before providing the database for development purposes.

#5 Code performance monitoring

Using additional tools for application monitoring, such as New Relic or Blackfire, is another essential aspect of effective e-commerce system management. Each new change added to your online store not only improves functionality but also introduces new code that needs to run on the server. Writing efficient code is as crucial to the overall performance as the functionality it implements. There are ready-made applications available for ongoing monitoring and development support in this area.

New Relic is an advanced application performance monitoring system that allows tracking user actions and detecting and resolving performance-related issues in real-time. It enables fast responses to problems and ensures that users have the best experience while using your online store.

Blackfire, on the other hand, is a code profiling tool that allows analyzing application performance in real-time and identifying performance issues in the code. With Blackfire, you can optimize the code and improve application performance effectively. It is particularly useful for developers and those responsible for maintaining the online store.

#6 Maintaining the repository and change deployment process

Maintaining an e-commerce application is not just about managing servers and taking care of the online store's operation. Equally important is the management of the codebase, which forms the foundation of the entire system. Without constant updates and verification, it is difficult to talk about the stability and security of the store. In some cases, the code repository might not be accessible, and only the server files are available when taking over a Magento store. In such cases, an audit of compliance and alignment with the official Magento/Adobe repository is necessary.

Using tools like GitLab can simplify the process. GitLab not only serves as a code storage location but also facilitates process automation. This allows for faster deployment of changes, easier teamwork, and continuous integration and deployment. Additionally, these tools enable effective code versioning and access management, enhancing security and process control.

#7 Cloudflare as a tool to support performance and security

Cloudflare is an interesting tool that offers various functionalities for online platforms, such as online stores or public B2B platforms. One of its features is Cloudflare Cache at the CDN (Content Delivery Network) level. It is an ideal solution for online services, especially those with a large number of users from different regions of the world.


Cloudflare Cache accelerates the delivery of static resources such as images, stylesheets, and scripts, reducing the load on the server. This results in significantly faster page loading times, which improves the overall user experience and customer satisfaction. Cloudflare Cache works not only for Magento 2 but also for various other web applications.

Cloudflare offers more than just cache services. Their platform provides solutions for security, content delivery acceleration, and protection against DDoS attacks. Cloudflare allows the easy application of these functionalities without the need for complex configurations.

#8 Log monitoring and analysis: rapid problem detection and resolution

In today's rapidly evolving IT landscape, every element of an IT system can experience failure, and the complexity of the system's architecture makes finding the root cause of an issue challenging. To solve such problems, tools like Sentry or Graylog can be used.

Sentry is an open-source tool that allows real-time monitoring of web and mobile applications and reacting to emerging errors in real-time. It collects information about errors and is particularly useful for companies with large amounts of code, where detecting errors can be time-consuming and costly.

Graylog on the other hand, is an open-source tool that enables collecting, processing, and analyzing logs from various sources. It allows real-time monitoring of applications, servers, network devices, and operating systems. Graylog automatically detects failures and warns about dangerous situations. With its powerful search capabilities, Graylog enables quick and effective log analysis and problem detection. It is worth noting the importance of log anonymization.

#9 "Replica" database

The final point relates to a component used by larger online stores, where online presence constitutes a significant revenue source. Often, this is not just an inexpensive solution, but rather classified as optional. This component is a dedicated server with a copy of the database, known as a "slave" but referred to as a "replica" to use a less controversial term.

A "replica" database serves as a secondary database compared to the production database. Unlike the production database, which is the most crucial one, the secondary database is used for additional purposes such as application testing, data analysis, and reporting, thereby reducing the load on the production database with unnecessary queries.

The role of such a database is also essential in maintaining the high availability of the service. In case of a failure of the production database server, the "replica" database can be used as a production database. To secure the database, it is not necessary to install multiple physical machines; cloud service providers like AWS's RDS offer suitable solutions.

Conclusion

The availability and responsiveness of an online store are essential factors influencing the success of a business in the digital realm. The availability of a website in hours is just one component of the user experience it affects. A poorly accessible store can deter customers from making purchases and discourage them from returning in the future.

The most significant dissonance in terms of user experiences related to what the sales platform was supposed to offer arises in those stores that were intended to be as perfect as possible. Complex solutions like those based on Magento 2 require a standardized approach and processes "from the backend" to ensure smooth deployments and maximum uptime for the online store.

The related topic of backups - the unsung heroes of daily online sales - has already become ingrained in the minds of e-commerce specialists and managers, forming the foundation of best practices. The same should be true for the choice of the right infrastructure and processes. It should be just as prominent as periodic unavailability or slowed performance will hinder the pleasure of using a well-crafted product at every other stage.

Read also: