Syncing contact properties from our DB

Hello,

We have a teachers and students platform.

We have each of our teacher users represented as contact in HS. In fact, the teacher is being created as Lead in HS before he’s even being created in our database.

Once teacher signs up to our platform, we start connecting students to his class.

We have a marketing team who are just waiting for us to sync a lot of insights from our DB into HS in order to send useful campaigns.

Examples for desired teacher HubSpot properties:

1. Number of student’s assignments for each teacher

2. Number of students who were signed up to a teacher’s class.

3. Average exams score

etc…

We assumed the right way for us will be to run a scheduled job on our side and then sync all of the teacher’s information all at once, but there’s a rate limit of 150/10 (requests/seconds) defined on the API which makes it almost impossible for us to use.

For example, we have about 1000 teachers, and 50,000 students.

If we run the script every hour assuming only 50% of the doctors needs to be updated - means 500 contact update requests. it means i need to start managing some kind of a queue in order to make the requests go through without crossing the rate limits.

As we grow, the quese is going to make bigger and bigger and it doesn’t make sense to hold a job up and running for so long (we’re using AWS lambdas so there’s also a hard limit of 15 minutes timeout for lambda execution).

I wondered what are the best practices, how are you guys managing similar integrations? Thanks!