Friday, October 30, 2020

Blockchain is useless and I will be happy to be proven wrong

Over last few years I have seen Blockchain technology climb the hype curve and the hype refuses to die down. I've spent countless hours reading about the technology and the potential use cases it can solve. The basic arguments for Blockchain are about Decentralization, Immutability, Traceability and no need of intermediaries for transacting. 

The use cases I hear about are A blockchain of Financial Assets (think of Land Records, Currency, etc.) or a blockchain of records which record the movement through the supply chain etc. 

Now one the fundamental usecase from which blockchain is refactored out is that of bitcoin. As far as I understand blockchain is a distributed ledger with 2 features which make it unique. 

  • It's a consensus based ledger without a central authority. As in if more then 50% of the nodes believe a transaction has happened then it's considered as consensus. 
  • It's an immutable record of transactions, i.e. once the 50+% of people have recorded and validated the transaction. It can't be tampered with anymore. It can only be reverted by doing a compensatory transaction.

Apart from these there are other features like open for all, anyone can participate etc. which are also found in run of the mill technologies.

Blockchain made a lot of sense with bitcoin because, 

  • The bitcoin was a digital asset, which took birth in bitcoin's blockchain and remained in the same ledger from birth.
  • There is no physical asset changing hand and hence the transactions are really tamper proof. 

Now any usecase which people try to solve with blockchain have a few contradictions to the original usage of blockchain. 

  • In most use cases, a central authority (A government or a company) wants to "Own" the blockchain. 
  • In most use cases, the underlying asset is not digital, e.g. food through a supply chain, or land. In such cases, blockchain can't offer any protection as the physical good can easily be tampered with. 

Everything else which is provided by blockchain, e.g. open system of records, immutable records, anytime access etc. can be easily done with cheaper and more efficient technologies which exist in the market. e.g. A digital record of Land Ownership and it's transfer already exists in most countries and there is no reason to move them to blockchain in order to do things like easy access and smart contracts. They can be done in the existing stack for far cheaper costs. 

This is my personal view on blockchain as I struggled through for 5 years to figure out a usecase which fits this tech. This involves speaking to various banks and asset intensive industries.
Everyone wants it due to the hype curve, but no one understands why they need it. I would really be happy to be proven wrong here. Please leave comments to make me understand why I should still care about this technology 

Cheers,
Abhishek

Thursday, July 16, 2020

Using SAP Cloud Connector for Automation

I recently got a. requirement to dockerize and use SAP Cloud Connector for one of the test rigs we have built up internally. 
The idea was to expose a few REST APIs written in a java application through cloud connector. One of the services we write should be able to call this java application through SAP Cloud Connector. 
For the test rig we had to setup a cloud connector and connect to a subaccount automatically. Turns out Cloud Connector has an API which is documented on here.

There is a nice github repository which allows you to Dockerize the Cloud Connector as well.

The challenge is that SAP Cloud Connector has no APIs to do the first time configuration i.e. to change the password for the first time and to set the Installation Mode. 

So here's the hack we did. We did the changes on the running SAP Cloud Connector and found that 2 files are touched by these APIs. Went ahead and made another image which adds the touched files. and Voila.. we have SAP CC Docker image on which we can directly call the APIs and automate the rig. 

The code is available in a fork of the original repository. You can access the fork here

Happy Coding, 

Abhishek

Thursday, June 11, 2020

Quick Hack to debug your docker image in cloudfoundry

I am trying to make a docker image bind with the kafka service on SAP's Cloudfoundry Platform. The kafka on SCP works on SASL authentication, and needs some configuration. 
Now the docker image has a start command which directly launches my process which binds to the Kafka Service, tries to connect to Kafka Cluster and fails because of some misconfiguration. 
It's almost impossible to try the configuration, unless I change the environment and then push the image to my repository, and then push the image from repository to cloudfoundry. 
Too Painful. 
So a quick hack to solve the problem is to change the startup command of my docker image to 

CMD tail -f /dev/null

And change the health check type in manifest to none. 

Push the image back in CF and ssh into it, to fiddle with the environment as many times as you like :). 

Happy Coding!!

Abhishek