Live data from Hacker News

Never write a database, even if you want to, even if you think you should

twitter.com

21–30 of 56 posts

Re: Never write a database, even if you want to, even if you think you should

#23
post #15

Of course, in production, it is really hard to find a use case that isn’t served ‘well enough’ by existing database technology. But: almost ever should you say never. What better way to learn indexing tradeoffs than to write your own database? What existed before Redis? What existed before LevelDB? What existed before Git? Sure, write a database if you want. But be humble about the effort involved and reliability you…

BerkeleyDB existed before Redis, LevelDB, and Git and was widely used as a database. SVN originally used BDB as its storage layer (but switched when people complained it was too hard to build BDB). https://en.wikipedia.org/wiki/Berkeley_DB contains people-decades of hard-won experience on how to build a simple database system. I would consider SQLite, itself 20+ years old now, the intellectual heir of BDB.

It was as true then as it was today: very few people should write databases for production.

Re: Never write a database, even if you want to, even if you think you should

#24
My hope is that managed data layers become more available and the problem space of "custom data structures and indexes" can be decoupled from the even harder parts of writing a database.

Projects like pgrx (postgres extensions in rust) are starting to make it much more approachable to do so.

A little lower level: build on FoundationDB. (Projects like mvsqlite are super interesting here).

In both cases, we don't yet have fully managed providers. RDS seems to be flirting with opening up the extension ecosystem with trusted languages. I haven't seen any managed foundationdb offerings though.

Re: Never write a database, even if you want to, even if you think you should

#25
post #20
post #13

Earlier quoted context omitted.

I don't think most people would disagree with that. If you want to build a database, for curiosity, or to solve a particular problem, or just because it seems fun, go ahead. But know that making a real production database tends to be harder than it looks, and so tends to be all-consuming, and a team that depends on a custom database tends to become a database team rather than an anything else team. That could be the…

> But know that making a real production database tends to be harder than it looks, and so tends to be all-consuming, and a team that depends on a custom database tends to become a database team rather than an anything else team. The original statement does not include any caveat or constraint, and is an absolute statement that does not depend on specifics. The statement is not "Never write a custom database as a sub…

The tweet doesn’t but the context of the tweet is a conversation about building a custom database to power a business.

Re: Never write a database, even if you want to, even if you think you should

#26
post #10

Don’t take Twitter advice… this post does nothing but discourage play and experimentation.

I think it's pretty obvious that they're discouraging the impulse to implement a database for your job, not for just playing around and learning.

Re: Never write a database, even if you want to, even if you think you should

#28
post #10

Don’t take Twitter advice… this post does nothing but discourage play and experimentation.

The tweet is part of a conversation about building a database for your business, it has nothing to do with play and experimentation for the sake of learning

Re: Never write a database, even if you want to, even if you think you should

#30
I tried this once at work, because it seems like such a trivial task. Spoiler: it wasn’t.

Having said that, I learned a lot from it. So I wouldn’t say don’t do it. You’ll probably learn from it. Just don’t expect to make the next MongoDB or MySQL :)

Post reply on HN