31
MongoDB or Redis? (feddit.org)
submitted 1 week ago* (last edited 1 week ago) by ki4jgt@feddit.org to c/programming@programming.dev

About a decade ago, I tried to index the web via the Dewey Decimal System. I had a site laid out similar to Google, where you could browse sites continuously starting from a given call, but the DDS is proprietary, and those people hate anyone who uses their IP without a license. You can Google everyone they’ve shutdown – places that weren’t even libraries – for using anything similar to the DDS. I reached out to the group that manages the DDS, and was taken offline before my project even started.

With all the corporate BS lately, and people looking for alternative options, I thought I’d take a search engine old school, and we’d index like Usenet. Except with an XXX.XXX.XXX format.

My original project used sharded Redis, with append logs to disk. I chose it for its in-memory speed and key-value store. Did some calculations, and I'd have to have millions of records just to consume my entire system's memory.

I had a lot of plans for this before getting shut down.

Now that I'm older, I'm curious if I should be using MongoDB.

What are the benefits and drawbacks of each? Which would you use? And why?

you are viewing a single comment's thread
view the rest of the comments
[-] Ephera@lemmy.ml 5 points 1 week ago

Depends on the data you want to store and what you want to do with it. I haven't used either MongoDB or Redis in particular, but MongoDB (or e.g. CouchDB) is a document-oriented database, whereas Redis/Valkey is a key-value store.

Superficially, these are similar kinds of databases, in that you have a key and store a value. But document-oriented typically enforces the format somewhat, like e.g. some JSON format, which is then used for doing indexing, aggregation, search or whatever in the database.

Meanwhile, a key-value store does not care what data is actually stored inside. It can literally be just some bytes. You tell it the key and it tells you the data you previously stored, and that's all you do with it.
I wouldn't be surprised, though, if Redis doesn't fit that definition 100% and actually has some optional document-oriented features as well.

From your very short description of what you want to do, my intuition would be more towards document-oriented, because the indexing is presumably essential for a search engine.

But as someone else already said, MongoDB is proprietary now, so probably want to look for an alternative. Selecting the database is worth spending some time on, since the right database might already bring along the search capabilities you want.

I also want to throw in a third type of database that you should probably look into: https://en.wikipedia.org/wiki/Graph_database

Graph databases are good at storing relationships between entries, which you will have a lot of, given each webpage links to other webpages. I believe, the big-boy search engines do use graph databases.

this post was submitted on 16 Sep 2026
31 points (100.0% liked)

Programming

28579 readers
116 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS