News for hackers. Stuff that matters.
Re:Ent: An Entity Framework for Go by jitl on Sunday October 30, 2022 @07:59PM (#33400386)
In a typical ORM I agree about the query builder. Most ORMs encourage the typical use of a relational database where SQL fits the domain well.

But Ent is modeling data as a graph, and the DB behind the scenes is more of an implementation detail. The production version of Ent used at Meta stores data in TAO (https://engineering.fb.com/2013/06/25/core-data/tao-the-powe... my impression is that product engineers do not write any SQL when working with Ent at Meta.

Re:Ent: An Entity Framework for Go by Fire-Dragon-DoL on Sunday October 30, 2022 @08:07PM (#33400452)
I might be misreading here, but are you suggesting that the DB behind the scenes is not modeling things in the traditional sense but rather as a graph. Thinking of postgres, this could be by dumping a big json object in a generic "graph" table. Is that the case?

That would be acceptable from my point of view. The problem is using SQL as a graph produces very inefficient queries once hitting a certain scale, but if the DB is already a graph, the problem should be limited.

Re:Ent: An Entity Framework for Go by jitl on Sunday October 30, 2022 @08:18PM (#33400517)
The way TAO (and Notion to some degree) deal with this is by tightly coupling the persisted (SQL?) data store to an in-memory cache that make KV style reads like “get foo by foo_id” extremely fast. They also limit the kinds of queries developers can write to the ones more likely to be very fast on the infrastructure.

Pushing graph queues down to a single SQL query so that the SQL DB spends massive CPU time on joins can be an issue. Instead these systems can avoid talking to the SQL DB at all for example if they’re on the happy path just chasing graph edges.

Re:Ent: An Entity Framework for Go by Fire-Dragon-DoL on Sunday October 30, 2022 @08:28PM (#33400598)
That makes sense. In a certain way, it's doing something similar to react-query
Re:Ent: An Entity Framework for Go by guggle on Monday October 31, 2022 @02:16AM (#33402583)
> the DB behind the scenes is more of an implementation detail

Ugh... what a bummer then.

Re:Ent: An Entity Framework for Go by a8m on Monday October 31, 2022 @02:28AM (#33402632)
Just to emphasize, that OSS version of Ent models SQL tables in the traditional way (edges as foreign-keys and join-tables). i.e., the database structure is not obscure or something and can be easily read by developers and ported to other ORMs in case it's needed.