• Stars
    star
    425
  • Rank 102,094 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Analytical database for data-driven Web applications 🪶

Seafowl

CI Docker Pulls Docker Image Size (latest by date) GitHub all releases GitHub release (latest by date including pre-releases)

Home page | Docs | Benchmarks | Demo | Nightly builds | Download

Seafowl is an analytical database for modern data-driven Web applications.

Its CDN and HTTP cache-friendly query execution API lets you deliver data to your visualizations, dashboards and notebooks by running SQL straight from the user's browser.

Features

Fast analytics...

Seafowl is built around Apache DataFusion, a fast and extensible query execution framework. It uses Apache Parquet columnar storage, adhering to the Delta Lake protocol, making it perfect for analytical workloads.

For SELECT queries, Seafowl supports a large subset of the PostgreSQL dialect. If there's something missing, you can write a user-defined function for Seafowl in anything that compiles to WebAssembly.

In addition, you can write data to Seafowl by:

...at the edge

Seafowl is designed to be deployed to modern serverless environments. It ships as a single binary, making it simple to run anywhere.

Seafowl's architecture is inspired by modern cloud data warehouses like Snowflake or BigQuery, letting you separate storage and compute. You can store Seafowl data in an object storage like S3 or Minio and scale to zero. Or, you can build a self-contained Docker image with Seafowl and your data, letting you deploy your data to any platform that supports Docker.

Seafowl's query execution API follows HTTP cache semantics. This means you can put Seafowl behind a CDN like Cloudflare or a cache like Varnish and have query results cached and delivered to your users in milliseconds. Even without a cache, you can get the benefits of caching query results in your user's browser.

Quickstart

Start Seafowl:

docker run --rm -p 8080:8080 \
    -e SEAFOWL__FRONTEND__HTTP__WRITE_ACCESS=any \
    splitgraph/seafowl:nightly

Or download it from the releases page and run it without Docker:

SEAFOWL__FRONTEND__HTTP__WRITE_ACCESS=any ./seafowl

Add a Parquet dataset from HTTP:

curl -i -H "Content-Type: application/json" localhost:8080/q -d@- <<EOF
{"query": "CREATE EXTERNAL TABLE tripdata \
STORED AS PARQUET \
LOCATION 'https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2022-01.parquet';
CREATE TABLE tripdata AS SELECT * FROM staging.tripdata;
"}
EOF

Run a query:

curl -i -H "Content-Type: application/json" localhost:8080/q \
  -d@-<<EOF
{"query": "SELECT
    EXTRACT(hour FROM tpep_dropoff_datetime) AS hour,
    COUNT(*) AS trips,
    SUM(total_amount) AS total_amount,
    AVG(tip_amount / total_amount) AS tip_fraction
  FROM tripdata
  WHERE total_amount != 0
  GROUP BY 1
  ORDER BY 4 DESC"}
EOF

{"hour":21,"trips":109685,"total_amount":2163599.240000029,"tip_fraction":0.12642660660636984}
{"hour":22,"trips":107252,"total_amount":2154126.55000003,"tip_fraction":0.12631676747865359}
{"hour":19,"trips":159241,"total_amount":3054993.040000063,"tip_fraction":0.1252992155287979}
{"hour":18,"trips":183020,"total_amount":3551738.5100000845,"tip_fraction":0.1248666037263193}
{"hour":20,"trips":122613,"total_amount":2402858.8600000343,"tip_fraction":0.12414978866883832}
{"hour":1,"trips":45485,"total_amount":940333.4000000034,"tip_fraction":0.12336981088023881}
...

Documentation

See the documentation for more guides and examples. This includes a longer tutorial, following which you will:

  • Deploy Seafowl to Fly.io
  • Put it behind Cloudflare CDN or Varnish
  • Build an interactive Observable notebook querying data on it, just like this one

Tests

Please consult the dedicated README for more info on how to run the Seafowl test suite locally.

Pre-built binaries and Docker images

We do not yet provide full build instructions, but we do produce binaries and Docker images as prebuilt artifacts.

Release builds

You can find release binaries on our releases page

Nightly builds

We produce nightly binaries after every merge to main. You can find them in GitHub Actions artifacts (only if you're logged in, see this issue) or via nightly.link:

Docker images

We produce Docker images on every merge to main.

  • Release builds are tagged according to their version, e.g. v0.1.0 results in splitgraph/seafowl:0.1.0 and 0.1.
  • Nightly builds are tagged as splitgraph/seafowl:nightly

Long-term feature roadmap

There are many features we're planning for Seafowl. Where appropriate, we'll also aim to upstream these changes into DataFusion itself.

Support for JSON functions and storage

We're planning on adding the JSON datatype to Seafowl, as well as a suite of functions to manipulate/access JSON data, similar to the functions supported by PostgreSQL .

PostgreSQL-compatible endpoint

This will make Seafowl queryable by existing BI tools like Metabase/Superset/Looker.

More Repositories

1

sgr

sgr (command line client for Splitgraph) and the splitgraph Python library
Python
325
star
2

seafowl-gcsfuse

Scale to zero Seafowl hosting with Cloud Run
Dockerfile
39
star
3

splitgraph-llm-demo

Python
6
star
4

madatdata

😠 📈 Madatdata ("mad at data") is a TypeScript library for managing and querying SQL databases (so far including Seafowl and Splitgraph, but with an interface that makes it easy to add plugins for other databases).
TypeScript
6
star
5

experimental-datafusion-webassembly

proof-of-concept: compile datafusion to `wasm32-wasi` (run in `wasmedge`) and `wasm32-unknown-unknown` (run in browser)
4
star
6

open-data-monitor

A newsfeed of open government datasets, tracking when they're added or deleted. Built with data from Splitgraph, deployed to Seafowl on Fly.io
TypeScript
4
star
7

engine

Splitgraph engine Docker image packaging
Dockerfile
4
star
8

dbt-transform-example

Example of a dbt transform on Splitgraph Cloud with Github Actions
3
star
9

seafowl-udf-rust

Example User Defined Function (UDF) for Seafowl in Rust.
Rust
2
star
10

seafowl-udf-go

Example User Defined Function (UDF) for Seafowl in Go
Go
2
star
11

splitgraph.com

DEPRECATED: the marketing and documentation website is currently in a private repo. Please open any issues related to documentation in the relevant seafowl or sgr repos.
TypeScript
2
star
12

splitgraph-chatgpt-plugin

A ChatGPT plugin for searching the Splitgraph Data Delivery Network using natural language questions.
Python
2
star
13

lakehouse-loader

CLI utility to load data into Delta Lake and other lakehouse formats
Rust
1
star
14

yarn-plugin-pin-deps

Yarn plugin to pin dependencies to their currently resolved version. Available for Yarn v2 and Yarn v3
JavaScript
1
star