I am trying to implement a solution that will allow users to create 10k+ records via UI. Basically, there is a custom component that allows multiple record creation. There could be 20-50k records, so I`d not use Bulk API. I cannot use Batch job as there are many jobs stuck in a queue all the time. Also, it has to take as less time as possible as the user would like to see the data in CRM after DML (up to 1-2 mins).
I came up with two solutions:
Call Apex REST API from Apex class for every 10k records and do DML in Apex Webservice.
Implement solution on middleware (Node, Java, Python) and send data there for calculation. Middleware will convert and prepare data accordingly to Salesforce import format and will call standard/custom REST API for every 10k records.
I can go with the first one and save time & money for implementation as no need for middleware, server, etc. But I am not sure it is a good solution.
Any help would be appreciated.