什么是Sembast?
Sembast是可用于DartVM和Fluutter的NoSql数据库。Sembast是基于文档的数据库,并且支持加密。
对于NoSql数据库的使用者来说,最大的吸引力莫过于易扩展了。相对于关系型数据库,开发者不必疲于维护数据字段或者表结构升级等繁琐的工作。尤其对于Flutter来说,作为一个客户端技术热更新技术是一直被使用者诟病的方面,所以发版前保证更新后的应用能正常使用是一个非常关键的工作,这对开发和测试团队带来了不小的挑战。比如我们常用的SqlLite数据库,一旦客户端升级过后,数据库升级带来不可逆的错误,可能导致用户必须卸载重装才能修复,这导致涉及数据库开发的功能测试一定会慎之又慎。
今天这篇文章是对NoSql数据库Sembast的使用做一个初步的探索。
Sembast特性
Yet another NoSQL persistent store database solution for single process io applications. The whole document based database resides in a single file and is loaded in memory when opened. Changes are appended right away to the file and the file is automatically compacted when needed.
Works on Dart VM and Flutter (no plugin needed, 100% Dart so works on all platforms - MacOS/Android/iOS/Linux/Windows). Inspired from IndexedDB, DataStore, WebSql, NeDB, Lawndart...
Supports encryption u