Datomic and rehab

with this post i want to explain a good deal of my thinking as it relates to datomic, since i do wonder if anyone out there can relate to these my thoughts and feelings… or if it’s just me :smile: … alright… confession up front… i have not yet switched over to datomic… i am still driving the old rdbms from yesterdecade…

…hmm… ok… now when i make that statement… more and more people give me this…
raised eyebrow… whats wrong with you?.. don’t you get get it?.. kind of vibe / reaction…

…so… i get this from really smart people… ( much much smarter than me, no doubt! ) … so
i wanted to examine myself, in order to figure out… just what’s wrong with me… :smile: …okay… so now i am thinking… i am re-evaluating my position on databases… and it suddenly dawns on me, that what provokes this reaction from the pro-datomic party, is that datomic simply offers clear, objective and undeniable advantages over a rdbms like postgres in many a case / scenario… why?.. well its the exact same thing as with el / cl and clj… in that clojure has persistent data-structures, whereas in el / cl mutation is part of how you do it… so… its an immutability thing, right?.. and obviously i see the greater VALUE, so why do i stay put in PLACE?..

…hmm… so i keep thinking… i certainly do appreciate immutability… its superior to
mutation in so many ways… its so freaking obvious!!!.. so why am i still not on board with datomic??? this just doesn’t add up!

…ever more confused about my irrational behavior, i.e. the discrepancy between my actions and convictions… i get ever more frustrated with myself… just what is it, that’s still holding me back?!.. for i made the transition from el / cl to clj, did i not?.. and why would i be ready and willing to do that back then,… but be so reluctant to give in on the sql front right now?.. and then it hit me! I NEVER MOVED FROM EL / CL TO CLJ BECAUSE OF IMMUTABILITY!!!

…wow!.. what an insight!!!.. you see… immutability clearly trumps mutation in terms of simplicity and elegance… and performance is certainly no show stopper… so when i know that… and when i know about how clojure offers support for immutable data-structures in ways that el / cl do not… why then would this not be enough for me to make the transition?

…well… this i realized… this must be because the human condition is not solely characterized by pure reason alone… i mean… we all act in irrational ways… all of the time… so we form irrational habits… and guess what… habits are hard to shake!!!.. (… to quit smoking is hard, right? )… also once you have formed an irrational habit it would ( often ) be irrational to abandon it too abruptly… ( …say you’re an alcoholic, if you were foolish enough to attempt too drastic a measure / remedy for sobering up… ( this German: Rosskur )… it might just kill you!!!.. )

but why then, why did i end up with clojure???

…okay… so once more i take a deep dive into the workings of my twisted mind… i examine myself as best as i know how,… scrutinize my past and present condition… and what i find is this hopeless geek… this nerd who fell madly in love with emacs and lisp… head over heels kind of a thing… not sure why or how it happened… i just know it did… i guess it is just something about the way the code looks / feels… but again… i really can not put my finger on exactly what it is… ( …i also happen to be the proud owner of a vespa build in 1963 … to me the thing is just beautiful… ( …so many precious memories… pure gold really - https://www.poetryfoundation.org/poems/45521/i-wandered-lonely-as-a-cloud ) and i simply do wholeheartedly love it… and with a passion… and… and… even if you were to point out to me, ( and rightfully so ) that, for example, the breaks on the thing are not all they could be… i just could not care less, really couldn’t… )

…so this is me… i am this emacs / lisp geek… i am all comfortable… so why bother with clojure?.. you say less parentheses, commas as whitespace, persistent data structures etc. etc. … and i agree… ( …also i have already made the transition to clj… so why wouldn’t i :smile: )… but at the end of the day, to me personally, what made clojure irresistible was the fact that it was HOSTED… hosted on the jvm and the browser… this is because even if there is state / mutation in my lisp… i think that is unfortunate,… i would prefer if it was otherwise,… but i can live with that!.. ( …yeees, i know i am being stupid… that’s ok… i kind of like that about myself :smile: ) … but if i am doing for example cl, there is just no way i can build a single page application!!!..

in other words, clojure makes it possible for an emacs / lisp geek to build modern apps…
that to me is the real attraction of clojure… and that, i think, is also the real impetus that was powerful enough to make me go into rehab… so to speak…

…so now that i am on board with clojure… now that i am happily tinkering with my little app… ( …all of this is really exiting… i am learning about new stuff pretty much on a daily basis… also… my org-mode files are literally overflowing with fantastic ideas for new phenomenal features… that are surely going to revolutionize the way people study Japanese etc. …very soon… no doubt… i really mean it!!! :smile: ) …

…in any case… so that’s where i am currently at… i feel my app it is working reasonably well… and i have like 10 million things i would like to improve about it… so… why not datomic?.. i guess… what i have realized is that,… ( for right now at least ) … it is going to take more than immutability for me to undergo rehab a second time :smile:

I think that many folks come to Clojure only because they’ve felt enough pain from other technologies that they “get” Clojure. I think the same is true of RDBMS and Datomic: you come around to Datomic only when you’ve had enough pain from RDBMS?

Sure, some people come before they’ve felt that pain… lucky them! I started doing commercial software in the early 80’s. I’ve felt a lot of pain. I don’t remember when I first started doing RDBMS but I did a variety of other weird databases too, starting with hierarchical databases back in the very early 80’s and ODBMS (Object Databases) in the 90’s… So I’ve felt a lot of pain there too. I wish Clojure and Datomic existed decades ago – I’d have switched then!

1 Like

The big win over RDBMS is that Datomic has a native reference type. That means with Datomic you can just walk your data like a graph. Implementing graphs over relational tables is a pretty heavy activity in RDBMS requiring lots of up-front planning about how to layout the schema, how to implement the queries, denormalizing various pieces. I think of immutability as more as a nifty implementation detail here that Datomic internals utilize to great effect to make this work out in practice.