Issue 11445

Rewrite native api persistence layer

11445
Reporter: mdoering
Type: Improvement
Summary: Rewrite native api persistence layer
Description: Having a separate Agent based legacy persistence model causes the registry code to be more complex and error prone than needed. Creating a new persistence layer that natively stores the api models via mybatis would remove the need for factories mapping between the different models. It would also simply the sql and allow to setup proper constraints for relationships. Many errors we currently find in the data would be impossible then, for example having a hasDataResource relationship from an Organization to a Node.
Priority: Major
Resolution: Fixed
Status: Closed
Created: 2012-06-20 10:48:22.512
Updated: 2013-12-16 17:50:35.686
Resolved: 2013-12-10 17:16:42.686


Author: trobertson@gbif.org
Created: 2012-10-26 11:38:46.676
Updated: 2012-10-26 11:38:46.676
        
Some comments on this.  Tim proposed a registry strategy on the mailing list, and we should consider this issue in a wider context of a registry cleanup.

During a night of insomnia, Tim started a _yet_to_be_committed_ project for this is as an experiment, but represents a clean codebase as a starting point.  One thing that came out of this, is some very simple views on the DB would be highly useful, rather than keeping the complex SQL joins in the code.  Most likely the mybatis generation tools, run on the views would generate the CRUD boilerplate, and only the accessors would need to be constructed - that depends on whether MySQL supports updatable views (to be investigated) - if it doesn't then it would be verbose to manage both.


    


Author: mdoering@gbif.org
Created: 2012-10-26 11:54:51.359
Updated: 2012-10-26 11:54:51.359
        
The best would be to leave the old db design behind and create a new schema from scratch. This would also allow for stronger constraint checking, in particular with separate tables for the different classes.

I understand that we seem to have to live with the current structure, but a clarification would be useful.
Can we do small modificitions, for example needed for the new tag api?
Would it be possible to create a registry export into the old legacy structure for the likes of scratchpads?
    


Author: kbraak@gbif.org
Created: 2013-12-10 17:16:42.709
Updated: 2013-12-10 17:16:42.709
        
Rewrite of Registry schema completed in Registry2.

Closing issue.