Request failed with http status code 503

I'm getting "Request failed with http status code 503" when I try to save a CKRecord with a lot of children. The limit seems to be 5000. I tried to bypas this limit by using a hierarchy of parents and I can insert more than 5000, but I still hit this error after a while (I haven't pinpointed the exact number yet).


What is the recommended method to store tens (hundreds?) of thousands of records that all share a common parent?