
Introduction
Shopware Services, based on the Shopware App system, are a fairly new way to deliver functionality made by Shopware to shops using Shopware.
This functionality, since it is based on the App system, integrates seamlessly with shops while, at the same time, making upgrading Shopware to newer versions easier.
It also allows for adding new functionality without needing to upgrade Shopware or host and manage a service yourself.
In this post, we want to show you how an easy method can make your App more bulletproof in the long run by removing inactive instances from your database.
Stability enhancements
With shop functionality becoming more distributed, systems need to know which clients are active and what their status is.
Over time, test, staging, development, and no longer active systems will accumulate in App server databases, and also for us at Shopware when providing Services.
To mitigate that, Shopware now pings shops periodically that are using Services. A process that can also be used by all App server providers to keep their databases lean and clean.
In order to make this process as lightweight as possible, this ping is using an existing API route, _info/version. This is an authenticated call, meaning it can't be used by unknown actors.
From a data perspective, only the HTTP status code in the response is interesting.
Shopware uses this ping in a very simple way: If a Shopware shop using services is pinged, we expect a status 200 OK. With that, all is fine until the next periodic ping.
If a shop is pinged by the Shopware Services system, but does not respond or gives an error code, then we will try again later. On multiple failed connection attempts, the shop will be removed from our service registry.
This whole process is running in the background and does not impact shops. In the edge case that a shop is live, is using Services, but the _info/version API endpoint is not reachable repeatedly, we also provide a command for re-registering Services, or Services can be re-installed in order for the Services to work again.
Outlook
This exact behaviour and functionality of this addition to Services might change in the future based on community feedback, in which case we will keep you posted.
For all App developers out there, we encourage you to keep your databases clean by a periodic ping, depending on your customer base. Just make sure to ping responsibly.




