F3 Prestashop Connector


One example of F3 application is the new Prestashop connector, built for one of our customers.
Some ideas were based on "prestashoperpconnect", a project by Akretion, CampToCamp and Sharoon Thomas, whom we thank a lot.
Our connector, however, is different: it works as an agent outside the F3 server! This offers at least 3 major advantages over any "module" implementation:
  1. the code is isolated; connector won't compromise the security or stability of the server. Same, the password or full Prestashop API of the connector is not accessible from the F3 server, either.
  2. the connector can have hard-coded "behavior" algorithms, which are customized in Python. These can be adapted to each Prestashop instance, and in fact, have multiple connectors with different algorithms, against the same F3 server
  3. the connector can be modified and restarted at will, without a need to restart the F3 server
A key component to the new connector is F3 framework enhancement of 'ir.model.data', now used to map arbitrary synchronization sources. This means that the connector, or any similar application, need not define any new models, install hooks or hack the API any way.
The agent can simply ask the F3 server: "what are the records I've previously sent by syncing?" Or: "have any of these records changed?"
Then, the connector becomes trivial. It only has to care about converting data types between the remote database (Prestashop) and local ORM objects. It can preserve the Relational integrity at both ends, carry actions rather than just data, or also apply rules to protect "fixated" records against modification.
A bonus feature of the agent connector is that it is a separate process, perhaps even in a separate host, which will not load the performance of the main F3 server. An "army" of agents may be evenly distributed across CPU cores or hosts, each having some small memory footprint and redundancy, meaning that it can be individually restarted at will.
Of course, the same principle can apply to other kind of remote databases, like Magento or even non-webshop applications.

Follow us