Fork me on GitHub
#asami
<
2021-02-16
>
quoll13:02:29

@peter.royal! Fancy seeing you in the Clojure universe 🙂

Steven Deobald15:02:54

Wow, small world.

osi16:02:51

👋 i keep an eye on it 😀 … i’m not actively using clojure, but i continue to be interested in (gestures around) these approaches to data modeling/etc. the same stuff that brought us together initially

osi17:02:49

i had seen your name pop up in the #crux channel @steven427 - makes me wonder what you’re up to now 😀

quoll17:02:12

Well, you’ll see code in Asami that is a direct result of a bar discussion in SF over a decade ago 🙂 https://github.com/threatgrid/asami/blob/storage/src/asami/durable/pool.cljc#L95

quoll17:02:41

The Clojure version of reading IDs like this is at https://github.com/threatgrid/asami/blob/storage/src/asami/durable/decoder.clj#L191 i.e. check the top bits, and if they match a known datatype, then decode the remainder of the Long value into the data

quoll17:02:35

So all the short strings, numbers, dates and keywords are being stored inside a long, and not in an index

quoll17:02:53

Geee…. I wonder where that idea came from? 😉

osi17:02:51

ha! i had completely forgotten about that 😀

quoll17:02:53

It speeds up “storage” in the data pool quite a lot!

quoll17:02:01

I always meant to do it for Mulgara, but then I didn’t have any reason to be working on Mulgara anymore, and I just didn’t like using Java either.

quoll17:02:17

But when I started again from scratch, it was one of the first things to happen!

osi17:02:52

heh, i’m the opposite - clojure and i don’t “mesh” well enough. i tried using it again 2yr back to solve a problem, and when i came back after a month and could understand my own code, i realized there would be no hope for a successful introduction in my team

quoll17:02:33

While this is definitely a risk with Clojure, in practice I find that it can be controlled: • Writing in a well structured way (which takes practice!) • Documenting with comments. There is FAR TOO MUCH Clojure code out there without good documentation in it. This is definitely a hurdle. • Ensure that the entire team learns to do the same as above.

quoll17:02:02

I too have struggled with code that I returned to and had to re-learn.

quoll17:02:53

It is extremely easy to write Clojure without documentation, making it impenetrable to your future self. Which is why structuring and documentation habits become so important

osi17:02:41

All of that makes a lot of sense. I had spiked something with the hopes of trying to introduce more clojure, but my experience made me realized that it would be too much of an uphill battle, that I’d rather push the concepts from clojure with a java implementation, even though it’d be less-ideal.

quoll19:02:49

If it’s a spike, then that’s what I would recommend too. But I also recommend practicing with Clojure. It may be uphill for you at this point, but it really does get a lot easier! 🙂

osi22:02:37

It was a spike of sorts - using Clojure to do a DB -> GraphQL translation with #lacinia. I had plans to try and use Clojure (and spec specifically) for a data pipeline, but then I was switched to a different project that didn’t have (as) strong of a need

Steven Deobald17:02:56

@peter.royal It's a good question, really. A very long story short: spent most of 2020 (otherwise known as Pandemic Season Classic) in North India, most of that in Kashmir. Was working on a digital library for http://pariyatti.org at the time, which is why I'm in #asami and #rdf ... ended up choosing #crux for simplicity / bandwidth reasons. Started working halftime for JUXT this month, partly due to all the Crux questions I was asking, I think. Still working on Pariyatti the other half of the time. Still very curious about RDF, SPARQL, Real Datalog, proper graphs (Crux's edges are the graph db equivalent of duck typing unless one layers on extra semantics). I lurk in here so that by 2025 I might have some idea of what the heck is going on.

Steven Deobald17:02:04

@peter.royal Where are you these days?

osi17:02:24

oh nice! i’m at Netflix, doing biz apps for our studio. ultimately, it’s a giant data management problem, and my mind is “poisoned” by the RDF work I did in the mid-2000's at a failed startup (which is what let me to meet @quoll, back in the Mulgara days). as Rich’s ideas on modeling/constraints are aligned with mine, I like to broadly follow his work. temporality in data has been on my mind, which led me to Datomic and then Crux

Steven Deobald17:02:14

Crazy! I'd love to hear a story about the "poisoning" one day ... and your philosophy on the whole space, actually. It's not the easiest thing to hear opinions about and even harder to hear war stories about.

osi17:02:17

heh, i’m (slowly) working on writing thoughts down. a very very scoped from was done as a conference talk, https://www.youtube.com/watch?v=JGtybIKUdh4&amp;list=PLKKQHTLcxDVbJtlef15003TYaEkq1ZY8c&amp;index=18

Steven Deobald18:02:16

Could you elaborate on Command + State -> Events = a pure function? In practice this is never really true, right (since disk tends to be involved)? Are you thinking more of philosophy / theory here? Or have you exploited this somewhere?

osi18:02:17

As theory, yes. I have built a system that exploits this. The state necessary for that process is in memory. It is only the state necessary to enforce the rules needed to generate events. It’s a subset of all the information the events represent. The loop is then in-process, read a command from disk, apply it to the state, generate events prospective events, apply them back to the state to ensure that it moves forward. If all of that succeeds, then persist/publish the events and record the disposition of the command

osi18:02:30

the disk-related parts are intermixed, but I’m treating that as an implementation concern. that core loop doesn’t depend upon it, which is leveraged for testing the system. the way that persistence/publication is managed isn’t dependent upon the loop. the strategy can be changed independently. (right now we’re entirely in postgresql with tables, but using kafka similar to how crux does should be possible)

Steven Deobald18:02:12

Huh, neat. Makes sense.

Steven Deobald18:02:32

Yeah, it feels like you're really building something quite Crux-like here. 🙂

osi18:02:39

Yes, it is certainly Crux-like. I’ve had thoughts about materializing the output into Crux to leverage its temporal queries. As far as my current implementation, it’s all in Postgres as our internal operations are easier with the fewest moving parts a team has to manage.