Introduction
According to Wikipedia:
Blockchain is a distributed ledger with growing lists of records (blocks) that are securely linked together via cryptographic hashes.
But, when the first time I read this explanation, I still didn’t get it. So, lemme explain in a way that (hopefully) Web2 Dev is understand.
Blockchain is a (Distributed) Database
Yeah, to put it simply, blockchain is some kind of database, that hold/contain any data information.
I’m sure that you are already familiar with PostgreSQL, MySQL or even MongoDB (Let’s call all of this as Web2 Databases), right? So does Blockchain. What make it difference is the architecture, behavior and traits behind it. Let me break it down to you in a second.
1. Structures: Tables vs Chain of Blocks
In Web2 Databases, the structure of database is organized into tables consisting of rows and columns.
[input diagram of web2 databases structures]
But in Blockchain, the structures is different. It represented the data as a sequential-chain-of-blocks.
[input diagram of blockchain databases structures]
Blocks here are is the row in Web2 Databases, which is a single piece of data or information that we will hold, with some other standard field (the default columns we could say, such as Timestamp, Hash, Previous Hash). We will talk more about this standard fields in the future (or in a second if I’m on fire).
2. Mutability vs Immutability
We already know, In Web2 Databases, the record of data is mutable, which mean we can add, edit, deleted (of course we can avoid that with set the user permission on db level, but let’s do not count that for the sake of simplicity here).
And in Blockchain, we can’t mutate the blocks! Instead, we can only append the blocks. Hold on! I know you may have another question regarding to this such as:
So how if we want to update some data inside specific block?
But, let’s keep it inside your head first. I’ll give you explanation later.