There’s no denying that whilst Bitcoin’s future may be hazy right now, the underlying technology it relies upon — the Blockchain — has revolutionized many industries and projects, with more to come.
Ascribe is a fascinating startup that uses Bitcoin’s Blockchain to record a limited quantity of unique references to digital artworks. Thus making them traceable, accountable and (hopefully) more valuable, due to this finite amount of ‘copies’.
Ascribe hit technological problems with this approach, and those problems were primarily due to Bitcoin’s Blockchain itself. Writing everything to it is slow, costly (currently 80c each time) and has a maximum number of daily entries and total capacity for writes. It’s also counter to typical scalable database technologies, adding nodes doesn’t improve performance and has no real query language. This makes scaling a business that relies upon the Bitcoin Blockchain a challenge.
But the Blockchain concept is a strong one and the past years have seen an increasing rise in usage and legitimacy, with even major banks announcing development of technologies inspired by the concept.
Ascribe decided to combine the best of both worlds, taking a proven NoSQL database (RethinkDB) and adding a Blockchain layer on top to add control, asset tracking and an additional level of security.
This combination of technologies is especially interesting to NoSQL database users, as traditionally, few of them support ‘transactions’ that help guarantee a database change has taken place. By writing to an underlying NoSQL database via a Blockchain layer, BigchainDB adds transactional support.
Thanks to the Blockchain layer, BigChainDB also claims to be fully decentralized. Whilst many distributed NoSQL databases claim this, there is often a pseudo master/slave setup.
Installing BigChainDB and Dependencies
There are couple of ways to install BigChainDB. First I tried the Docker images, but ran into some connection issues, finding the Python packages most reliable.
- Install RethinkDB, for other Mac users, there is also a Homebrew package available.
- Install Python 3.4+.
- Install BigChainDB with Pip -
sudo pip install bigchaindb - Start RethinkDB with
rethinkdb - Start BigChainDB with
bigchaindb startwhich will also configure things for you. - Open the BigChainDB (actually the RethinkDB UI) admin UI at
http://SERVER_IP:58080/
Simple Example - Message Allocation and Tracking
One of BigchainDB’s prime use cases (and why Ascribe created it), is for tracking assets, so let’s make a simple example in Python.
[code language="bash"]
pip install bigchaindb
bigchaindb configure
bigchaindb show-config
[/code]
Create a new file, app.py and add the following:
[code language="python"]
from bigchaindb import Bigchain
b = Bigchain()
print(b)
[/code]
This imports the bigchaindb library, creates a new object and connects to it with the settings file just created.
Then run the Python application:
[code language="bash"]
python app.py
[/code]
Continue reading %Managing Data Storage with Blockchain and BigchainDB%
by Chris Ward via SitePoint
No comments:
Post a Comment