Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Core db framework

884 views

Published on

A plug-in based, extensible database solution.
1) Performs powerful object relational Database mapping.
2) Supports CRUD operations on database data.
3) Supports CRUD operations on database schema (can programmatically create Database table modify Database table definition).
4) Tracing module supports CRUD operation on historical data.
5) Security module supports applying CRUD permissions on data.
6) Supports full text search.
7) Supports MS SQL Server, MySQL, PostgreSQL, Oracle and Derby.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Core db framework

  1. 1. CoreDBA plug-in based, extensible database solution.By Huangtao (Sean) Xiong (Now Research Engineer at NICTA) Xu Zhao (Now Software Engineer at Ryarc Digital) Van Munin Chhieng (Now Software Engineer at MQ Group) Service Oriented Computing Research Group School of Computer Science And Engineering
  2. 2. Architecture
  3. 3. Overview Performs powerful object relational mapping. Offers developers:  Query on databases – CoreDB Base  Trace historical data – CoreDB Tracing  Apply security policies – CoreDB Security  And do fulltext search – CoreDB FulltextSearch programmatically.
  4. 4. CoreDB Object Relational Mapping Abstracts relational databases to java objects:  Database – DatabaseSchema  DB tables – EntityClass  DB table column – AttributeClass  Table data row – EntityInstance Easily build DB connection and generate DB mapping By creating EntityController Object String path = “credential.txt”; // stores DB connection parameters IEntityController iec= new EntityController(path); No Mapping configuration file, all mappings stored in memory No table beans and daos will be generated Get Table definition object by calling EntityClass ec = iec.getEntityClass(tableName); Get Table columns object by calling ec.getAttributeClasses(); Or get particular column: iec.getAttributeClass(tableName, columnName);
  5. 5. CoreDB BaseQuery on Database (CRUD Operations) CRUD on Data: CoreDB Base offers developers to create, read, update and delete data rows and do joins among tables programmatically. CRUD on Data Schema: CoreDB Base offers developers to create tables, get table definitions, update tables (add/update/delete columns) and delete tables programmatically
  6. 6. Example – Create a data row // set the table name String tableName = “the name of table”; // create entity instance object for the table EntityInstance entity = iec.createEntityInstanceFor(tableName); // to set the value of columns entity.set(columnName, columnValue); //for example, set value for a string type column FirstName entity.set("FirstName", “John”); // Insert into DB iec.createEntity(entity);
  7. 7. Example – Create a table // Create a list of AttributeClasses (Columns) List<AttributeClass> acl = new LinkedList<AttributeClass>(); AttributeClass ac = AttributeClass(“ColumnName”, Integer.class); ac. setPrimaryKey(true); ac. setAutoIncrement(true); acl.add(ac); // Create index for table List<IndexClass> icl = new LinkedList<IndexClass>(); IndexClass indexClass = new IndexClass(ac, true); // true means unique index icl.add(indexClass); // Create an EntityClass Object (table) EntityClass ec = new EntityClass(“TableName”, acl, icl); // Create table in DB iec.deployDefinition(ec);
  8. 8. CoreDB Tracing Extends CoreDB Base Developers can read all the historical data and know who is the operator for every data modification Can be easily applied on existing Data tables. By calling iec.initializeMode(true, Mode.TRACING); Do not do any modification on existing Data tables Can be easily de-tracing – remove tracing.
  9. 9. User CaseJohn Simth is the CEO of company A and he has been worked in A for 12years. He was promoted twice from Manager to Director (in 2000) andthen CEO (in 2004) over the past 12 years.HRs record in data table employee ID FN LN DOB Address Tel Title Salary Start date 001 John Simth 13/07/1963 Queens st 1234567 CEO 500 k 02/02/1999
  10. 10. User Case with Tracing HRs record in data table employee ID FN LN DOB Address Tel Title Salary Start date 001 John Simth 13/07/1963 Queens st 1234567 CEO 500 k 02/02/1999 HRs tracing record (between 01/01/1999 and currnet)ID FN LN DOB Address Tel Title Salary Start date Last Last Updated Update By Date001 John Simth 13/07/1963 Queens st 1234567 CEO 500 k 02/02/1999 Linda 04/04/2004001 John Simth 13/07/1963 King st 1234567 Director 300 k 02/02/1999 Linda 02/02/2001001 John Simth 13/07/1963 Park St 1234567 Manager 150 k 02/02/1999 Linda 02/02/1999
  11. 11. CoreDB Security Extends CoreDB Base Offers data access controlling (CRUD)  Controlling on users User group level   user level  Security on Data Data rows   Table columns Can be easily applied on existing Data tables. By calling iec.initializeMode(true, Mode.SECURITY); Do not do any modification on existing Data tables Can be easily removed
  12. 12. User Case with SecurityHRs record in data table employee (Viewed by HR Administrator) ID FN LN DOB Address Tel Title Salary Start date 001 John Simth 13/07/1963 Queens st 1234567 CEO *** 02/02/1999HRs record in data table employee (Viewed by Payroll Adviser) ID FN LN DOB Address Tel Title Salary Start date 001 John Simth *** Queens st 1234567 CEO 500 k 02/02/1999HRs record in data table employee (Viewed by other employees) ID FN LN DOB Address Tel Title Salary Start date 001 John Simth *** *** 1234567 CEO *** 02/02/1999
  13. 13. CoreDB Fulltext Search Extends CoreDB Base Applies Fulltextsearch on tables OR table columns Index data can be stored in DB, File or Memory Easily build FTS index and remove FTS index Supports CUD operations with index Supports FUZZ read and result Entities will be sorted by similarity Compatible with Luence Query Syntax
  14. 14. Whats the next? CoreDB DataCube Researcheres and Engineers in SOC are working on CoreDB extensions Probably will be open source soon????
  15. 15. Thank you!Questions are welcome!!

×