Import from RDBMS

NOTE: As of OrientDB 2.0, you can use the OrientDB-ETL module to import data from an RDBMS. You can use ETL also with 1.7.x by installing it as a separate module.

OrientDB supports a subset of SQL, so importing a database created as “Relational” is straightforward. For the sake of simplicity, consider your Relational database having just these two tables:

  • POST
  • COMMENT

Where the relationship is between Post and comment as One-2-Many.

  1. TABLE POST:
  2. +----+----------------+
  3. | id | title |
  4. +----+----------------+
  5. | 10 | NoSQL movement |
  6. | 20 | New OrientDB |
  7. +----+----------------+
  8. TABLE COMMENT:
  9. +----+--------+--------------+
  10. | id | postId | text |
  11. +----+--------+--------------+
  12. | 0 | 10 | First |
  13. | 1 | 10 | Second |
  14. | 21 | 10 | Another |
  15. | 41 | 20 | First again |
  16. | 82 | 20 | Second Again |
  17. +----+--------+--------------+