A common question when building your Blockchain DApp (decentralized application) is what kind of database you want to use for your off-the-blockchain data.
The dilemma is between the standard a bit old-school SQL(relational) type and the more modern NoSQL JSON based data structures.
Why relational table-type SQL is not the best approach for Blockchain applications:
- Need to define the table schema definition up front
- If you need to update, the schema becomes difficult to manage
- Does not support hierarchical data
- Additional code layers are needed, which creates more complex application architecture
Why using NoSQL is better approach:
- No need to define scheme
- The use of JSON fields
- Supports hierarchical data
- Query based on key or partial key range
- Less code – just use built-in structure JSON serialization (marshalling and unmarshalling) supported by many languages
- LevelDB –http://leveldb.org/
- DocumentDB – https://azure.microsoft.com/en-us/services/documentdb/
- CouchDB – http://couchdb.apache.org/