Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Impressive! An entire article about semantic layers, artfully avoids ever defining what a semantic layer is.

Let me take a swipe at it: a semantic layer helps express queries and their results in terms the end-consumers will care about / prefer to reason in, instead of whatever extremely correct and efficient atrocities the database nerds came up with.

Did I get that right?





Sounds good to me! Semantic layers help expose a more user-friendly view of the data, so it is easier to ask business questions and get accurate results. More technically, it brings modularity and reusability to SQL. Things like joins, aggregate functions, and dimensional expressions are encapsulated as new fields/objects. Typically this logic is rendered at query time rather than pre-computed and materialized. The advantage of that is more flexible iteration and composability. In essence they are highly glorified SQL templating engines.

Julian Hyde (Apache Calcite, Google) gave a crisp presentation on this and how SQL could express 'measures' to bridge the gap: https://communityovercode.org/wp-content/uploads/2023/10/mon...

> A semantic layer, also known as a metrics layer, lies between business users and the database, and lets those users compose queries in the concepts that they understand. It also governs access to the data, manages data transformations, and can tune the database by defining materializations.

There's also now a paper: https://arxiv.org/pdf/2406.00251


Thanks for your hint, I added the definition of it to the article.

From the article:

> There's a lot of information out there, including from myself about the history and rise [2022], comparing it to an MVC-like approach, or explaining its capabilities. That's why in this article I focus on the why and showcase how to use it in a practical example in the next chapter.

[1] https://www.ssp.sh/blog/rise-of-semantic-layer-metrics/ [2] https://cube.dev/blog/exploring-the-semantic-layer-through-t... [3] https://cube.dev/blog/universal-semantic-layer-capabilities-...

My one line definition that I use atm:

> A semantic layer acts as an intermediary, translating complex data into understandable user business concepts. It bridges the gap between raw data in databases (such as sales data with various attributes) and actionable insights (such as revenue per store or popular brands). This layer helps business users access and interpret data using familiar terms without needing deep technical knowledge. https://www.ssp.sh/brain/semantic-layer#semantic-layer-defin...

Edit: I'm the OP.


I started writing another comment and after looking at your links and was about to quote the definition at the top of "The Rise of the Semantic Layer" as a suggestion, but I realized that it actually isn't that far off, information-wise from the definition youve provided here.

So I took a step back and tried to think about why one "feels" to a reader more like a definition than the other. I think it comes down to phrasing more than informational content. The definition you provide in your comment comes off, for lack of a better term, too much like a sales pitch.

Less is more when it comes to definitions, at least for defining terms in articles/blog posts like these.

Here's my attempt at a better (for this use case) definition:

A semantic layer is an interface to data stores that is designed to be queryable in terms relevant and familiar to those with knowledge of the business domain.


Thanks for your thoughtful comments. I actually refine and update my definition, that's why it is similar.

> A semantic layer is an interface to data stores that is designed to be queryable in terms relevant and familiar to those with knowledge of the business domain.

Sounds good to me, but I think it's too simplified. A semantic layer, IMO, does more. See Julian Hyde's definition, which is also similar to mine, and more involved as well:

> A semantic layer, also known as a metrics layer, lies between business users and the database, and lets those users compose queries in the concepts that they understand. It also governs access to the data, manages data transformations, and can tune the database by defining materializations.

> Like many new ideas, the semantic layer is a distillation and evolution of many old ideas, such as query languages, multidimensional OLAP, and query federation.

I appreciated your feedback. Will think a little more about it.


That's what it does, but that doesn't tell us what it is.

Defining a car as "a vehicular conveyance that helps people get from A to B" is similarly technically correct, but provides little help to the reader in determining if the thing they're looking at is a car or not.


I don't think this qualifies as a definition.

Came to make the same comment. I got through like 12 paragraphs, and it still hadn't explained what a Semantic Layer is, so I gave up



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: