I do believe that the data is all written to the files themselves. Otherwise, when you delete Mediabay3.db, all data would be lost, but it isn’t.
The mediabay is a sql database which can be edited using a database browser – I used DB Browser for SQLite –
Also, I did an experiment – I made a duplicate of an audio file.
I opened mediabay and changed some tags on the file duplicate, and then compared to the original. The copied file’s size was changed, and date updated to the time mediabay added data.
Then I opened them using a text editor (PSPad) which revealed an entire XML data structure at the end of the audio file and the changes I made were easily found.
click to see xml data
<STEINBERG>
<ATTR_LIST>
<ATTR>
<NAME>AudioSyncpoint</NAME>
<TYPE>int</TYPE>
<VALUE>63953</VALUE>
</ATTR>
<ATTR>
<FLAGS>2</FLAGS>
<NAME>MediaDuration</NAME>
<TYPE>float</TYPE>
<VALUE>43.427891</VALUE>
</ATTR>
<ATTR>
<NAME>MediaRating</NAME>
<TYPE>int</TYPE>
<VALUE>5</VALUE>
</ATTR>
<ATTR>
<NAME>MusicalCategory</NAME>
<TYPE>string</TYPE>
<VALUE>Vocal</VALUE>
</ATTR>
<ATTR>
<NAME>MusicalCharacter</NAME>
<TYPE>string</TYPE>
<VALUE>Single</VALUE>
</ATTR>
<ATTR>
<NAME>MusicalInstrument</NAME>
<TYPE>string</TYPE>
<VALUE>Vocal|Spoken</VALUE>
</ATTR>
</ATTR_LIST>
</STEINBERG>
</BWFXML>