Context-aware Database Viewpoints

Viewpoints are a concept that I have only mentionned in passing in try-alf's first post. They certainly deserve more thoughts: while very simple you'll be amazed by their power. In short, viewpoints are to databases (variables) what views are to relations (variables). If the last sentence sounds cryptic, just read on! To keep this post self-contained, I need to start with some basic material on views before moving on to context-awareness and database viewpoints. A general comment before starting: don't get abused by the taste of triviality; simplicity, sometimes, is that simple.

Read more

What would a functional SQL look like?

In short, probably something like this:

suppliers
  | join shipments                     # From suppliers and their shipments
  | where @city = "London"             #   among those located in London
  | select @sid, @pid, @name, @qty     #   select the ids, supplier name and shipped qty 

Before explaining this syntax, why it matters (does it?), and the advantages it has, let me explain the motivation of this work. (If you are intrigued by the functional stuff in the title and want the explanation right away, you can simply skip the next section.)

(This is the first of a - I hope long - series of posts on the design of a data manipulation language. Keep in touch by following me on twitter or asking by email to be notified when next essays appear.)

Read more

Relations as First-Class Citizen - A Paradigm Shift for Software/Database Interoperability

I'm happy to announce that Alf Alf 0.15.0 has just been released and with it, this web site! I've been thinking about all of this for many years, often as a cross-cutting concern in my (other) research work. I've been hacking on Alf in particular during my free time for more than two years now. I think it was time to share it in a slightly more official way than as an (almost invisible) open-source research prototype on github. Recent personal events gave it a serious boost and a few people convinced me to give it more visibility. So here we go.

Alf is a modern, powerful implementation of relational algebra. It brings relational algebra where you don't necessarily expect it: in shell, in scripting and for building complex software. Alf has an rich set of features. Among them, it allows you to:

  • Query .json, .csv, .yaml files and convert from one format to the other with ease,
  • Query SQL databases with a sounder and more powerful query language than SQL itself,
  • Export structured and so-called "semi-structured" query results in various exchange formats,
  • Query multiple data sources as if they were one and only one database,
  • Create database viewpoints (mostly read-only viewpoints for now), to provide your users with a true database interface while keeping them away from data they may not have access to,
  • Enjoy a rich set of relational operators and even define your own high-level and domain-specific ones.

Alf is very young and not all of the advanced features are stable and/or documented. I plan to spend some time in the next weeks and months to work on them, so stay tuned. In the mean time, you can play with Alf on this website, install Alf 0.15.0 and start playing with it on your own datasets and databases, in shell or in ruby. I'll come with advanced material on this blog as soon as possible, I promise.

The rest of this post explains the context of this work and why it exists in the first place, in the form of a (very accessible) scientific paper (this writing style is also a test, let me know what you think). The following section provides a short overview of the proposed approach, explaining the title of this blog post. We then detail Alf's proposal, first with a short example illustrating the advantages compared to existing solutions, then with a more theoretical presentation covering three main questions: why true relational algebra?, what type system to expose?, and why not classes and objects?. Alf's limitations and features to come are then briefly discussed, before concluding.

Read more