The service interface makes it easy to implement a wrapper that connects to a database. Which is exactly what we have done with the Feathers database adapters. Using those adapters it is possible to create a database-backed REST and real-time API endpoint, including validation in a few minutes!
Instead of coming up with our own ORM and validation system our official database adapters simply wrap many of the great ORM/ODM solutions that already exist. Feathers currently supports Mongoose, Sequelize, KnexJS, Waterline and LevelUP as well as standalone adapters for in-memory and NeDB. This allows you to use the following databases, among many others:
- AsyncStorage - feathers-localstorage
- localStorage - feathers-localstorage
- Elasticsearch - feathers-elasticsearch
- Memory - feathers-memory
- NeDB - feathers-nedb
- RethinkDB - feathers-rethinkdb
- PostgreSQL, MySQL, MariaDB, and SQLite
- Oracle - feathers-knex
- Microsoft SQL Server - feathers-sequelize
- Waterline - feathers-waterline adds support for the following data stores (among others):
- Apache Cassandra
- LevelUP - feathers-levelup adds support for many backing stores including:
- Amazon DynamoDB
- Windows Azure Table Storage
- Google Sheets
Every database adapter supports a common syntax for pagination, sorting and selecting and advanced querying out of the box and can be easily extended with custom functionality. Errors from the adapters (like ORM validation errors) will be passed seamlessly to clients.
This allows you to swap databases whenever the need arises without having to change any of your querying code or validation hooks and you can even use multiple databases within the same app!