Blockchain as a Backend: Pros, Cons and a Use Case - Zentasktic

in blockchain •  8 years ago 


ZenTasktic is a real-time, collaborative task management app I wrote last year, first as an exercise to learn AngularJS and Firebase, and second as an improvement of my own productivity framework, Assess-Decide-Do. If you want to know more about the status of ZenTasktic, you can follow @zentasktic here on Steemit.

The first app I wrote implementing this framework, iAdd (which you can get for free from AppStore, if you don’t mind some ads, or buy the full version for just $0.99 if you don’t want ads) is still solid, although I coded it more than 5 years ago. I still use it every day, but I sometimes want to manage my tasks everywhere, on any device, not only on my iPhone. So I wanted a web app, maybe a desktop app and a mobile app. AngularJs with the Firebase backend is probably the best technical solution I can find right now, for this specific use case.

Last year in October I also joined Steemit and I was instantly hooked. During the last few months I studied the ins and outs of the Steem blockchain, first by becoming a witness and second by testing various libraries and studying the source code of other apps written on top of it. I should mention here the excellent pysteem, written by @xeroc and steemjs-lib by @svk. The more I learned about the technology, the more I wanted to somehow use it in ZenTasktic.

But the more I learned, the more I realized there are a some very important differences between the Steem blockchain and Firebase, especially if you want to use them both as backends for a data-driven app. What follows is a short recap of my findings and a couple of scenarios integrating the current form of ZenTasktic with the current Steem blockchain.

Firebase versus Steemit Blockchain

I should start with the fact that both services are consumable via web sockets. Steem also has, on top of this (or along with this), a p2p communication channel, but that’s not something a client can normally use, that “channel” is intended for communication between nodes, exclusively.

But web sockets is the only common thing for Firebase and Steem. From this point on, the differences are very significant.

1.Real-time storage of arbitrary data versus transactional information

Firebase is an application server letting you store and retrieve arbitrary data in real time. Steem is a transaction log which stores financial operations (distribution, transfers) and text organized in a blog-like structure. Both are storing relatively small amounts of data, which are, in fact, JSON encoded strings. Steem has a block production time of 3 seconds, which means the maximum amount of time between the broadcast of a transaction and its result is 3 seconds.

2. Single point of failure versus no downtime

In Firebase data is stored in a tree-like database, which, in case of a hardware failure, is becoming inaccessible. Steemit, on the other side, can continue to respond to queries even if a node fails.

3. Censorship vulnerable versus censorship resistant

Firebase is owned and operated by a separated entity, Google (or Alphabet, if you prefer) while Steemit is owned and operated by an independent network of witnesses and stakeholders. That makes Steemit more resistant to censorship than Firebase. The boundaries are still fuzzy between Steem Inc and the Steem Power holders and there are few aspects which are still unclear, but we can accept the censorship resistance of Steemit as being at least plausible.

4. POE (proof of existence) versus IED (infinitely editable data)

The transactional nature of the blockchain guarantees that a certain event took place at a certain time and it was signed by the keys of a certain account. On Firebase, the data can be indefinitely edited by design, making the ownership of it difficult to establish.

Steemit Blockchain versus Firebase: Use Cases

A blockchain may be useful in cases where:

  • you want high availability (no downtime)
  • need to present solid proof existence
  • want to publish censorship resistant information (although in a DPOS management system, some censorship may appear).

