ELI5 - Why SurrealDB, explained through building with LEGO

Mon, 15 Apr 2024 00:00:00 GMT
community, tutorials

Can databases inspire a sense of child-like play?
-------------------------------------------------

Some people might take offence at that question because of the belief that of course databases are supposed to be the pinnacle of boring technology #justusepostgres

While we are all aware of the benefits of boring technology—nobody wants to be on call at 4 AM firefighting database downtime—what about the work you’ll do 99% of the time?

That’s when there is an opportunity to make your life significantly less boring while getting more work done because [“work made fun gets done”](https://hbr.org/2022/05/why-work-should-be-fun), and what’s more fun than child-like play?

I therefore invite you to take off your “jaded adult” hat for a moment and channel that inner child energy. The energy you get from the love of building things, no roadmap, no managers, just pure building bliss!

When you read that last sentence, what image did you have in mind?

For me, when I’m picturing just pure building bliss, I’m immediately transported to my grandmother’s living room as a child. I’m sitting on the floor with my friends, with random Lego bricks all around, and we’re just putting that child-like imagination to full use making up stories and building as we go!

Then it happens!
----------------

Our building goes from pure bliss to frustration and frantic searching… the random LEGO pieces stop fitting together… but the story must go on, so we search and search through the pile of random LEGO bricks all over the floor and… it’s worse than we thought! We’re missing some pieces we needed to complete our masterpiece!

What do you think comes next?

Of course, it’s persuading the adults to buy more LEGO sets!

This obviously doesn’t always work, and even if it works it can take a lot of time to get the new set…

Do we then just leave our masterpiece unfinished and do something else because the adults ruined everything… or do we accept their suggestion to “Just use what you have” and ruin it ourselves by forcing random pieces to fit together?

As an adult that might not seem like a big deal, you don’t have infinite money and your child has a lot of LEGO sets already. But as kids we’re now upset, maybe even crying because the adults refused to let us get the LEGO sets which we obviously need!

When play becomes work
----------------------

Now you might be thinking, cool story bro, but what has this got to do with SurrealDB?

Quite a lot, actually. See if you notice any similarities in the mindset we had as children with the one we have as adults working on databases.

We started building full of excitement and made great progress until we realised we needed more LEGO sets to finish our masterpiece. After a lot of searching, we told the adults what we needed to complete our masterpiece and they told us no, use what you have, which left us with a difficult choice.

We therefore learn that we often have to compromise our vision. We learn to be careful when we’re starting something because we might end up disappointed. We learn to expect the adults to say no, so why even ask?

But most of all, we learn that starting things is play but finishing things is work.

Because at the start, we have all the LEGO pieces we need, and we can just be in builder mode, building as fast as we can think!

…until the LEGO pieces run out or stop fitting together and we’re now kicked out of builder mode and are forced into _compromise mode_. We go from being full of excitement to being full of anxiety. Because our thoughts go from imagining what else we can build, to imagining what compromises we need to make and the potential conflicts that might cause.

Play has now become work.

But it doesn’t have to be this way!

It’s hard to compete with someone having fun
--------------------------------------------

At SurrealDB we’re pushing the boundaries of what databases can or even should do, all so that you can spend as much time as possible having fun in the builder mode and as little time as possible in the anxiety-inducing _compromise mode_.

We’ve looked at all the various LEGO sets that builders end up needing and created [the one LEGO set to rule them all!](https://www.lego.com/en-gb/aboutus/news/2023/february/lego-icons-the-lord-of-the-rings-rivendell) …or in other words, [the ultimate multi-model database!](https://surrealdb.com/)

The one LEGO set makes it easy for you to start building and, more importantly, keep building without getting stuck searching for missing pieces, asking adults (managers) to buy more pieces or hoping all the random free pieces fit together. [We’ve already made sure everything fits together so that you can have fun building!](https://www.youtube.com/watch?v=kHnn1XTnZCk)

This journey to remove as much friction as possible from the building process has resulted in a ton of technological innovation, which we’ll cover more seriously in another blog post.

The key message here is that work made fun gets done and we make databases fun to play around with!

“Work made fun gets done” isn’t just some meaningless slogan either, but backed up with science. As the [“marshmallow problem”](https://www.ted.com/talks/tom_wujec_build_a_tower_build_a_team) demonstrates, kindergarten students having fun consistently outperformed well-educated adults in this well-known challenge to build a structure of dry spaghetti, one yard of tape and a marshmallow. It turns out that it’s hard to compete with someone who is having fun!

The key lesson from the challenge was about prototyping and iterating quickly, and what is prototyping if not playing around? There is a lot to be learned from child-like play!

I would therefore encourage you to [play around with SurrealDB and have some fun!](https://www.youtube.com/watch?v=p2BXDus7yvc)