I am not sure what is your requirement but developing application in alfresco is something I really do not understand. You can use your existing application to interact with alfresco to get advantage of its CMS capabilities. I think in current application you are using db to store your content and you want to replace that thing to store documents in db is that the case?