REST API, GraphQL, and the Blockchain

Published - 29 Jan, 2018

The Internet is a defining aspect of modern life. It is everywhere from the sprawling metropolis to far-flung areas. It is estimated that in 2017 there were close to 3.8 billion Internet users. That is almost 50% of the total global population. Additionally, there were 4.9 billion mobile users with the majority of it connected online.

With such ubiquity, we’ve come to automatically trust the Internet. Internet users trust different entities from different parts of their lives. Registering and accessing different websites such as social media, emails, and other services entail trust to an entity. Similarly, most financial and civic transactions run through the Internet’s backbone. This requires a certain trust from both customers, institutions, government, and other bodies.

Trust Issues

The Internet’s lifeblood is data. It is mostly from Internet users. The users then trust their data to entities for storage, processing, transfer, and other data processes. Throughout the years, the general Internet population has expressed concern over trusting the Internet.

The prevailing paradigm is quite simple. A user taps into services and products from third-party entities and intermediaries. These entities could be businesses, institutions, government, etc. Using the products and services requires a certain level of trust to these entities. Similarly, these entities trust the users to fulfill their end of the bargain (pay, watch ads, etc.). This relationship between users and entities resemble the existing capitalistic paradigm of our society. Naturally, it influences how we use the Internet.

However, just like transactions in the real world, there is a level of distrust when exchanging goods, money, or data over the Internet. And this is not unreasonable. The Equifax data breach of 2017 alone proves that everyone is right in distrusting the Internet. Several developing technologies aim to improve security over the Internet. Thus, eventually leading to better trust.

REST API – Building Trust

Imagine the Internet as a bunch of “talking” systems. A system can be anything such as your computer, a server, ATM, etc. The communication needs a standard protocol to follow. Having different standards makes the Internet unreliable. This makes it untrustworthy.

The Representational State Transfer API or REST API takes advantage of existing protocols. It uses HTTP when used for web APIs. The protocol creates consistency across different communicating systems. It means developers do not need to install additional software or hardware in order to communicate with other systems. REST can handle multiple calls, data formats, and even structure.

The consistency makes the network of systems more reliable. This makes it easier to trust. The ability systems to communicate without any issues gives the entities using the Internet a peace of mind.

GraphQL – Data Driven Trust

The ever-changing nature of the Internet means it needs a flexible system of communication. REST API is still one of the most popular web API. However, the Internet is becoming increasingly data-driven. Huge amounts of data are being transferred, processed, and stored at any given moment. While REST API can still handle this, a more intuitive system needs to be implemented.

Two of the most common problems with REST API is “over fetching” and “under fetching”. It follows a resource-oriented model. Its “endpoints” are a collection of the data from the system which another system can request. However, these endpoints may lack the data required by the requesting system. This forces multiple requests which slows down data transfer. On the other hand, the endpoints may return too much information. Processing such information will waste efforts and backend power. These scenarios have significant effects on systems handling massive amounts of data.

Enter GraphQL. This data query language was developed internally by Facebook in 2012. It aims to provide an alternative to REST. GraphQL allows requesting systems to define the structure of the data required. Then, the exact structure of data is returned by the server. This allows a good control of what data to transfer. It increases efficiency and reliability. Moreover, it easier to aggregate data from multiple sources without exerting too much effort.

The efficiency of GraphQL opens systems to more possibilities. While it is not apparent to the frontend users, the faster services greatly helps the user experience. Users tend to trust reliable and faster systems more.

Blockchain – Trusting the Community

In hindsight, the Internet still reflects the existing commercial paradigm. Users, intermediaries, and entities still have to “blindly” trust one another to function correctly. There is still a level of uncertainty even with security measures in place. However, a new system turns this system over on its head: the Blockchain.

The blockchain is still the talk of the town thanks to cryptocurrency such as Bitcoin. Many associate the blockchain to exclusively work with cryptocurrency. However, it has applications beyond finance which can encourage people to fully trust the Internet.

What is Blockchain?

The blockchain is basically a list. Cryptography protects a block or a record and contains a hash pointer that links it to the previous block. These blocks now form a chain. Unlike typical storage where data is in a database, a network handles the storage of the chain. This means there’s no one governing body which safeguards the data. The security is built by putting the trust in the community (network). Each member of the community has a “piece” of the chain. Additionally, the blockchain also has different copies in the network. There’s no master copy at all.

Any official changes or addition to the blockchain updates all the copies and sources. That means any unauthorized transaction that is not reflected in other copies or sources is rejected. The redundancy of the data helps maintain data integrity. Only users with the right access level can modify or add to the blockchain with the consensus of the network and different blockchain copies

There are different sources talking about how Bitcoin and other cryptocurrency utilize blockchain effectively. However, blockchain opens a lot of possibilities for a more trustworthy Internet of the future. The speed, integrity, security, and reliability of blockchain make it an attractive solution to just about any system implementation. Medical records, contracts, and even voting systems can be put on the blockchain.

Final Thoughts

The combination of improvements in REST API, GraphQL, and blockchain allows human culture to finally catch up with technology. Trust is still a sensitive topic in real-world commerce. However, with the availability of such innovations, the Internet may finally be able to trust itself.

Have an a great idea for a blog article?
Tell us about it!

Keep up with Booking X

Sign up for our newsletter if you’d like to hear about interesting new features, projects, news or just keep in touch.

No spam or unnecessary emails  – we hate that stuff as much as you do.