Ideas for synchronizing data over the central api

somebody recently PMed me to ask me a question about how to get data out of central. i asked that they post my response so that the community could also see this information, but they haven't. so instead, it is my work to paste this here. i hope it is helpful, and please let me know if there are questions.

if you are willing to poll an api for updates, the audits api could be a great solution for you. if there is something about the audits api that prevents this case from working smoothly, please raise it as a suggestion in the forums.

if you must have push, i’m afraid we just haven’t heard a lot of need for that so we haven’t thought about it in a while and don’t exactly have plans to. i’d suggest building a custom version of central that calls out to whatever hook you need.

the worker system could be helpful for this: it reads events off the audit table. if you look at that table’s schema you’ll see the columns related to the worker queue. certain events can have work associated with them, and that work is done offline from the main acceptance of the submission from the client, and the system has retry logic with some mild backoff built into it as well, for resilience. there’s not a lot of code in there, if you poke around you’ll see what to change and copy and paste.

i’ll say that we are aware of a rare issue where workers can crash and not recover, but we’re looking into it and hopefully the next release will address the problem.

normally nobody on odk staff will respond to a pm for help, myself included. if we started doing it we’d never have time for anything else. it’s better if the community has the knowledge. if you’re willing to, please post this information (you can paste my whole reply if you want) on the forum so everyone can have it.

we might not hear enough to work on the feature but i know there isn’t nobody else out there trying to do exactly this.

2 Likes