Overview¶
Kinto is a lightweight JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host.
Kinto is used at Mozilla and released under the Apache v2 licence.
Use cases¶
- A generic Web database for frontend applications.
- Build collaborative applications with fine-grained permissions.
- Store encrypted data at a location you control.
- Synchronise application data between different devices.
Key features¶
Synchronisation | Offline-first JS client |
Fined grained permissions | Plug multiple clients |
Open Source and Self-hostable | Designed in the open |
Also
- HTTP best practices
- Pluggable authentication
- Pluggable storage, cache, and permission backends
- Configuration via a single INI file
- Built-in monitoring
Coming soon
- Schema validation
- Push notifications
Synchronisation¶
Bi-directionnal synchronisation of records is a very hard topic.
Kinto takes some shortcuts by only providing the basics for concurrency control and polling for changes, and not trying to resolve conflicts automatically.
Basically, each object has a revision number which is guaranteed to be incremented after each modification. Kinto does not keep any history.
Clients can retrieve the list of changes that occured on a collection of records since a specified revision. Kinto can also use it to avoid accidental updates of objects.
Note
Kinto synchronisation was designed and built by the Mozilla Firefox Sync team.
Comparison with other solutions¶
Before we started on Yet Another Data Storage Service, we took a look at what was already out there, with a view to extending an existing community project (rather than reinventing the wheel). In the end, the solutions we reviewed didn’t quite solve the problems we had - notably regarding fine-grained permission settings.
What follows is a comparison table showing how Kinto stacks up compared to some other projects in this space.
Project | Kinto | Parse | Firebase | CouchDB | Remote-Storage |
Fine-grained permissions | ✔ | ✔ | ✔ | ||
Easy query mechanism | ✔ | ✔ | ✔ | [1] | [2] |
Conflict resolution | ✔ | ✔ | ✔ | ✔ | ✔ [3] |
Validation | ✔ | ✔ | ✔ | ✔ | |
Revision history | ✔ | ||||
File storage | ✔ | ✔ | ✔ | ||
Batch/bulk operations | ✔ | ✔ | ✔ | ||
Changes stream | [4] | ✔ | ✔ | ✔ | |
Pluggable authentication | ✔ | ✔ | [5] | ||
Pluggable storage / cache | ✔ | ✔ | |||
Self-hostable | ✔ | ✔ | ✔ | ||
Decentralised discovery | [6] | ✔ | |||
Open source | ✔ | ✔ | ✔ | ||
Language | Python | Erlang | Node.js [7] |
[1] | CouchDB uses Map/Reduce as a query mechanism, which isn’t easy to understand for newcomers. |
[2] | Remote Storage allows “ls” on a folder, but items are not sorted or paginated. |
[3] | Kinto uses the same mechanisms as Remote storage for conflict handling. |
[4] | Notifications support is currently in the work. |
[5] | Remote Storage supports OAuth2.0 implicit grant flow. |
[6] | Support for decentralised discovery is planned but not implemented yet. |
[7] | Remote Storage doesn’t define any default implementation (as it is a procol) but makes it easy to start with JavaScript and Node.js. |
You can also read a longer explanation of our choices and motivations behind the creation of Kinto on our blog.
FAQ¶
How does Kinto compares to CouchDB / Remote Storage?¶
Before starting to create yet another data storage service, we had a long look to the existing solutions, to see if that would make sense to extend the community effort rather than re-inventing the wheel.
It appeared that solutions we looked at weren’t solving the problems we had, especially regarding fine-grained permissions.
To see how Kinto compares to these solutions, read the comparison table.
Can I encrypt my data?¶
Kinto server stores any data you pass to it, be it encrypted or not. We make it easy to use encryption in our Kinto.js client using transformers.
Is there a package for my Operating System?¶
No, but it’s a great idea. Packaging is hard and we’re a small team, so if you’d like to help us out by maintaining packages for your favourite OS, we’d be delighted to collaborate with you!
That said, Kinto is easy to install with pip and we’ve got an image set up on the Docker hub, too.
Why did you chose to use Python rather than X?¶
We know and love Python for its simplicity and short learning curve, so it was an obvious choice for the development team. In addition, the Operations team at Mozilla is comfortable with deploying and managing Python applications in production.
However, the protocol and concepts behind Kinto don’t rely on Python per se, so it is possible to have other Kinto implementations using other languages.
Is it Web Scale?¶
YES™. Have a look at the /dev/null
backend. ;-)
Can I store files inside Kinto?¶
No. Kinto is a JSON storage service and is not designed to store arbitrary files. We’d be open to exploring file storage should a solid use-case present itself in the future; however, at this time, it’s not on our roadmap.
What is Cliquet? What is the difference between Cliquet and Kinto ?¶
Cliquet is a toolkit for designing micro-services. Kinto is a server built using that toolkit.