Magento comme boîte noire – l'utilisation des microservices ecommerce – partie 1
Si vous avez déjà voyagé en avion, vous connaissez sans doute le principe de la boîte noire : un petit élément de l'appareil qui enregistre tout ce qui se passe pendant le vol, afin que, dans le pire des scénarios, nous puissions reconstituer les dernières secondes du vol.
But there is another definition of a black box in IT that can be presented as a complex system or device whose internal workings are hidden or not readily understood. It is this and the related matter of building microservices for ecommerce that we will be addressing in this two-part article.
Microservices ecommerce dans un concept de boîte noire
In this concept – a black box is a magical box that does its things, but no one knows how. If we could transplant this idea into ecommerce, this would be easily represented as SaaS – software as a service, where the user (owner of the business) does not know how the service mentioned above works. It works great for such platforms and is heavily represented on the scene. Some well-known names are BigCommerce, commerce tools, Wix, Shopify.
Mais la première question qui se pose est la suivante : où est stockée la logique métier si ce n'est pas dans la plateforme ?
This is where the idea shines. At the base, this black box creation has all the basic functionalities of the ecommerce platform, such as products, categories, customers, carts, checkout, payments, delivery and so on. Those basics can then easily be used to create more complex constructions not on the service itself, but just alongside, as microservices for ecommerce. So, for instance, if you need to calculate a new special price based on some rule, we shouldn’t do this in an ecommerce platform, but we should instead build a dedicated tool just for that, connect with API and store the price in a field that was already predefined.
Such a microservice architecture allows us to deploy changes for different services more quickly and more frequently. Additionally, looking at it also from the developer perspective, we can use different languages and tools to create such microservices, thus making such work more pleasant for the team.
Mais Magento – une plateforme dédiée à la personnalisation – peut-il être une telle boîte noire, et est-ce réellement une bonne idée ?
La réponse est oui, mais…
API first
Magento has particularly good API coverage – while using the API (REST/GraphQL), you can do everything there is to do, not only from the customer front but also from the clients’ backend. Whether it’s order handling or stock management, uploading products or catalogue configuration – we can do this using API-connected microservices for ecommerce.
Coût de la personnalisation Magento
Magento is known for many things, but its customisation properties are one of the best in the market. Do you need some specific functionalities? If it is not already built-in, then there is a high chance that it can be bought. But what if there is nothing off the shelf? Of course, you can get developers and pay them to create some logic and custom code, but you will quickly understand that it is not cheap.
Les développeurs Magento sont coûteux, et étant donné qu'il ne s'agit pas d'un logiciel de niveau entreprise, cela peut s'avérer un peu trop coûteux pour la plupart des clients de taille moyenne.
Now, here’s where the marvellous concept of microservices for ecommerce comes in. Thanks to this concept, you are not restricted by technology and niche markets (it is not niche per se, but it is a bit closed), and you can more easily find a team that maybe won’t even break your budget.
Séparation de la logique métier
Once you start treating Magento as a black box, you will move all your business logic to your own curated services, and you won’t be restricted by things Adobe decided to do. However, there is another side to this too. For example, once your logic of special price calculation is decided, it can be something completely different than the calculation of B2B prices. If it were in Magento, those calculations would probably always be somehow intertwined. This kind of separation allows different teams to work on various cases, even if they are connected at first glance.
Mise à jour Magento facile
This matter is rather simple to explain. If there is no custom code in the core of Magento installation, then it is easier to update it to a newer version. This allows us to quickly deliver security updates and spend less time on that process. Adobe can promise many things, but custom-coded Magento will always be a real problem to keep up to date with the newest versions.
Moins d'extensions tierces – moins de problèmes
Un problème similaire est résolu en ce qui concerne 3rd extension tierce – ce que l'on appelle les fournisseurs externes. Le transfert d'un maximum de fonctionnalités vers des microservices élimine certaines extensions populaires de l'équation, et comme le dit le vieil adage, « moins de code externe dans le cœur, moins de problèmes ».
Mais où est le problème ?
There is never an ideal situation – so even if we tried to create such an implementation of Magento, we would quickly find problems. A simple shop with a small amount of custom business logic would be possible to build in this way. However, whenever we have more and more options coming into play, it adds more complexity to the original Magento build, making such a black box very hard to maintain.
Let us just throw in a mix of new, more complex attributes to sort or filter. Suddenly, it becomes increasingly harder to move such code to external services, and we end up extending core functionalities. And this is just a simple example of how it can get worse once we dive into more complex business logic.
Cette solution est également révisée très rapidement lorsque nous devons créer des promotions ou utiliser des fonctionnalités d'Adobe Commerce comme, par exemple, la planification de contenu. Ces éléments sont difficiles à maintenir depuis des sources externes et nécessitent de se connecter à la plateforme. Altout à coup, l'idée d'une telle boîte noire qui reste un mystère pour le client devient problématique.
Alors, est-ce une bonne idée ?
Une fois encore – une telle solution est possible, mais la réponse à la question : « est-ce une bonne idée ? » n'est pas simple. S'efforcer de créer une solution aussi parfaite peut aider à réaliser une construction complète et de qualité, mais ce mélange peut être une expérience très discordante.
Dans la deuxième partie, nous analyserons un exemple concret d'une telle réalisation et comment nous pouvons résoudre certains des problèmes mis en évidence ici. En attendant, si vous souhaitez en savoir plus sur les solutions technologiques que nous pouvons fournir pour votre boutique en ligne, consultez notre page d'offre.
arrow_circle_right LECTURES RECOMMANDÉES :
