We need to update a range of custom fields from Wordpress to Hubspot using the API. If we do this for every user using a CRON job it will slow down our web server. What's the best way fo approaching this for a Wordpress site with thousands of users? Need to suggest to my developer the most sensible approach.
Well it's definitfly not the right way, no need to create a hubspot submission and use a wordpress page. He juste have to create a php file with the hubspot sdk.
Inside is file :
- Make a mysql query - Do his stuff with hubspot api
It cost lot of ressource to use wordpress for that process and seems on my mind totally useless.
Maybe your developer should participate to this topic.
Well it's definitfly not the right way, no need to create a hubspot submission and use a wordpress page. He juste have to create a php file with the hubspot sdk.
Inside is file :
- Make a mysql query - Do his stuff with hubspot api
It cost lot of ressource to use wordpress for that process and seems on my mind totally useless.
Maybe your developer should participate to this topic.
Current code is here - looks like developer is simulating a form submission to achieve this. These all appear to be showing as marketing contacts even though API and non-Hubspot forms are defaulted to be non-marketing contacts. (This has lead to 14k new marketing contacts and a very large bill that I am now requesting is reversed!). Anyway, is there a better way to do this?
Does this action is a daily sync of user that is necessary do at a specific time ? In my mind there is there possibilities :
- If it's possible, split you update in multiple batch based on id (maybe by batch of 10) and displatch it during the day
- Or like most of website, you can make you sync during an idle time based on a dynamic read of your http incoming traffic or juste based on your visitor metrics, if you have less people between midnight and 4AM do it on this time.
You also have to keep in mind that a contact update if pretty fast and it's not a big deal for a webserver and for the hubspot api. Actually on my personal computer ( so my bandwith an performance are under a server) updating 500 contact took me 00:03:17
and i'm not using batch and doing other stuff on my computer on the same time.
Batch is a good idea - when we run the Cron it's killing our server so this could be poor code problem. I'll share code in case anyone is willing to point out what could be the problem...
I'd like to trigger an update when a database field is changed - any ideas on this?