Fork me on GitHub
#off-topic
<
2022-03-31
>
v3ga03:03:45

Hmm why didn't mongodb ever take off with Clojure? You'd think it would be a really good fit.

hiredman03:03:02

A lot of people have a very low opinion of mongo. For all kinds of reasons, including the query language, the data model, and in the past maybe still, chose unsafe defaults to appear faster

hiredman03:03:41

Clojure is a fantastic fit for the relational model

👍 3
hiredman03:03:51

A table is like a seq of maps

adi04:03:41

> why didn't mongodb ever take off with Clojure? If I were to guess, when your programming language is far better at working with heterogenous data than <Database>, you don't need to offload that burden to the DB.

👍 2
1
v3ga04:03:04

Well, can't argue that.

adi04:03:48

More generally, I feel like people found the good parts of RDBMSes by way of finding the bad parts of NoSQL dbs (and vice-versa). Since a massive swath of business-as-usual software has forever been solved under the relational model, it seems reasonable that people will want guarantees that traditional RDBMSes provide. Anecdotally, too often a service/app + NoSQL db basically grows to become example of Greenspun's Tenth rule applied to DBs; viz. the combination becomes an ad-hoc, informal, bug-ridden, slow implementation of half an RDBMS. Also machines have become so phenomenally capable, that choosing a distributed system (common value proposition proffered by NoSQL vendors) is less and less of a good choice even for reasonably large scale mission-critical applications. Zerodha offers https://zerodha.tech/blog/hello-world/ of this (~Xx Terabytes of data in one Postgres box, for a heavily used stock brokerage---up to 7 million trades/day).

❤️ 1
v3ga05:03:05

Well I was thinking of using it for an ODD cms. At the moment I'm using postgres which is fine but I just imagined a loose schemaless db like mongo would fit well with lift. As I read more I see people falling into various traps. Though I still wonder if for document storage it's a good fit. Now I'm also looking at xtdb and datalevin. This is a personal project so I'm not foreseeing millions of records…but there could very well be a lot of nesting and a need to have flexible schemas

adi05:03:39

I'm not an expert, but maybe Postgres's JSONB type will serve the bits of your requirement that are nosql-y?

👍 1
adi05:03:46

Also, no jokes, https://news.ycombinator.com/item?id=29727707 if it is a personal/small-scale project? Which also https://www.sqlite.org/json1.html. SQLite, because it won't even notice your traffic, and because your devops overhead will be tiny.

hkjels06:03:22

SQLLite is brilliant tbh! Just works everywhere

v3ga06:03:11

Well I have postgres now. I'd stick with that if anything. Definitely not sqlite. I do use json columns but it's not ‘great’. XTDB is looking interesting now…perhaps even overtop Postgres. It looks like by default rocksdb is the underlying layer.

👍 3
adi08:03:40

Wow, how have I never seen this talk before? Better late than never! https://www.youtube.com/watch?v=3ka4KY7TMTU

🙏 2
dgb2319:03:03

Wow thank you so much for sharing this. I only knew from Self as an influence in VMs and some languages. I absolutely adore these types of people, they are creators who will build a compiler a vm a language a database … right up to the user interface, some of them even built their own hardware. It’s HCI, CS, EE and so on all in one piece of art and engineering.

❤️ 1
1
marrs12:03:47

> why didn't mongodb ever take off with Clojure? Probably because Mongo was a fad and people who chose it did so because other people chose it. You can apply that to NoSQL in general. I'm not sure that people who choose an obscure language like Clojure are crowd followers 😛 Maybe a better way of putting that is to say that Clojure developers are not evaluating the language based on superficial characteristics, such as syntax, but on a deeper understanding of what is useful in a language. I think people who choose Mongo do so mostly because it appears to be convenient at a superficial level. In other words the 2 sets of users evaluate technology against a different set of criteria that simply don't overlap.

Cora (she/her)13:03:11

syntax is not superficial at all, though, it's among the most important features of a language. languages are interfaces between humans and computers, after all, and so ergonomics are fundamental to the language and its value. humans, how they act and feel about and use these languages, are important. the same goes for databases and their interfaces. unfortunately mongo failed on some other important features for databases, like reliability, and failed on another human-computer interface: operations.

