HELP : `vault.adapter.write()` VS `vault.modifyBinary()` for working with custom files to store json data

Confusion

The question I am asking here is to make things clear about the various APIs provided by Obsidian to work with custom files (non-markdown/non0text files) and their performance differences. I want to decide which API I should be using to avoid any future limitations and bugs for my use-case.

Right now, we have the following APIs in Obsidian :

  1. vault.adapter.write() : The JSDocs says, its for plaintext files. But, it does work for json data for custom files (for example, files with .taskboard file extension)
  2. vault.adapter.writeBinary() : I havent tried this, but it should work same for my usecase.
  3. vault.modifyBinary() / vault.createBinary() : I have tried this, this works same as in the first API for me.

My question is, when I was using the 3rd approach earlier, I had to do some extra encoding/decoding operations for the data to get stored properly in my file. (Unless, if there was a simpler solution, I would love to know). And, I went with this approach from the start because, it makes sense, since I am working with custom file extension, with json format.

But, just to try it out, I have now used the 1st approach. And, I havent noticed any difference, either the way the data is stored (when I opened the .taskboard file in notepad editor) or I guess with the size of the file.

I have created this post, to understand the difference between the above three APIs I have mentioned, so I know what to expect from them and I can choose the right one for my usecase.

My use-case

I am not looking for storing the data exactly in the json format. Right now, with both the approaches, I have used, the data is stored like a single contineous string (JSON.stringify()). Which is fine with me, as I am not expecting users to open that file and edit anything. But, if I am able to see the content, then I can simply copy paste it inside a JSON editor (VS Code) and that will automatically format it in a JSON format, in situations when I want to debug the content, etc.

So, right now both the approaches are giving me the expected results. You may also refer the code below and let me know if there is any improvements I can do to handle any future bug from happening before-hand.

Example

When I was using the 3rd approach :

After I moved to the 1st approach :

This concern was also raised after looking at the Excalidraw plugin code :

Excalidraw plugin also uses the third approach. And, I am using this plugin as inspiration, as I am doing quite a similar things. It might not be that much of data as a .excalidraw file. But still want to make sure, if my .taskboard file size grows huge, will there be any problems.

I wanted to specifically ask this question to Excalidraw plugin devs, but I am expecting here to get some more knowledge on this.