Migrating schema from another database to Fauna

What tools can be used to migrate a database schema to another database schema, say from Oracle schema to MySQL schema?

Hi @SteveHopps ,

We don’t yet have tooling which could examine relational schema declarations and translate them into Fauna schemas. I’m not aware of any open source tools which work well here either. However, it is a capability I have been giving thought as part of our future roadmap. Now, while there may be no good tools, there are good techniques you can use to transition your schema from a relational model into Fauna.

To start, you could, simply map each table of your relational schema into a collection in Fauna, on a one to one basis. However, while that’s a conceptually simple migration strategy, sticking with a heavily normalized data model can prevent you from getting all the benifits that a document oriented database gives you. Fauna’s JSON based data model has a natural affinity to object oriented design, and a good place to start your schema design is to look at the domain objects currently used in your applicaiton layer, and simply serialize those objects in JSON form. Because the JSON model can represent objects so well, it’s often the case that the schema you use in Fauna be a 1 to 1 match with the domain objects you operate in the application itself. The upshot of the modeling technique is that you can avoid the costly process of normalizing your objects across multiple tables, only to then have to reconstruct those same objects with costly joins each time you read from the database.

Now, there are workloads which do benefit from normalization, and there are situations which using a join across collections is the right way to construct a query. Fauna’s combination of ACID compliance, strong consistency, and document orientation gives a lot of latitude in how you may wish to model your data. However, many operational workloads are more effectively served when your use a data model that matches closely to your domain model.

In regard the tooling we would offer to help users to translate a relational schema to a Fauna schema. Relational databases’ data description languages are limited in their ability to represent objects natively. Put another way, SQL lacks the ability to fully describe the relationship between tables such that you can represent your domain objects in the database itself. This is why developers often use ORMs with their RDMBSs. The ORM configuration, by definition maps tables to objects. So, rather than build a schema translation tool that would take a relational schema as an input, I believe it would be more effective to provide a tool which would take an ORM configuration as an input, and generate the Fauna schema from that. Would such a tool be useful to you?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.