edicted Blog Banner

edicted

POB Part 4: Graphene vs Condenser + Databases

enterprisedatabases1.png

I've been planning to write this post for weeks now, but it was only until just now when I searched Google images that I felt like I new exactly what Graphene and Condenser are. Unsurprisingly, because developers are notoriously unimaginative in a lot of ways, Condenser and Graphene are largely self-explanatory.

Very meta.

To get an idea of what I'm talking about just look at the sad names of so many of the dapps that have been built on top of Graphene and elsewhere. Steem-this and D-that. EOS-this Thereum-that. Crypto-this and Blockchain-that.

https://files.peakd.com/file/peakd-hive/edicted/5H6qOVsa-Data-Mining.jpg

So disruptive, bro!

  • EOS Knights
  • CryptoKitties
  • Lothereum
  • EOS Dynasty
  • Decentraland
  • EOS Racing
  • dPoll
  • Crypto Sword & Magic
  • Dlease
  • Dlive
  • Blockchain Cuties
  • Steempeak (Peakd much better)
  • SteemMonsters (Splinterlands obviously better)

Seriously, it's embarrassing!

Yet we continue to shamefully use these ridiculous self-explanatory naming conventions for branding and marketing like they are pieces of code. If anything this gives me a new idea: create a dapp that pays people to think of names, icons, slogans, and other marketing strategies that aren't absolute garbage...

And I will call this dapp...

"DAPPNAMER"

Fuck I'm a genius!

Just kidding.

How meta would it be to name the dapp using the dapp itself?

Wow, now I'm getting somewhere.

So off topic right now!

blackhole.jpg

Okay!

So like I said, I actually feel like I learned more about what Graphene and Condenser are just by looking at actual pictures of physical graphene and condensers. Isn't that crazy? I thought it was pretty neat actually, in a super nerdy kinda way.

Graphene is an allotrope of carbon in the form of a single layer of atoms in a two-dimensional hexagonal lattice in which one atom forms each vertex. It is the basic structural element of other allotropes, including graphite, charcoal, carbon nanotubes and fullerenes.

graphene.jpg
https://files.peakd.com/file/peakd-hive/edicted/PucdZelp-graphene2.png

Well shit!

Are you tellin' me that the physical product of Graphene actually ties into what the digital technology actually does as well? Interesting.

In addition, I always kinda wondered why we picked the name Hive without any kind of discussion. Now that I see these carbon hexagon sheets that mimic the hexagons of beehive honeycomb, it all really starts coming together. The name Hive actually connects logistically to the name Graphene, while the name Steem was a hunk of shit that everyone confused with Steam Gaming and Steemit was a pathetic ripoff of Reddit.

STINC indeed!

Honestly when I first got here I was wondering why all these names were floating around. Why did they make it so complicated? Steem, Steemit, Graphene, AND Condenser?

Why?!!?

Why didn't they just call it Steem and leave it at that?

automation.jpg

Clearly, there are many many reasons why it wasn't just called Steem. First, and most importantly, Steem is essentially a fork/clone of Bitshares. The technology that powered Bitshares (Graphene) was used to also power Steem. Because Bitshares and Steem are obviously completely separate blockchains, communities, and distributions, of course they can not be called the same thing.

graphene3.jpeg

Graphene

We can think of Graphene as the absolute core of the blockchain. It is a sprawling set of chaotic information (blocks) all connected together just like the carbon bonds of actual graphene (perhaps a bit more linear rather than a 2-dimensional sheet). Essentially, Graphene is simply a big clump of extremely unorganized information.

This would include all the blocks and raw data, our encryption/security, and perhaps some of the consensus layer.

However, no one can come to consensus without Consenser.

condenserconsolidate.jpg

Condenser

As the name implies, condenser condenses the information into a database that turns all that otherwise useless random block information into something with a lot more utility. I couldn't search for "condenser" in Google images (because of water condensation) so I used the synonym "consolidate" instead.

condenserconsolidate2.jpg

Condenser consolidates all the blocks into the information used to come to consensus. How would we know how much money was in an account unless we had the entire history of the blockchain logged in a database? Simple answer: we wouldn't. Condenser is that database.

At first I thought Condenser was just the Steemit.com frontend but it is clearly much more than that. Without it nodes would not even be able to talk to each other and nothing would work. Not only is the default frontend called Condenser, but also our entire database and even our node API is also Condenser.

filter.jpg

These are important distinctions for what comes next.

Because unfortunately Condenser is an overbloated hunk of shit. I really wish I could find the few times that I was talking shit about Condenser (back then I thought the API was separate from Condenser) and I had Ned on my blog trying to defend that it wasn't garbage. For god sake, we don't even overtly tell devs the block number of a block (it is hidden in the first 8 digits of the hexadecimal block_id)

So many parts of Condenser are embarrassingly pathetic!

Why is this?

bandwidthtech.jpg

Well, for starters...

Like I said earlier, Graphene is a badass technology that powers Bitshares, Steem, Hive, and EOS. Because of this, all the mistakes that were made during the birth of Bitshares were corrected long before Steem even existed. Modular code is the best code, and Graphene's code has been battle tested across four different networks and counting.

Also, when an improvement to Graphene is made by any one of these four communities, all of the communities would benefit and could basically upgrade their foundation for free using the open-source work that was published.

Condenser is not so lucky

Condenser was designed specifically in mind for Steem/Hive. It is not compatible with anything else. A lot less time was spent on its rushed development to get Steem up and running ASAP. Once Steem was up and running, no one decided to go back and fix the hunk of shit that is Condenser, everyone moved on to the 24 other hardforks that came next and promised technologies that still haven't been released like SMT. It's probably a good time to note that our documentation is hammered dog shit and it can be very difficult to get things working or to debug code because everyone rushed forward and left behind a jumbled mess.

matrix bits bytes programming.png

Where are you going with this?

Condenser is so bad and bloated with terrible documentation that it might be smart to completely gut the project and streamline it or start over altogether with a new database that parses the information from Graphene. I'm seriously considering building something of my own just to practice my database skills without having to navigate that clusterfuck.

The foundation of every dapp I want to build here essentially is going to require a database that parses block information. I either have to start from scratch or work with what I have. Let me tell you, what we have to work with is not great. Blockchains are always in constant need of more devs during these early stages.

https://files.peakd.com/file/peakd-hive/edicted/96oWfCuP-Fully-connected_mesh_network.png

This ties all the way back to Part 1: Distributed Proxy Nodes. I think the smartest thing to do going forward is to create a non-consensus database that parses block information for specific dapplications native to the Hive/Steem blockchain. What this means is that anyone could download this database and start pumping raw block information into it, and it would use the information available to give the user any relevant information.

In the context of custom trending tabs and personalized feeds, only the most recent 7 days worth of blocks would be needed to fully populate these web pages locally without access to any node because all the work is being done right on your own device. You are your own node (proxy).

When combined with a reputation system, this database could get very interesting, as your browsing experience of the blockchain would be completely unique due to the unique seed of the custom reputations that have been assigned to individual users.

In my next post I'll be talking about strategies for gathering these raw blocks from the Internet in a secure fashion to populate the custom local database as well as why this process may be quite critical to scale Hive into the future.


Return from POB Part 4: Graphene vs Condenser + Databases to edicted's Web3 Blog

POB Part 4: Graphene vs Condenser + Databases was published on and last updated on 11 Jun 2020.