👍 4
1
Cora (she/her)13:03:25

clojure's syntax offers affordances for how humans interact with the language and so that's not superficial either

marrs14:03:51

Well, most people who avoid Lisps do so because of the syntax, specifically they don't like all of the brackets. I would consider that to be superficial in comparison to the benefits of Lisp. But I'm not sure I agree with you anyway. I use lots of languages that syntactically are very different from each other, and honestly I don't care. I'm sure there are languages that are syntactically bad enough that I'd rule them out, but I've never actually had to evaluate one in the real world

solf12:03:40

My dirty secret is that I learned Clojure because I liked the parenthesis syntax in emacs-lisp :(

❤️ 2
Drew Verlee13:03:04

You... monster.

Michael Anckaert13:03:41

huh... I thought everyone liked the parens. I mean what's not to like about them? Cute little ( and funny ) 😁

Cora (she/her)13:03:11

syntax is not superficial at all, though, it's among the most important features of a language. languages are interfaces between humans and computers, after all, and so ergonomics are fundamental to the language and its value. humans, how they act and feel about and use these languages, are important. the same goes for databases and their interfaces. unfortunately mongo failed on some other important features for databases, like reliability, and failed on another human-computer interface: operations.

👍 4
1
mpenet13:03:33

some other dbs adopted/support the query langage and wire protocol even

mpenet13:03:41

fdb comes to mind

mpenet13:03:58

(FoundationDB)

mauricio.szabo13:03:31

Honestly, MongoDB is a pain to use. It sounds wonderful in theory, but in practice, to have all the minimum guarantees that a DB should have (you know, you save your data and it indeed saves, not silently destroys it? Anyone?) MongoDB ends up being the same speed, or a tad slower than PostgreSQL for example. Now combine that with the idea of documents (that, IMHO, does not translate well to how things work in practice) and design decisions that you can have that may haunt you forever (for example, save authors under books, and then sometime in the future someone asks for every book a specific author wrote, even considering pen-names) and now you have a HUGE PAIN to deal with. Most people (me included!) that worked with MongoDB were not aware that there are a HUGE list of features in PostgreSQL (for example) that makes relational databases fun again - JSONB, but also arrays (no more "join-tables", you can put address_ids in a single field (no foreign keys for now, but hey, Mongo also doesn't offer it!)), custom indexes, etc...

👏 1
mpenet13:03:46

early on mongodb was a semi decent choice for quick & dirty prototypes, and pg didn't have all the bells & whistles it has now (it was still great)

mpenet13:03:02

you had to rewrite the whole thing eventually tho if there was adoption, so there's that. But some made it work quite far (I think foursquare use(d) it)

ghadi13:03:16

clojure programmers have a propensity towards writing obviously correct programs; mongodb had some high profile correctness/consistency issues

👍 1
ghadi13:03:38

(it's reductive, but that's how I remember it)

ghadi13:03:03

the jepsen reports tore mongodb apart

Cora (she/her)13:03:26

I felt embarrassed for them

mpenet13:03:43

yup, that was bad

Cora (she/her)13:03:45

but I also saw how it was to operate it at my last job

Cora (she/her)13:03:01

the team that used it was constantly in pain from it

ghadi13:03:14

I was a mongodb cluster admin from 2013-2015, and I rather enjoyed mongo from the ops side

ghadi13:03:39

I remember doing a cluster upgrade from 2.4 -> 2.6 -> 3.0, adding a TLS jacket along the way, and we didn't drop a single connection

😍 1
ghadi13:03:56

but I didn't had to use it an app developer 😅

mpenet13:03:14

that said most dbs do require a fair amount of work to maintain if you diy

mpenet13:03:28

(not talking about the managed offerings)

Cora (she/her)14:03:23

I remember hearing the difference in experiences of operation when the jepsen report came out, too. not sure why that is

dgb2315:03:17

I remember when we tinkered with mongodb when NoSQL became a thing (or some time after). Our conclusion was: hey this is just a cache?

orestis16:03:41

I have upgraded mongo versions from 3.4->3.6 and now 4.0->4.2 with no downtime. I was a client of a SaaS but AWS RDS still takes the DB down for 10-30 minutes for a major upgrade.

orestis16:03:11

So I would love if Postgres had the same ops story as mongo, with a built-in router, no downtime failover etc etc.

orestis16:03:44

Regarding mongo syntax, I prefer working with maps rather than with strings. If it wasn't for HoneySQL I'd be very sad in Clojure land.

orestis16:03:30

The main reason we are moving away from Mongo is joins: Mongo is just not the right fit.

ghadi16:03:34

a fun set of conference micro/lightning talks: Say nice things about technologies you don't like

💯 9
Martynas Maciulevičius18:03:57

I love golang's channel implementation. Types allow to focus on the loops and on the data transformations. The ducktyping also helps.

phronmophobic18:03:50

Not liking a technology seems like a funny idea. "I don't like hammers."

😆 1
Ben Sless18:03:48

More like "I prefer working with wood over working with metal"

☝️ 1
Nundrum19:03:00

I don't like PERC dry cleaning. It makes me sneeze and itch. It seems perfectly normal to dislike some technologies.

2
Cora (she/her)22:03:54

I really ought to try out golang's generics

Wanja Hentze08:04:55

As an ops person, I love golang. As a programmer, I hate it 😅

Wanja Hentze08:04:44

You can take a golang project, build it, get a binary and get on with your day. Opsing clojure projects is rather a full-time position (or more).

orestis16:03:54

Regarding why people chose Mongo without looking much into it, a former colleague was maintaining that Mongo + JS are ideal matches because Mongo stores JSON and JS processes JSON natively. First claim is false and second claim irrelevant - but you can see how people can arrive at this conclusion.

marrs16:03:03

well precisely. This is pretty much what I was getting at with my answer.

Martynas Maciulevičius16:03:36

I think we should design a database which does exactly that just to prove a point 😄 And then compare the performance 😄 Edit: Also write it in C or assembly directly. Because it's performance that always matters 😄

valtteri16:03:01

My take is that if your data naturally represents as documents it might be a good idea to consider a document database. If your data is highly relational, it’s probably best to go with a relational database. You also need to consider ACID-requirements for your data and processes. In some cases throughput might be more important than integrity and in other cases you might have to make several complex transactions with hard consistency guarantees. Yet another thing is what are the typical access patterns to the data. Once these are clear enough it’s time to choose appropriate technology and do your homework well. 🙂

👍 1
valtteri16:03:49

Postgres indeed does a nice job providing tons of features to satisfy also the document model needs. However the obscure non-standard SQL way to query/manipulate JSON is pretty horrible. This is probably more of an SQL issue though.. But if you choose Postgres, you query it with SQL and suffer its downsides.

valtteri17:03:09

MongoDB trades off consistency guarantees for better throughput. At some point they claimed they could provide also hard consistency but that wasn’t the case. Nowadays I think they’re doing better with that but they’ve kept “throughput over consistency” as the default

valtteri17:03:32

I’ve also seen too many apps where the domain model is objects of some sort but for the storage you explode the objects into relations.. only to construct the data back to objects when you retrieve the data and want to actually do something with it. ORM’s are a horrible attempt to automate the ceremony around this (unnecessary) impedance mismatch.

marrs15:04:16

"unnecessary" being the operative word in that sentence. I always thought that object-oriented thinking was the root cause of a lot of these issues. I can well see how one might choose MongoDB just to get rid of an ORM!

dgb2319:03:03

Wow thank you so much for sharing this. I only knew from Self as an influence in VMs and some languages. I absolutely adore these types of people, they are creators who will build a compiler a vm a language a database … right up to the user interface, some of them even built their own hardware. It’s HCI, CS, EE and so on all in one piece of art and engineering.

❤️ 1
1
Michael Agres22:03:15

Who here's gearing up for tomorrow's World Cup Draw? (apologies to everyone in Italy, and Egypt, and anyone else whose National Football Teams did not qualify)

1