PHP library and analytics controversy
My initial release of the PHP Bolt Driver aimed to empower developers with a seamless way to interact with graph databases directly from their PHP applications. However, despite its functional success in achieving this goal, the library didn't garner the anticipated level of recognition or reward. To gain a clearer picture of its adoption and usage, and to provide data that could be leveraged in future discussions or collaborations, I implemented anonymous analytics collection. The implementation of analytics, even with a focus on aggregated, anonymous data, inevitably invites scrutiny. Despite prioritizing user privacy and aiming solely to gather broad usage patterns, I still encountered concerns regarding data collection. While I collect only two counts: number of executed queries and number of sessions, the default opt-in nature of the solution also contributed to friction. Users expressed concerns about automatic data collection, even with the assurance of anonymity, highlighting the sensitivity surrounding data practices. Implementation To minimize performance and requirements impact on the library's users, I opted for a local storage approach. The collected data is stored in a file within the system's temporary directory. This strategy avoids immediate network requests during library operations, ensuring minimal latency. The core of the data handling resides within the FileCache class, an implementation of the PSR-16 cache interface. This allows for flexibility, enabling users to substitute the default FileCache with alternative caching solutions if preferred. Addressing concurrency - file locking A critical consideration was handling concurrent access to the data file. To prevent data corruption, I implemented file locking mechanisms within the FileCache class. This ensures that only one process can write to the file at any given time, maintaining data integrity. To learn more check the FileCache source code. Asynchronous reporting - Mixpanel integration To minimize the impact of data transmission on application performance, the collected data is sent to Mixpanel via an HTTP request during the library's initialization. This transmission occurs only if unsent data older than a day is detected. Once the data is successfully sent, it is deleted from the local file. This approach effectively avoids persistent network latency during regular library operations. Popularity Besides almost half million downloads with composer here are the current data, which are publicly available.

My initial release of the PHP Bolt Driver aimed to empower developers with a seamless way to interact with graph databases directly from their PHP applications. However, despite its functional success in achieving this goal, the library didn't garner the anticipated level of recognition or reward. To gain a clearer picture of its adoption and usage, and to provide data that could be leveraged in future discussions or collaborations, I implemented anonymous analytics collection.
The implementation of analytics, even with a focus on aggregated, anonymous data, inevitably invites scrutiny. Despite prioritizing user privacy and aiming solely to gather broad usage patterns, I still encountered concerns regarding data collection. While I collect only two counts: number of executed queries and number of sessions, the default opt-in nature of the solution also contributed to friction. Users expressed concerns about automatic data collection, even with the assurance of anonymity, highlighting the sensitivity surrounding data practices.
Implementation
To minimize performance and requirements impact on the library's users, I opted for a local storage approach. The collected data is stored in a file within the system's temporary directory. This strategy avoids immediate network requests during library operations, ensuring minimal latency.
The core of the data handling resides within the FileCache class, an implementation of the PSR-16 cache interface. This allows for flexibility, enabling users to substitute the default FileCache with alternative caching solutions if preferred.
Addressing concurrency - file locking
A critical consideration was handling concurrent access to the data file. To prevent data corruption, I implemented file locking mechanisms within the FileCache class. This ensures that only one process can write to the file at any given time, maintaining data integrity. To learn more check the FileCache source code.
Asynchronous reporting - Mixpanel integration
To minimize the impact of data transmission on application performance, the collected data is sent to Mixpanel via an HTTP request during the library's initialization. This transmission occurs only if unsent data older than a day is detected. Once the data is successfully sent, it is deleted from the local file. This approach effectively avoids persistent network latency during regular library operations.
Popularity
Besides almost half million downloads with composer here are the current data, which are publicly available.