Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify Tracker/Db and Db into one? #7727

Open
mattab opened this issue Apr 21, 2015 · 5 comments
Open

Unify Tracker/Db and Db into one? #7727

mattab opened this issue Apr 21, 2015 · 5 comments
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Apr 21, 2015

The goal of this issue is to consider if it's possible to simplify a key component of Piwik core architecture: database drivers.

Current Piwik uses two different implementation of Database objects, Tracker\Db (used in Tracking API) and Db (used everywhere else). It's always a bit surprising when one learns about this. The historical reason was that Tracking API needed to be small memory footprint and very fast, which is still the case today, but back in the day it was estimated that loading Zend_Db was too slow. But maybe today is not anymore so important and maybe we could merge and use only one Db driver for easier maintenance & more clean code platform in the future?

(to find out we may want to compare profiles of Tracker\Db vs Db and see if there's any difference at all already, or if not too difficult to do maybe we could directly make the switch in the codebase and compare performance of before/after)

@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Apr 21, 2015
@mattab
Copy link
Member Author

mattab commented Jul 14, 2015

Tentatively adding to 3.0.0 roadmap. Is this actually do-able in 3.0.0, what do you think?

@mattab mattab added this to the 3.0.0 milestone Jul 14, 2015
@mnapoli
Copy link
Contributor

mnapoli commented Jul 20, 2015

👍

@tsteur
Copy link
Member

tsteur commented May 10, 2022

If we implement this as part of Matomo 5, then ideally there weren't any breaking changes as this could make it quite hard for people (and ourselves) to make plugins compatible and to figure what changes are needed.

If there has to be a breaking change, then this should be only in the tracker DB as less plugins are using the tracker DB meaning it will be less work to make plugins compatible and we get less unexpected bugs.

@sgiehl
Copy link
Member

sgiehl commented May 10, 2022

If we decide to do that in Matomo 5 I would suggest to get rid of Zend_Db completely. It already isn't able to handle MySQLi exceptions that are thrown on PHP8.1 by default. So might be better to replace it with some custom adapter or maybe another library that isn't too overblown.

@tsteur
Copy link
Member

tsteur commented May 10, 2022

If we can fix the issue for PHP 8.1 ourselves in Zend (maybe we already did), I would highly recommend not doing it as it might be hard to keep the DB adapter compatible with a newer library and the effort does in the end not outweigh the benefits if otherwise everything works. It be quite a bit of effort to keep the same API, not change any behaviour, etc. As we wouldn't want plugins needing any change for no real benefit in the end.

@justinvelluppillai justinvelluppillai modified the milestones: 5.0.0, 6.0.0 Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

6 participants