466 karma · joined September 15, 2014
Love to program all sort of stuff from websites to artificial life systems. Love thinking about programming even more.
Love mathematics. Program mainly because it's the easiest way to build my ideas for me.
I want computers to enrich people's lives, not the other way round.
You say "fields", I say "facts".
Which of a set of nominal events or a graph of facts is higher-level will ultimately depend on the domain, but using Datomic over several years now has led me to think that it's much more often the latter than conventional Event Sourcing has trained us to believe.
In fact, it may well be that Event Sourcing has traditionally been relegated to those (few) use cases where the "set of nominal Event Types" approach is better, being the only situations where conventional Event Sourcing is practical.
> Events themselves are no longer interesting or semantically meaningful, because they're a single atomic change to a database field. A change in the way state is represented means a different set of events is produced. Subscribing to meaningful occurrences in this model is difficult,
Datoms are not 'single' or 'atomic' - they're packed coherently together in a Transaction, and are immediately relatable to entire database values. Subscribing is just pattern matching, and is not hard, as the following section of the article tried to show: https://vvvvalvalval.github.io/posts/2018-11-12-datomic-even....
> [...] and probably will eventually result in the creation of a "meta-event" for each action that contains the semantic intent of the outcome.
Which would only bring you back to the 'set of nominal Events' case, so it's not a regression compared to conventional Event Sourcing anyway. That's what the article meant by 'annotating Reified Transactions', and that's something you can even do after the fact (i.e in a later transaction, when the requirement for it becomes apparent) which means that you don't have to get these aspects rights upfront, nor commit to them.
For a more in-depth discussion of Datomic's Reified Transactions, I suggest this talk by Tim Ewald: https://docs.datomic.com/on-prem/videos.html#reified-transac...
Wait 6 months or 1 year, and you've given them time to gather sufficient experience for motivating a more mindful way of working.
Wait 3 years or more, and you've just taught them bad habits.
I'm tired of interviewing candidates who were supposedly trained extensively in programming, asking them "how do you approach making quality software?" and hearing the usual "oh, I indent my code and write a lot of comments" as an answer.
I wrote "think about what you're doing".
To me, this is as silly as training Biathlon athletes to not even aim before they shoot.
So far, I've always ended up not recruiting the candidates, because they would have made a mess of the codebase in no time, bringing negative net productivity to the team (more so than most junior candidates I've seen). And this was for jobs in a startup!
I wish 42 would teach them the necessary insights to program sustainably - that's where teachers and mentors are indispensable, and that's the rare skill most companies are lacking. Anyone can pick up tutorials and read manuals on their own. Make them developers, not eternal coding beginners. I'm not asking for an academic or scientific focus, just a good philosophy of programming in general, the kind of which you see in SICP for example.
Unfortunately, 42 does not have a monopoly on producing short-sighted developers in France, by far - that's the case of most "learn to code in X days/months/years" programs.
What???
You could write such a wrapper, but it won't be standard, which means that there will never be a robust library ecosystem and set of practices that arises from that. If GraphQL was to evolve, you also wouldn't be sure your wrapper can express all of GraphQL. Finally, this would add new practical hurdles, like a new dependency, additional runtime cost of compilation, obscured source mapping, etc.
Meanwhile, because GraphQL is just a text-based DSL, most people don't have a clear idea of the _information model_ of GraphQL queries - you have to read the spec to get this idea. If we are to build a robust ecosystem on top of GraphQL, this information model should be evident in the API.
All these problems are present, and very damaging, in SQL.
I would consider this a weakness of ORMs, not of GraphQL.
It went well, it greatly simplified both our backend and frontend code. The backend code got simpler and more stable because it no longer had to deal with "data packaging". The frontend code became more transparent, because you can now easily read what data gets exchanged, and more decoupled, because different components can independently require the data they care about. One of the biggest benefits has been the degree of independence to evolve both the client and server.
We haven't had the performance issues some people have mentioned (N+1 query etc.), because of the server-side design of our homemade GraphQL engine - in which data resolvers are batching and asynchronous by default, unlike most backend libs which approach this problem more naively. Will open-source that soon.
The biggest limitations I see to GraphQL are:
- it doesn't really have a story for caching. I have some ideas for addressing that, but it hasn't been a problem for us really.
- it repeated the SQL mistake of exposing a query language based on text, not data structures. Now we have to write queries as templates instead of assembling them programmatically. This hurts both application developers and library authors.
- it doesn't really have a story for structured writes.
But there are some similar historical precedents. Fourier's work was rejected in his time because Lagrange wouldn't adopt his approach to mathematics.
This video is a great retrospective on the evolution and adoption of programming languages / paradigms: https://www.youtube.com/watch?v=JxAXlJEmNMg
It is a necessary condition, certainly not a sufficient one
As it has always been in the history of programming, what it takes for this potential to come true is for the current generation of programmers to retire, leaving room for fresh paradigms.
Imagine if all the industry got one generation after Assembly language was "hey, we've made the instruction codes shorter and an IDE that can navigate to line numbers".
- "Stay away from the computer" - Start by asking: "what is the problem?"
To be clear, I'm all for research about carbon sequestration, but it should not be an excuse to keep polluting irresponsibly. On the long term, we simply can't get away with compensating all our big negative impacts with big positive ones - how about introducing some moderation in our lifestyles instead?
This is an unreasonably simplistic approach to assessing performance. A useful approach would be to describe what workloads Datomic may or may not be suited for. Having used Datomic (On-Prem) 2 years in production, here's my take on it:
1. For a system that writes a lot (eventually leading to 10 billion datoms or having high peaks of write throughput), Datomic is not a great fit, because it has a single writer thread and does quite a bit of indexing. 2. Reads are horizontally scalable, and because Datomic's semantic allow for pervasive and reliable cacheing, reads can handle a huge load, and have low latency for OLTP-style queries. 3. Datalog is relatively slow for aggregations, and offers no facilities for trading accuracy for speed: if you need big, low-latency aggregations, you should offload it to a specialized store like ElasticSearch. This is especially easy to do with Datomic, because Datomic makes it trivial to implement change detection, in-real time if needed (see Log API and txReportQueue) 4. When writes are overwhelmed and become unavailable, reads stay available, which is an awesome situation to be in.