My recommendation would be to simply use a SSD with DRAM-cache instead of an SD-card.
Just write the data to disk without a memory buffer and let the cache handle it.
This is a very straightforward solution, it should provide predictable results so that you can dial in the rate at wich you write data to disk without overwhelming the cache.
If you simply have to use an SD-card you can influence the behaviour of the OS-level disk cache (assuming you are using Raspbian) by editing an option file in fstab.
Take a look at this post from the official raspberry forum to get an idea of how to influence the disk cache:
https://forums.raspberrypi.com/viewtopic.php?t=157743#p1026791