Fork me on GitHub

What’s a reasonable approach if you want to migrate from Database X to Database Y? Do you start migrating “Bound Contexts” one by one meaning for some period of time there are two sources of truth — and how do you deal with cross-DB links?


(Background is — a mongo DB which mostly has relational stuff, I’m exploring possible avenues to move to Postgres while keeping things running along. Datomic is a no-go, sadly.)

Mario C.15:11:12

@orestis That's what we are doing MongoDB --> PostgreSQL.

Mario C.15:11:59

Saving to two DB's concurrently long enough to make sure everything is good to go then we are cutting off Mongo

☝️ 4

I’ve done with before and used that approach, augmented with integrity checkers run against snapshots of the two databases taken at logically equivalent points in time to gain confidence.

☝️ 4

So for some period you have code that both reads and writes to/from both DBs? /cc @mario.cordova.862 @donaldball

Mario C.17:11:50

Yes that is correct

Mario C.17:11:29

We set the main source of truth (MongoDB) and read from both but retrieve from that

Mario C.17:11:03

we do an equality check on retrieval


Oh nice. So this runs in production all the time?


Do you use any complex mongo pipelines? They can be very nice, I was always wondering how the equivalent SQL would look like.


A blog post or brain dump would be highly appreciated :)

Mario C.18:11:30

Its not in prod just yet. We are still testing and setting things up but we are hoping to go to prod but the end of the month.

Mario C.18:11:01

I am very junior here so I may not be well suited for knowledge dumps 😛


Anyone here whose first language is Spanish? I was thinking today about how beginning programmers often get confused about equality, and was wondering if that comes more naturally for Spanish speakers, since Spanish distinguishes between identity (lo mismo) and equivalence (igual). Caveat: my Spanish is so-so; my understanding of the distinction may be shaky.


In my experience it does not make any difference @eggsyntax 🙂


math helps more than natural languages


I'd recommend SICP and a book of algorithms 😄 programming is magic!


but oddly enough its true that certain (natural) languages don't really support certain things, that's where the stereotype for germans being unfunny comes from


Also I've read somewhere that while western languages are subject/object oriented, mandarin is more declarative, but I can't really vouch for the accuracy there


i,e. "he broke the window" vs. "the window became broken"


There are multiple context-dependent meanings for many English words, including "identical" and "equal", and many people are casual in their use of them as synonyms in contexts where it might be nicer if they did make a distinction. First, one has to learn that they can mean different things.


i was thinking of the many articles you have written on this very subject.


I am sure I have spoken out loud and used those words as synonyms, where if we wrote down a transcript and went back through it to see more precisely what I meant, I would have chosen the other word.


It is also pretty common to use words like "choose" and "decide" when describing the behavior of computers running our programs, when if we were later asked "do you believe computers can make choices in the same way humans do?" some of us would say "No, I think that is a fundamental difference between humans and computers." But it is much easier to speak that way in casual circumstances where it is understood "I don't think computers actually make choices."


"Don't anthropomorphize computers; they don't like it."


Oh, heck no. At least half a dozen times the root cause for bugs I've found was "the computer didn't like what I said about it in an off hand way" 🙂