Firebase can be useful in cases where

  • you don’t mind about the potential downtime (although this downtime is highly unlikely, it's still possible),
  • you want very fast access to small sets of data which they don’t need to prove anything in the long run
  • the risk of being censored is mitigable

In conclusion, if / when Steemit will be as reliable as Firebase for real-time storing and retrieving of small sets of data, then it will represent a very serious competitor for this technology. The benefits of having no downtime, being censorship resistant (to a certain degree) and having access to immutable historical data, all these features are simply too big and they will tilt the balance in the long run.

How does a task manager can use the Steem Blockchain?

As of right now, storing and retrieving data in real-time using Firebase is simply too affordable not to use it. So I chose to store the actual tasks in Firebase. But there are still some features in the blockchain that may be useful even if we store the data somewhere else. In my opinion, these are

  • immutability of the data,
  • the social experience (the network is already there)
  • access to instant payments (the currency is already there)
  • no downtime

In order to take advantage of them, ZenTasktic could add a social layer to its task management layer.

Bare Social Scenario:

In the private ZenTasktic app, the user adds a new task, in the Assess realm. Because he wants to take advantage of the blockchain, he also chooses to publish the task on the Steemit blockchain, announcing publicly that he is assessing a certain topic.

“I wonder if I should / could / want to do this” - would be title of the article, and the body will be the actual task: “set up a new 30 days challenge on Steemit and ask for feedback”.

From the moment the article gets published, that piece of info will be available for ever in the blockchain. Even more, the social component of the Steemit network will help in the assessment process. People may comment, give suggestions, ideas, criticism, feedback.

When the task is fully assessed and the user wants to set up a due date and a context for the task (in other words, when he actually decide to do the task) he sends the task from Assess to Decide, in the private ZenTasktic app. At the same time, he publishes a new article on the blockchain, announcing the due date and the context. The title will be something like: “I’m planning to do this…” and the body will be the body of the task, the context and the due date. People following him will know now that he wants to do that at a certain time, maybe will give more suggestions, maybe will want to offer support and so on.

When he is ready to do it, he moves it from Decide to Do, while publishing another short article on the blockchain, following the same template.

And when he crosses of the task from the list, he published another article: “I just did this”.

The main advantages of this bare social scenario are: accountability and feedback. And we get them for free. Not too shabby.

Complex Social Scenario

Now, imagine the same workflow, but with two more ingredients: a team (with whom you can share tasks), and a real currency (with which you can pay the team members if / when they finish those tasks). Or with which you can get paid if you finish a task shared by somebody else.

Sharing tasks will be instant (and you have the choice to make it public or private) and so will be the payment.

In this scenario I think the benefits are significantly bigger. At the moment this is just my opinion, but I’m very curious to test this assumption.

The only thing that prevents ZenTasktic now from being completely blockchain-based is the storage and retrieval of the data. But I think that even this can be addressed, if we refactor some parts of the app a bit and implement a solid workflow. I’m prototyping a simple workflow and I already tested a few transactions. It definitely can be done, but it will take out the “real-time” part from the description of the app.

If there is a relevant amount of value created by the other features (the social, collaborative part and the access to an instant payment system) I think we can drop the "real-time" part from ZenTakstic for now and wait until the Steemit blockchain will be able to support this as well.

image source - Pixabay


I'm a serial entrepreneur, blogger and ultrarunner. You can find me mainly on my blog at Dragos Roua where I write about productivity, business, relationships and running. Here on Steemit you may stay updated by following me @dragosroua.


Dragos Roua


You can also vote for me as a Steemit witness here:
https://steemit.com/~witnesses

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Ok. Now I have finished of reading this article. I will read the Part II in a while.

I encourage you to try your ideas. Also, if adding the blockchain capability could make it less realtime-y, then you could keep using Firebase and just add the social component as a bonus.

Three seconds are not too much and, if the task itself is updated in realtime in Firebase, I think that user will not realize that the social part lags a little bit.

Even better: do the blockchain transaction first and, while it is being transacted, do the Firebase stuff. Then there will be less wait for the user.

Of course, just a suggestion!

Yes, I think I will at least make a minimum viable product using the blockchain, not necessarily on the main branch of the app, probably a stripped down version. I already made a test with social integration today, and it looks good. If you want to stay updated, you can follow the @zentasktic account here on Steemit, I will post the updates mainly on that account.

Thanks for the feedback, appreciate it! :)

Hi, @dragosroua. Could you please define DPOS, please? Thank you.

Delegated Proof of Stake (DPOS) means the blockchain network is maintained by a small group of operators. Each operator is elected by votes from the members of the community and controls a part of the network according to his stake in it. Their main task is to be sure that no transaction is lost and that the blocks are produced according to the specs. Blocks are containing transactions (money transfers, blog posts or comments like this one). For the fact that they are maintaining the network, they are paid, also according to the stake they have in the network.

In other systems, like Bitcoin, the network integrity is maintained by Proof of Work, or mining. In exchange of this service, mining farm operators are paid directly in Bitcoin when they produce a block.

In Steemit, these operators are called witnesses and their main task is to produce a block every 3 seconds. Each minute, the first 19 witnesses are getting each a block to be produced, and one runner-up witness also gets the remaining block, by rotation. In the current implementation there is also a block allocated to the miners each minute, but that will change in future implementations.

Hope it makes more sense now. If you have questions, go ahead!

Your answer was perfect. Thank you again, Dragos.

I upvote this because it is useful for anyone interested in Steem.

Thank you, glad it helped :)