The central issue with decentralized applications

In its rawest form, a decentralized application is any app that runs on a connected network of compute resources, but our modern notion of decentralized applications (or DApps) is one where apps run on a peer-to-peer (P2P) network of computers, often now under the purview of a blockchain -- so how will these technologies work in practice, when attempting to exchange data for working applications?

Binary streams across a row of computer displays.
Loops7 / Getty Images

Software applications used to come on a disk. Many of us will remember the days of the DVD-ROM, the various sizes of floppy disk (and diskettes) that we lived with through the latter part of the last century, or even the 'Scotch' tapes that preceded those devices.

Of course, even these software delivery techniques had even earlier precursors i.e. we know magnetic tape first appeared in 1951 and DEC (as in Digital Equipment Corporation) of course lent its name to DECtape not long after.

But this story is not about storage, this is a question about the 'shape' of applications today, which - in their increasingly decentralized form - would be hard if not impossible to engineer across any networked spaghetti tree of archaic data storage systems.

P2P purview for decentralized applications

As we know, today's applications are eminently decentralized and occasionally (but more often frequently) connected to the web, the cloud and other application services.

In its rawest form, a decentralized application is any app that runs on a connected network of compute resources, but our modern notion of decentralized applications (or DApps) is one where apps run on a peer-to-peer (P2P) network of computers, often now under the purview of a blockchain rather than any single organization or authority.

Some of the challenges that throw themselves up in the decentralized application world gravitate around how the backend code is managed, as it needs to run on a decentralized peer-to-peer network rather than any single more centralized server, or server estate.

But the core hosting, management, maintenance and augmentation of backend code may not be the toughest part of the DApp equation. What can present more of a challenge is engineering the threading paths between applications so that data can be shared, exchanged and interconnected to make these more ephemeral applications work properly.

The answer is written in the graphs

Could the answer lie in graph theory? We know that a graph database is an assortment of interconnected circles (nodes) that can represent a person, a product, a place or a thing in any given defined data universe. The relationships between different nodes are known as edges, which can be given different 'weighting' and strength depending on their role.

This same level of interconnectivity intelligence is being applied by The Graph Foundation (the name is no coincidence, hence the graph database reference) to build its vision for a decentralized internet and a booming crypto economy.

The decentralized cloud headquartered foundation (many of its people do live on Earth, in San Francisco and throughout the US) manifests itself in various forms, one of which is The Graph Network, a productization vehicle that now offers the grandly named 'mainnet', a global searchable index of data from blockchains. In terms of use, mainnet is supposed to allow software application developers to search, find, publish and use the public data they need to build decentralized applications.

The question most of us would be asking now (hopefully) is how does it do what it does? The Graph Network team explains that they expand the accessibility of decentralized applications through public and open Application Programming Interfaces (APIs), called subgraphs. 

The central concept behind the freedom of this technology is the ability to build a network of open, global APIs that is free from the hands of big technology vendors. The network itself has been built over the last three years and its operations team say that it now averages over 350 million queries per day.

From web 2.0 to web 3.0

"After years of hard work, our vision for a global decentralized indexing and API layer for web 3.0 has become real. We really believe in decentralization and [technology that will] enable humans to cooperate and organize in a decentralized way," said project lead and co-founder of The Graph, Yaniv Tal.

Tal notes that The Graph is already being used by many projects in DeFi (decentralized finance) and the still-nascent arena of so-called web 3.0 as it develops. He explains that APIs and the general drive to improve and standardize how applications talk to each other were a huge reason for the growth of web 2.0 over the last decade, but now, we are moving towards a web 3.0 future.

Before this type of technology existed, developers had to build complex and expensive IT infrastructures if they wanted to access the useful data they needed. It hindered the growth of the decentralized internet by adding cost and time to development. Perhaps more problematically, it was centralized on servers run by the big cloud giants.

"It's exciting to see that The Graph is developing a modern implementation of Tim Berners-Lee's vision of the Semantic Web and Linked Open Data to take the web back to its decentralized roots. There is tremendous value in bringing data together and making it easily accessible," said Matthias Broecheler, chief technologist at open source database company DataStax.

As already noted, developers can use an open API subgraph, to query essential data streams. So as an example use case in a DeFi project, developers can use a subgraph to query data on trading volume or other important data vectors.

Some of the biggest blockchain projects use The Graph's current service including Uniswap, AAVE, Decentraland, Synthetix, Coin Market Cap, Aragon, Chainlink and CoinGecko. All applications and projects on the current service will now be able to migrate over to the decentralized network. In terms of the human roles involved, the Graph Network is made up of Indexers, Curators, Delegators and Consumers.

"Data that is on the blockchain is generally 'there' and accessible for applications running on these blockchains (as they're public blockchains). There is, however, a huge issue in accessing the data that (a) you really need and (b) getting that access in a simple and convenient way. This can be very cumbersome, as data structures on blockchains haven't necessarily been designed to be queried for huge amounts of data with low effort, conveniently," said Adrian Krion, founder and managing director of Spielworks, a company seeking to bring the benefits of blockchain to mass-market gaming.

Having a source of structured and indexed data that you can use from within decentralized applications appears to make sense. It basically gives DApp developers the convenience of accessing data without having to think about the abstractions for doing so.

Krion says that this is something that has been tremendously successful in traditional (web) development as well – Object-Relational-Mappers (ORM) have allowed for convenient data operations on objects within the object-oriented programming world, while the underlying data structures in databases have remained relational. He reminds us that each architectural layer of DApps will, in case there is a difference in terms of how one develops on the platform as compared to traditional development, eventually be enriched by such abstractions like The Graph.

"We've seen this with authentication (web 3.0), the handling of nodes (see Infura et al.), decentralized oracles (Chainlink, etc.) and now structure and access to on-chain data with The Graph. Not all of these solutions require their own protocol or commercial solution, but in order to get to Enterprise-readiness with the applications running on top of blockchain networks and processing billions of dollars of value everyone really wants these kinds of reliable technology providers that have proven to work and scale."

The Graph will allow for decentralized applications with no need for centralized infrastructure. There will be a phased approach in migrating subgraphs from the hosted service to the decentralized network. Initially, only subgraphs on the Ethereum mainnet were supported on the decentralized network. Subsequently, FS (Filecoin) and POA became usable and as of February 2021 Polkadot, Solana, NEAR and Celo will also be usable.

This approach could form an important part of the way we architect future web-based applications, connected web services and the wider web itself. The impact of graph technologies in the database space is already significant, it will be interesting to chart this graph as it now arcs forward.