4 ms·
How feasible would it be to create a plugin that stores the data elsewhere? The objective being to avoid calling the PHP server API initially, then import data
by heroprotagonist 6y ago
How feasible would it be to create a plugin that stores the data elsewhere?
The objective being to avoid calling the PHP server API initially, then import data on demand to view analytics.
This would:
* Avoid continuous operation of extra services
* Fit well with serverless architectures
* Enable true first party through avoidance of subdomain or path proxying
* Improve site load times by reducing extraneous calls
For example, consider this flow:
* Site javascript converts API calls to userTrack into calls to AWS AppSync, API Gateway, or other primary application datastore
* Analytics store in external data source as events
* When you desire to view analytics, a bootstrap script:
* Pulls the data from external datasource
* Imports data to MySQL
* Launches a temporary (or incrementally updated) instance of userTrack
* userTrack is shut down when not in use
- XCSme 6y ago> How feasible would it be to create a plugin that stores the data elsewhere? Currently there is some processing done (in PHP) on the server like getting IP, generating user hash, getting exact browser version from UA. I think this could somehow be integrated directly into the datastore, but I never thought about it before so I'm not sure how doable it actually is. > When you desire to view analytics, a bootstrap script Ok, so the main idea is to provide a better separation from data collection and data vizualization. Currently the UI and back-end can be separated, the UI just makes requests to the backend API, which loads data from the MySQL db and a few extra PHP calls to check for permissions and convert it to JSON. > AWS AppSync, API Gateway, or other primary application datastore I am not very familiar with AWS or those technologies, but I am not sure how they can handle user authentication and custom data mutation before storing it. I assume the point of using those is to have an auto-scaling data store where you only pay for what you use. The scaling part is always tricky, it is probably cheaper for low-traffic, but for high amounts of traffic you might be better of renting your own powerful VPS or dedicated server. I assume the main reason to have the userTrack dashboard load only on-demand would be cost. This is a good idea, only that the benefit is not that big as the dashboard can easily run on a $5/mo droplet, so you would safe at max a few dollars a month (if you manage to make the auto-provisioning server cheaper than the regular VPS). In conclusion, it is probably possible with not a huge effort. I am not really into this serverless trend so I think that for small to medium businesses just having a VPS will be easier and probably as cheap as all those AWS services.