7,912 karma · joined Sep 11, 2009 (17y ago) · 3,625 submissions
https://twitter.com/dustingetz
comment 3y ago · link · parent
What is it? build web-scale reactive backends with an expressive java dataflow API. Instead of a database you develop your own custom app-specific indexes which are reactive, distributed and durable. It's like event sourcing and materialized views but integrated in a linearly scalable way.
> I cannot emphasize enough how much interacting with indexes as regular data structures instead of magical “data models” liberates backend programming
> It allows for true incremental reactivity from the backend up through the frontend. ... enable UI frameworks to be fully incremental instead of doing expensive diffs to find out what changed.
Ok, so in my mind I am positioning this against Materialized / differential dataflow, whose key primitive is a efficient streaming incremental join that works across very large relational tables. Materialized makes SQL reactive, Rama gives you a java dataflow DSL for developing purpose-built reactive database indexes.
How it works? 4 concepts: Depot, ETLs, PState, Query
Depots: "distributed, durable, and replicated logs of data." [Event streams?] "like Kafka except integrated" "All data coming into Rama comes in through depot appends."
ETLs: data arrives via depots, and is ETLed to PStates via "a Java dataflow API for coding topologies that is extremely expressive". "Most of the time spent programming Rama is spent making ETLs."
PStates seem like reactive data structures that are also durable/replicated, these are meant to supersede your database and indexes, letting you build custom purpose-built indexes that contain 100M elements:
> “partitioned states” are how data is indexed in Rama ... Unlike existing databases, which have rigid indexing models (e.g. “key-value”, “relational”, “column-oriented”, “document”, “graph”, etc.), PStates have a flexible indexing model. In fact, they have an indexing model already familiar to every programmer: data structures. A PState is an arbitrary combination of data structures. ... nested data structures can efficiently contain hundreds of millions of elements. For example, a “map of maps” is equivalent to a “document database”, and a “map of subindexed sorted maps” is equivalent to a “column-oriented database”. Any [composition] is valid – e.g. you can have a “map of lists of subindexed maps of lists of subindexed sets”.
Query: once you develop PStates to aggregate relevant data into a custom index of the right ... shape?, query seems sorta like GraphQL selectors over your custom index:
> Queries in Rama take advantage of the data structure orientation of PStates with a “path-based” API that allows you to concisely fetch and aggregate data from a single partition
> “query topologies” ... real-time distributed querying and aggregation over an arbitrary collection of PStates. These are the analogue of “predefined queries” in traditional databases, except programmed via the same Java API as used to program ETLs and far more capable.
636.
Lineworkers: Keeping America's Lights On(contrary.com ↗)
1 points · by dustingetz · 3y ago · discuss
comment 3y ago · link · parent
> Is everything a grift though?
https://en.wikipedia.org/wiki/Principal%E2%80%93agent_proble...
Note I used the word "perception" three times in my comment.
"In mass communication, the important thing is not how things are but how they seem to be." https://en.wikipedia.org/wiki/Wiio%27s_laws
comment 3y ago · link · parent
comment 3y ago · link · parent
643.
Types and Effect Systems (1999) [pdf](imm.dtu.dk ↗)
3 points · by dustingetz · 3y ago · discuss
646.
Golem Cloud: durable serverless workflows coded in any lang that supports WASM(golem.cloud ↗)
4 points · by dustingetz · 3y ago · 1 comment
comment 3y ago · link · parent
The traffic here is "program debug state" — the electric callback was called on the client, so the client informs the server of this in case the callback has server regions. As you rightfully point out, there are in fact no server regions in that callback — and this is known at compile time — so there is no need to actually send that information, it is pure overhead.
The missing optimization is basically dead code elimination – we simply haven't gotten to it yet.
Note that the traffic is broadcast, not request/response, which means the user experiences no latency as the client is not awaiting any response from the server, it is simply keeping the server informed. Due to this, broadcasting "program debug state" like this is basically free, which is why we consider this optimization premature. We are much more interested in visible perf issues (how fast it "feels").
FWIW we are unhappy with dom/on (used in that tutorial) and it is about to be superseded, and the chattiness you observed is derived from one of the aspects of the design that we are fixing (there should not be a callback at all, the input should return its reactive state directly.) But to be clear the pattern is perfectly functional, it doesn't have bugs, and users are succeeding with it.
comment 3y ago · link · parent
discord uses websockets, here are some more links: https://www.reddit.com/r/elixir/comments/pophiz/server_specs...
we'll have seamless reconnect soon, which means the ws connections can actually drop when inactive (no heartbeats!) and then reconnect when the client wants something, so the forum use case should be quite fine. Not everything needs to be realtime server push, so refactor your code so that queries run on page nav or something. Electric is network transparent but that doesn't mean the network is opaque, the reactivity graph is in userland control (as declared by your AST) and the network data flow is implied by that same AST, same reactivity graph!
comment 3y ago · link · parent
we use tailwind in IRL projects
comment 3y ago · link · parent
comment 3y ago · link · parent
wire protocol is in verbose mode, we have a binary mode as well. it’s also not optimized at all because users already report tangible performance as “incredible” “unbelievable” as compared to the status quo graphql or http RPC or whatever. remember, http transport pays a TCP round trip just to syn/ack the connection before any app payload is sent! Electric wire traffic is also differential, i.e. collections are never sent twice only what changed.
comment 3y ago · link · parent
comment 3y ago · link · parent
the thing predating Electric is in prod at a series B startup, a series A startup is going live with a prod support app in a few weeks, and a seed stage startup is planning a rewrite of a consumer facing productivity tool onto electric after serious evaluation. Plus many serious POCs i’ve seen maybe 2-3 dozen repos this summer. (we only see them when they have a question)
comment 3y ago · link · parent
comment 3y ago · link · parent
"Thinking Fast and Slow" has a whole chapter on this with ample evidence