简体   繁体   English

在移动应用程序上使用Lokijs的大型数据库

[英]Large database with Lokijs on Mobile App

Recently I come across with lokijs and I am planning to use it for my hybrid mobile app developed using Ionic. 最近我遇到了lokijs,我打算将它用于我使用Ionic开发的混合移动应用程序。 From my understanding, it is an in-memory database that will executes very fast. 根据我的理解,它是一个内存数据库,执行速度非常快。 So, my questions is, will it work great with big database (maybe around 10-50MB or even more)? 所以,我的问题是,它是否适用于大型数据库(可能大约10-50MB甚至更多)? Does working with big database using lokijs will dramatically slow down the app? 使用lokijs使用大数据库会大大减慢应用程序的速度吗?

The only operation that may result in a dramatic slow down is the periodic save of the db, as at the moment LokiJS does not support incremental saves, so the whole db is serialized. 唯一可能导致速度显着减慢的操作是定期保存数据库,因为目前LokiJS不支持增量保存,因此整个数据库被序列化。 Beware of size limits when working with IndexedDB or localStorage, if you need unlimited resources then an fs adapter like lokijs-cordova-fs-adapter will do the trick. 使用IndexedDB或localStorage时要小心大小限制,如果你需要无限的资源,那么像lokijs-cordova-fs-adapter这样的fs适配器就能解决问题。 Retrieval of documents even on large dbs, if properly indexed, should be still very fast. 即使在大型dbs上检索文档,如果索引正确,仍然应该非常快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM