I may be a little confused on your requirements, so please clarify if I am missing something. If you are planning on using app metadata to store a separate id for your database, that is fairly common.
Can you take a look at this thread and see if it provides guidance?