IT Brief New Zealand - Technology news for CIOs & IT decision-makers
Story image
A pinch of blockchain: Partially decentralising an app
Fri, 9th Sep 2022
FYI, this story is more than a year old

A foundation of blockchain is the idea of decentralisation – an area in which many groups are undertaking the most exciting innovations. Decentralised Apps (DApps) are growing in popularity for their ability to leverage both decentralised and centralised architectures.  

A Decentralised App is an app that connects in some way to a blockchain. This doesn’t mean that the entire app is decentralised. Typically, it involves just a small component of the app connecting to the blockchain through a straightforward API (application programming interface). 

In fact, most Decentralised Apps have components that rely on centralised services. For example, they could be storing sensitive information server-side, running computation, or serving front end resources on a centralised server.

It’s rare that apps are completely decentralised. Partial decentralisation, where an app makes use of blockchain functionality for a single aspect of its service, is far more common.
 
To centralise or not to centralise… 

 A case for centralisation

  • Control: Centralisation gives control to the owner of the software or data. There are legal requirements for one entity to be responsible for making particular decisions. 
  • Efficiency in coordination: Centralisation tends to lead to faster decisions, as there is a single entity responsible for decision making.

A case for decentralisation

  • Resilience: Decentralisation means no single point of failure. Once a DApp is deployed, it lives on the network and becomes available to everyone. 
  • Transparency:  All transactions on a decentralised network can be verified by anyone at any time. Easier to build trust between individuals.
  • Data integrity: The data stored on a decentralised network are kept securely forever and can’t be modified. Once the blocks are full, they are locked. 
  • Privacy: No more data monopolists capitalising and owning everyone’s data!

Partially decentralising – the best of both worlds

It is possible to create a modular design where some components are centralised, and some are not. A partially decentralised app allows you to access the benefits of both; though the decentralised aspects will only apply specifically to the data stored on the chain. It means that app services - such as voting, NFT tokenisation or verifiable game transactions, which are easier to execute with a blockchain - can be decentralised while the rest of the apps run on a centralised server. 

Familiarising yourself with decentralised architectures

A decentralised design can make your app more scalable and easier to maintain, meaning that people can work on it from various locations and that the barrier to entry is very low. 

Here are some concepts that are often used in fully or partially decentralised designs. These designs aren’t mutually exclusive and are often used in combination.

1.The Jamstack architecture

Jamstack stands for JavaScript, APIs and Markup. It has a wide range of applications, including e-commerce sites, SaaS applications and personal blogs. 

Jamstack means pre-rendered content is served via a CDN (Content Delivery Network), and the dynamic features are added through APIs. Pre-rendering makes your web apps very fast to load and removes the need for the server to render the page on every request. 

Some popular Jamstack frameworks include Next.js, Hugo, Gatsby, and Jekyll. Jamstack replaces a traditional web stack which typically involves a web server, an app server, a database, and a CMS, with a simpler design. This makes it easier to maintain and scale.

NZ’s largest public blockchain CENNZnet provides a JavaScript API, which can be used to enhance any Jamstack application.
 
2. The serverless architecture

The serverless architecture typically means the server-side logic is in stateless containers triggered by events. This is achieved by using microservices and stateless functions. Cloud services, such as AWS Lambda, Azure Functions, and Google Cloud Functions, will execute your functions by dynamically allocating resources upon the triggering events. This allows the developer to outsource the infrastructure management.

3. Decentralised storage

Decentralised storage such as IPFS (Interplanetary File System) allows you to share data across a decentralised network. This means you can host your DApp in a peer-to-peer distributed network, which makes it more resilient and inexpensive.
IPFS offers several APIs and a command-line interface, so it can easily be integrated into your DApp.

Given the utility of a decentralised space, greater numbers of services are likely to shift to at least a partially decentralised model. 

Leveraging both centralised and decentralised capacities will allow organisations to stay in touch with stock standard methods, while staying on the pulse of new and innovative ones.