Start a new topic

Create multiple objects with single REST API request

I have been searching for multiple object creation in the Doc and found this comment:

This request allows only a single entity to be uploaded. For bulk upload, see the CSV/JSON import feature on the Kinvey console (navigate to the collection in the Data Store section, click Settings, then click Import Data).

Does it mean I cannot create multiple Objects programmatically, without manually using the interface?

That is correct-- we do not currently support creating multiple entities with a single request. Your app can, however, iterate over the entities you wish to create and make a request for each one either in sequence or in parallel.
This is a very bad news for me. I need to create and update about 100K objects regularly and making so many requests would not be practical and would make my jobs running many times slower and using lots more resources. Are there any plans to support it in the future?
Dmitri, can you describe your use case in more detail?
My use case is to pull the list of about 100K hotels (data objects) from third party, process and store them in BaaS cloud, where they can be accessed by the client.

I have to create the list and then regularly update it. I have tested with other services allowing both single and multiple create requests, the former took over 5x longer. With 100K requests each time I would pay much more for the time usage of, where I run the jobs. It would be much more efficient and resource-savvy to send objects in bulks.
Have you considered using a custom BL endpoint in order to effectively implement your own multi-insert? You can pass any data you would like to a custom endpoint (keeping in mind that we have a 1mb incoming request size limit), and then write your own BL that inserts multiple entities using the collectionAccess module.

As for "native" support for a bulk API-- we are not planning to implement one in the immediate future, but it is on our roadmap.
Haven't thought about that but yes, it would solve the problem I suppose, thanks!
Login or Signup to post a comment