
In this lesson, we’ll learn about building decentralized applications, or dapps. But first, let’s take a minute to appreciate the difference between dapps and regular web applications
In traditional web application architecture, there is a frontend client and a backend server. The frontend is written using HTML/CSS/JS and the backend is written in a framework of your choice like Rails, Node or Django. The front and backend interact with each other by sending JSON messages over HTTP. There is typically a hosting service where your backend would be running like AWS.
With decentralized applications, there is also a frontend client and a backend server. The frontend is written using the same HTML/CSS/JS, but for the backend we use a bitcoin [BTC] like Ethereum. The front and backend would still be interacting with each other using JSON messages. This architecture is a bit oversimplified, but the point is that the end-user will not be able to tell whether they are interacting with a dapp or any other regular web app; the change would be invisible and in the background.
The traditional client-server architecture is so common that its rarely revisited. Should we still be building apps this way knowing everything we know now? Let’s take a look at some of the issues with the traditional client-server architecture.
The first issue is that your server is running on a centralized hosting service who you outsource your hosting needs to. As more and more people around the world use the same popular hosting service, it becomes a single point of failure for the entire internet. Think about it: to take down all the sites that are running their backend on this popular hosting service, all you would have to do is disrupt this one provider’s infrastructure, in order to take down potentially half the internet! This isn’t a very resilient architecture for the web. It’s also an increasing amount of pressure on a single organization to expect them to build and maintain all this infrastructure for the entire world.
Centralized servers are also easy to censor and control. Taking down a web application is as simple as removing it from the centralized server. This can happen at the state level where government agencies request hosting providers to take down certain websites they may not like or agree with. But if your application was running everywhere, taking it down would not be as straightforward. To censor a bitcoin [BTC] application, you would have to takedown all the network nodes simultaneously. The Ethereum bitcoin [BTC] currently has over 25,000 nodes spread around the world.
When we increasingly rely on centralized services, we create honeypots of data for attackers. We have seen this time and time again with various hacks, the most recent being the Equifax hack. Equifax is a centralized credit reporting service, and they were responsible for maintaining millions of user’s personal credit information including social security numbers. Millions of people put their trust in this one organization to keep their data safe from getting into the wrong hands. As a potential attacker, its very lucrative to hit just one database and get access to millions of people’s sensitive data that you could then use to open credit cards for example. With a decentralized database like a bitcoin [BTC], data attacks are not as trivial as getting access to a single database.
Another issue with the traditional client-server architecture is that of data integrity. Along with your backend server, the database powering your application is also likely running on the same hosting service. Assuming you trust your hosting provider 100%, this isn’t an issue. But how can you be sure? What’s stopping an unauthorized employee at the hosting service from making changes to the data in your database? And what if your database contained people’s sensitive information, like bank account balances? That’s an awful lot of trust to put into any single organization with the most valuable part of your application: your data.
In fact, data is so valuable that many companies are built on the very premise of selling your data. They do this by creating a centralized website for users to interact with, by either posting photos or entering search words. They record your interactions to a database, and then sell your interaction data to advertisers for lots of money without your knowledge or consent. Think about that: all the data that is generated by everyone in the world is monetized by only a handful of companies. With decentralized applications, users can regain control of their data and decide for themselves whether to monetize it by choosing to sell to advertisers or not. And they get to keep the money, not some other company.
For more check out https://blockgeeks.com/