Icon

SQL Layer

Scalable. Fault-tolerant. SQL.

The SQL Layer is an ANSI SQL engine that stores its data in the Key-Value Store, inheriting its incredible properties. It is best suited for operational (OLTP) applications with high concurrency.

We're very excited about FoundationDB's database technology—it will not only keep our users up and running with built-in fault tolerance but also provide a scalable and easy-to-deploy solution.

Sean Schofield, CEO of Spree Commerce

Exceptional fault tolerance

No more worrying about down time. The SQL Layer runs statelessly on every app server and stores all data in the Key-Value Store, inheriting its remarkable qualities.

Read more about the architecture →

Architecture

Horizontal scale at every level

The SQL Layer looks like a single SQL database to your application, but it's actually a stateless "layer" that translates and stores all data in the Key-Value Store. This architecture provides you with scalability and fault-tolerance at both your application and data tiers.

Read more about the architecture →

Scalability-layers

SQL Layer's Table-Groups architecture gives way to an impressive new feature: Nested SQL, which is totally unlike any other SQL concept I've seen. With this approach, FoundationDB has found a way to integrate the concept of loading a hierarchical "document" ala NoSQL within a fully relational style of querying, giving rise to the best data/query ratio you can get for this style of loading.

Michael Bayer, creator of SQLAlchemy

Revolutionary features

Designed for a distributed world, the SQL Layer supports such features as hierarchical modeling of relational tables that bridge the gap between SQL and objects, the ability to access data as JSON documents using nested SQL, deeply pipelined parallel execution of queries, and much more.

Read about all SQL Layer features →

Strong ORM integration

Whether you have an existing app or are building a new one, we want you to use whatever ORM you're comfortable with. ActiveRecord, Django, Hibernate, and many others are already supported.

See the full list of supported ORMs →

  • Ruby on Rails app
    # Gemfile
    gem 'pg'
    gem 'activerecord-fdbsql-adapter'
    
    # config/database.yml
    development:
      adapter: fdbsql
      host: localhost
      port: 15432
      database: sample_development
    Read the ActiveRecord docs →
  • Django app
    $ sudo pip install django-fdbsql
    
    DATABASES = {
      'default': {
        'ENGINE': 'django_fdbsql',
        'NAME':   'mysample',
        'HOST':   'localhost',
        'PORT':   '15432',
      }
    }
    Read the Django docs →
  • SQLAlchemy app
    $ sudo pip install sqlalchemy-foundationdb
    
    # app.py
    import sqlalchemy
    
    sqlalchemy.create_engine(
      "foundationdb+psycopg2://user@localhost:15432/"
    )
    Read the SQLAlchemy docs →
  • Java Hibernate
    # pom.xml
    <dependency>
      <groupId>com.foundationdb</groupId>
      <artifactId>fdb-sql-layer-hibernate</groupId>
    </dependency>
    
    # hibernate.properties
    hibernate.dialect=org.hibernate.dialect.FoundationDBSQLDialect
    hibernate.connection.driver_class=com.foundationdb.sql.jdbc.Driver
    hibernate.connection.url=jdbc:fdbsql://localhost:15432/sample
    Read the Hibernate docs →

Open source

It's all on GitHub. See how it works and watch the activity. We take pull requests seriously so feel free to get involved.

View the project on GitHub →

Octocat

Download and use it now

The SQL Layer depends on the Key-Value Store Client and stores its data in a cluster of one or more Key-Value Store Servers.