All types may be external if the flag is set StoredInExternalRecord.

Any type can be an attachment with the flag StoredInExternalRecord.
The type NSTransformableAttributeType is managed.
The NSBinaryDataAttributeType type can be stored internally.
The save is in a CBL transaction.
For old, you just check the flag StoredInExternalRecord for NSBinaryDataAttributeType attribute to work as before.
According to my tests, the code can be up to 3 times faster.