I have a legacy system that has been ported to a modern system and uses berkeley database. It is compiled with open cobol.
In the previous system the serialized fixed data CISAM files were converted one time per day to microsoft database using ACCESS macros in order to be used from a simple web front end.(one way)
I want to create a new web front end and i want data to be real time updated...
The problem is that berkeley database is key value database and doesnt support sql.
So the problem here is
Should i create a web service that provides data to the web front end using Berkeley database ?
OR
Should i synchronize berkeley database with a relational Database (Mysql,postgresql)
In the first case there wouldnt be a synchronization issue.But the problem is that flexibility is very limited... For example sorting by a collumn that it is not indexed requires custom sorting function... Summing some fields requires reading all the record data and then summing manually..
In the second case the simple way is to just read and convert to database . I cant figure out a way to check what has been updated...inserted or deleted.
But i tend more to second method.. using the following algorithm
Check every 5 minutes the file modifation date...
Open files that have been modified... Then get all the keys and compare to cached keys array.
Then loop through each record and check if data hash is the same with cached hash.
Then delete/insert ..
ANy other ideas?
Why not take the source code to the berkely-db database driven system, and find a way to write a SOAP query and handle it using that application. Now you have a web service that can read this BSDDB directly and you don't need synchronization.
Even if you DON'T have the source code for the original application, if you can figure out how to unpack the content of the BSDDB key/value store yourself, you could easily (in Python for example) write a simple web service app that serves up the contents of your BSDDB database using SOAP. I would start by writing a few lines of Python that open up the BSDDB value, and dumps the Key-values, and their associated payloads. (The "Value" values, if you like).