Most efficient way to batch upsert Documents

I have a use case where I need to upsert up to 50k documents per second. I am struggling to find a good example of this. We built a custom rust processor on a kafka consumer. Any help or guidance would be much appreciated.