Comparison of table-based and JSON-based chaincode

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Relational Database Alternatives NoSQL. Choosing A Data Model Relational database underpin legacy applications and meet business needs However, companies.
Dimensional Modeling Business Intelligence Solutions.
Introduction to Databases CIS 5.2. Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
SQL Server 2000 and XML Erik Veerman Consultant Intellinet Business Intelligence.
Is Apache CouchDB for you?
Persistence Store Project Proposal.
NoSQL continued CMSC 461 Michael Wilson. MongoDB  MongoDB is another NoSQL solution  Provides a bit more structure than a solution like Accumulo  Data.
Modern Databases NoSQL and NewSQL Willem Visser RW334.
Moohanad Hassan Maedeh Pishvaei. Introduction Open Source Apache foundation project Relational DB: SQL Server CouchDB : JSON document-oriented DB (NoSQL)
NoSQL Databases NoSQL Concepts SoftUni Team Technical Trainers Software University
NOSQL DATABASES Please remember to read the NOSQL Distilled book and the Seven Databases book.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
MongoDB First Light. Mongo DB Basics Mongo is a document based NoSQL. –A document is just a JSON object. –A collection is just a (large) set of documents.
Introduction to Databases CISC Where would you find info about yourself stored in a computer? College Physician’s office Library Grocery Store Dentist’s.
Some notes on NoSQL, in particular MongoDB Bettina Berendt (with thanks to Matthijs van Leeuwen for some of the slides) 8 December 2015.
Technology Drill Down: Windows Azure Platform Eric Nelson | ISV Application Architect | Microsoft UK |
NoSQL databases A brief introduction NoSQL databases1.
NoSql An alternative option in the DevEvenings ORM Smackdown Tarn Barford
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Cloud Data Models Lecturer.
HYPERLEDGER Fabric - Ledger v1 Data Architecture
HYPERLEDGER Fabric Pluggable/Queryable State Database
Neo4j: GRAPH DATABASE 27 March, 2017
Databases and DBMSs Todd S. Bacastow January
Plan for Cloud Data Models
Don't Know Jack About Object-Relational Mapping?
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
Database Access with SQL
“New” things Discussed in London
“Introduction To Database and SQL”
Databases and SQL Databases SQL Rev 1.5
CSE 775 – Distributed Objects Bekir Turkkan & Habib Kaya
Practical Office 2007 Chapter 10
Prepared by : Moshira M. Ali CS490 Coordinator Arab Open University
MongoDB Er. Shiva K. Shrestha ME Computer, NCIT
Office Open XML Formats: Enabling Solutions
Modern Databases NoSQL and NewSQL
Entity Framework By: Casey Griffin.
Privacy Enabled Ledger
NOSQL databases and Big Data Storage Systems
Paul Jacobs The iSchool University of Maryland Thursday, Oct. 6, 2016
XML and Databases.
Database Normalization
Databases and Information Management
Introduction to Database Management System
Hyperledger Fabric Private Data - Collection Types
1 Demand of your DB is changing Presented By: Ashwani Kumar
What is database? Types and Examples
11/18/2018 2:14 PM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN.
Admin Manual (version 1.0).
A JSON’s Journey through SQL Server
NoSQL Databases Antonino Virgillito.
Remote Data Access Update
Developing a Model-View-Controller Component for Joomla Part 3
Data Management Innovations 2017 High level overview of DB
Database (DB) and Database Management System (DBMS)
“New” things Discussed in London
Kamal Satish M Persistent Systems Pvt. Ltd. Pune
Fabric 1.2 Chaincode namespace _foo_f1_ _foo_f2_ _foo_f3_ _bar_b1_
NoSQL & Document Stores
The Database Environment
NoSQL databases An introduction and comparison between Mongodb and Mysql document store.
Resource Model.
History Database - Typical historical query requirements
The Relational Data Model
CO4301 – Advanced Games Development Week 12 Using Trees
Polyglot Persistence: Document Databases
CMPE/SE 131 Software Engineering March 7 Class Meeting
SPL – PS13 Persistence Layer.
“New” things Discussed in London
Presentation transcript:

Comparison of table-based and JSON-based chaincode Table-based approach Relational database table metaphor Requires schema definition up front Difficult to change schema in later chaincode versions Does not support hierarchical data Not aligned with underlying ledger data layer, therefore metaphor inconsistent with fabric functional capabilities - e.g. Can’t query on table columns as expected More code layers, more complex chaincode JSON-based approach NoSQL metaphor: key/value (LevelDB), document db (CouchDB) Does not require schema definition step Easy to add JSON fields in later chaincode versions Supports hierarchical data Aligned with underlying ledger data layer, therefore metaphor consistent with fabric functional capabilities Query based on key or partial key range Less code, use built-in structure  JSON marshaling Compatible with next-generation ledger capabilities Query ledger on ANY field, within or outside chaincode Powered by JSON state database (CouchDB)

Proposal Remove Table API from Hyperleger Fabric in v1. The v0.5/v0.6 Psuedo-table API does not map well to current or next generation Fabric capabilities Project teams have been confused and frustrated with table API limitations Encourage all new chaincode to use JSON-based data structures Additional query benefits when using CouchDB state database Provide JSON-based samples to help community update table-based chaincode Initial sample: https://github.com/denyeart/table_to_json/blob/master/chaincode/table_to_json_chaincode.go In the future Fabric may add support for relational state databases At that time it will make sense to introduce a ‘real’ table API without the limitations of the current psudo-table API

Side-by-side chaincode comparison of Table approach and JSON approach

Setup Table-based approach JSON-based approach Define schema and persist to ledger Annotate chaincode structures for JSON marhsaling

Add marble Table-based approach JSON-based approach Insert marble row into ledger table Add marble JSON to ledger, use objectType as key namespace

Get marble Table-based approach JSON-based approach Get marble based on key columns Get marble based on compound key

Scenario: Query for blue marbles Enabled in key/value state database by using an intelligent compound key ‘Marbles:color:name’ and doing partial range key query on ‘Marbles:color’ only Table-based approach JSON-based approach GetRows() using first N key columns (left to right) partialCompoundKeyQuery() using first N keys (left to right)

Proposed: New chaincode APIs PutStateJSON() / GetStateJSON() Allow chaincode developer to distinguish between binary blobs and JSON-based ledger variables (rather than auto-detect) PutStateJSONWithAttachments() / GetStateJSONWithAttachments() Store documents on the ledger with queryable JSON header info CreateCompoundKey() Utility function to format compound keys consistently (see next) PartialCompoundKeyQuery() Utility function to assist with partial key queries (makes assumption about compound key format) Add objectType to all Put/Get API signatures, to enforce namespacing of object types within chaincode? Equivalent of ‘tableName’ when using table-based API.