walex
talk-transcripts
Our great sponsors
walex | talk-transcripts | |
---|---|---|
17 | 34 | |
251 | 2,852 | |
- | - | |
9.1 | 4.7 | |
19 days ago | 11 months ago | |
Elixir | ||
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
walex
-
The Guide to PostgreSQL Data Change Tracking
The WAL CDC approach: https://github.com/cpursley/walex?tab=readme-ov-file#publica...
CREATE PUBLICATION news_item FOR TABLE news WHERE (topic IS "AAPL");
-
Elixir Nitpicks
What do you mean testing with processes?
I won't suggest these are the best written tests, but I test various processes, supervisors, etc like this:
https://github.com/cpursley/walex/blob/master/test/walex/sup...
-
PostgreSQL Is Enough
You don’t send the entire WAL, just what you subscribe to - and you can even filter via SQL: https://github.com/cpursley/walex?tab=readme-ov-file#publica...
- A Technical Dive into PostgreSQL's replication mechanisms
-
Fly Postgres, Managed by Supabase
What we do is much if the business logic in Postgres. But then there’s all the other stuff like external integrations, etc.
We handled that by having an Even system built on the Postgres WAL that we use like a callback system.
I put together a little library in Elixir (that originally started out as forked Supabase realtime) for this:
https://github.com/cpursley/walex
Recently added the ability to configure WalEx to forward events to webhooks or EventRelay (so you don’t need to know Elixir).
-
All the ways to capture changes in Postgres
If you're using Elixir, check out https://github.com/cpursley/walex
I've actually been thinking about turning this idea into a product where you can just point it at your postgres database and select the tables you want to listen to (with filters, like you describe). And have that forwarded to a webhook (with possibility of other protocols).
I'd love to hear folks thoughts on that (and if it would be something people would pay for).
-
Show HN: ElectricSQL, Postgres to SQLite active-active sync for local-first apps
Neat, this is the pattern I've been thinking about for a while now. Also glad to see this is Elixir based.
I've been using https://github.com/cpursley/walex (basically a fork of cainophile via a fork for subabase) to listen to Postgres changes in Elixir.
-
How to Listen to Database Changes Using Postgres Triggers in Elixir
https://github.com/cpursley/walex
Which is based on WAL logs and doesnt have the same limitations.
-
PostgreSQL Logical Replication Gotchas
Great writeup, just added this to the WalEx readme:
https://github.com/cpursley/walex
(WalEx is an Elixir lib for listening to the WAL and perform callback-like actions with the data)
-
We used Elixir's Observer to hunt down bottlenecks
Very cool.
I'm using Elixir to listen to change events via https://github.com/cpursley/walex (which I basically ripped off from Supabase).
talk-transcripts
-
Teach Yourself Programming in Ten Years (1998)
Thank you for this recommendation. I've never heard of it before and now I'm reading: https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
It's giving me energy this Monday holiday(USA)!
-
Can't Be Fucked: Underrated Cause of Tech Debt
race?
> [Audience reply: Sprinter]
> Right, only somebody who runs really short races, okay?
> [Audience laughter]
> But of course, we are programmers, and we are smarter than runners, apparently, because we know how to fix that problem, right? We just fire the starting pistol every hundred yards and call it a new sprint.
https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
-
Strong typing, a hill I'm willing to die on
>So this is 10x, a full order of magnitude reduction in (?) severity before we get to the set of problems I think are more in the domain of what programming languages can help with, right? And because you can read these they'll all going to come up in a second as I go through each one on some slide so I'm not going to read them all out right now. But importantly there's another break where we get to trivialisms of problems in programming. Like typos and just being inconsistent, like, you thought you're going to have a list of strings and you put a number in there. That happens, you know, people make those kinds of mistakes, they're pretty inexpensive.
[0] Video: https://www.youtube.com/watch?v=2V1FtfBDsLU
[1] Slides and transcript: https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
[2] Video https://www.youtube.com/watch?v=YR5WdGrpoug
[3] Slides and transcript https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
-
Puzzle Languages
This is tangentially related to Puzzles-vs-Problems in Rich Hickey's Effective Programs
> Eventually I got back to scheduling and again wrote a new kind of scheduling system in Common Lisp, which again they did not want to run in production. And then I rewrote it in C++. Now at this point I was an expert C++ user and really loved C++, for some value of love. But as we'll see later I love the puzzle of C++. So I had to rewrite it in C++ and it took, you know, four times as long to rewrite it as it took to write it in the first place, it yielded five times as much code and it was no faster. And that's when I knew I was doing it wrong.
[...]
> So I mean for young programmers, if everybody's tired and old, this doesn't matter any more. But when I was young, when I was young, I really, you know, when you're young you've got lots of free space. I used to say "an empty head", but that's not right. You've got a lot of free space available and you can fill it with whatever you like. And these type systems they're quite fun, because from an endorphin standpoint solving puzzles and solving problems is the same, it gives you the same rush. Puzzle solving is really cool. But that's not what it should be about.
Talk: https://www.youtube.com/watch?v=2V1FtfBDsLU
Slides and transcript: https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
-
All the ways to capture changes in Postgres
Using triggers + history tables (aka audit tables) is the right answer 98% of the time. Just do it. If you're not already doing it, start today. It is a proven technique, in use for _over 30 years_.
Here's a quick rundown of how to do it generically https://gist.github.com/slotrans/353952c4f383596e6fe8777db5d... (trades off space efficiency for "being easy").
It's great if you can store immutable data. Really, really great. But you _probably_ have a ton of mutable data in your database and you are _probably_ forgetting a ton of it every day. Stop forgetting things! Use history tables.
cf. https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
Do not use Papertrail or similar application-space history tracking libraries/techniques. They are slow, error-prone, and incapable of capturing any DB changes that bypass your app stack (which you probably have, and should). Worth remembering that _any_ attempt to capture an "updated" timestamp from your app is fundamentally incorrect, because each of your webheads has its own clock. Use the database clock! It's the only one that's correct!
-
G. Polya, How to Solve It
Rich Hickey (creator of Clojure) references Polya several times in his classic talk "Hammock Driven Development". Here's a transcript:
https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
I've long been impressed by Hickey's problem solving skills, so I took much of this talk to heart, and even bought a copy of HTSI. Can't say it really helped me any more than Rich's talk (as a programmer) but I'm thinking I'll give it another look.
-
Interfaces All the Way Down
>Great product designs require no manual, and similarly, great interfaces need no documentation. Imagine having to read a manual on how to use a coffee mug.
This could not be more wrong.
Not everything is easy. If a library is addressing a complicated domain, solving by definition a complicated problem, it is fine if it requires some learning.
When did expertise and learning become bad things? If software is an engineering discipline, why would people in it ever promulgate the idea that any random cog can step in to any “engineer”s shoes?
Rich Hickey analogizes this mentality to the world of music, where it taken for granted that learning an instrument requires a lot of study:
“ We start with the cello. Should we make cellos that auto tune? Like, no matter where you put your finger, it's just going to play something good, play a good note.
“[Audience laughter]
“Like, you're good. We'll just fix that.
“ Should we have cellos with, like, red and green lights? Like, if you're playing the wrong note, you know, it's red. You slide around, and it's green. You're like, great! I'm good. I'm playing the right song. Right?
“ Or maybe we should have cellos that don't make any sound at all. Until you get it right, there's nothing.
“ [Audience laughter]”
https://github.com/matthiasn/talk-transcripts/blob/master/Hi...
-
Slightly off-topic: Whose lectures do you recommend listening to, similar to Rich Hickey?
You might find adjacent talks and speakers here ... https://github.com/matthiasn/talk-transcripts
-
Functions vs. Procedures: Keep them separate.
Many languages merge the two concepts, and implement procedures as functions that return void. This may muddle/complect their distinction, causing programmers to call procedures from within functions, thereby making those functions into impure functions (meaning that they affect the world outside of themselves, through side-effects like I/O or mutating state). This should be avoided, especially if you care about debug-ability and Functional Core, Imperative Shell architectures (see Gary Bernhardt's Boundaries talk at 31:56) (which make testing your system easier, without mocking).
-
What's the thing you avoided a lot but learned later, and it was really helpful?
A great way to do this in practice is to write design docs. I take an approach inspired by Rich Hickey's "Hammock Driven Development" - identify the problem, state it, write it down - describe what you know about it - try to describe what you know that you don't know about it - list the constraints your solution has to operate within - enumerate some potential solutions and explore their problems - (later) choose a path, and describe why it was chosen over the alternatives
What are some alternatives?
PolarDB-for-PostgreSQL - A cloud-native database based on PostgreSQL developed by Alibaba Cloud.
rich4clojure - Practice Clojure using Interactive Programming in your editor
neon - Neon: Serverless Postgres. We separated storage and compute to offer autoscaling, branching, and bottomless storage.
etaoin - Pure Clojure Webdriver protocol implementation
realtime - Broadcast, Presence, and Postgres Changes via WebSockets
clj-chrome-devtools - Clojure API for controlling a Chrome DevTools remote
libcluster - Automatic cluster formation/healing for Elixir applications
codetour - VS Code extension that allows you to record and play back guided tours of codebases, directly within the editor.
worker - High performance Node.js/PostgreSQL job queue (also suitable for getting jobs generated by PostgreSQL triggers/functions out into a different work queue)
base - Unison base libraries
helm-charts - neondatabase helm charts
lumo - Fast, cross-platform, standalone ClojureScript environment