The question is not very clear. Please try reformulating your problem.
What I understood is if bar can subscribe to changes made for ID and the answer is Yes.
And bad will be notified whenever foo writes and commits changes related to ID.
If you don’t want to persist ID, you can model it as operational data that is stored in CDB in a non persistent way (This is the default). You can have applications register to the operational data changes using cdb_oper_subscribe().