简体   繁体   中英

use integrated database in angular.js

I am making an application in ionic. I'm trying to create a mobile app. now I get a web request ($http) with more than 17000 records JSON objects. I can not use localStorage to store them. then I decided to use an application such as SQLite, or minimongo. I recommend that tool to integrate into my application ?. I want to optimize the management of more than 17 thousand json I get objects.

You could send all 17,000 JSON objects back, but that extremely inefficient and I don't recommend doing that. There is no tool that is going to speed up a gigantic HTTP request like this.

Do you have to have all of them at the same time? A better way would be to implement some sort of pagination and dynamically load the data that you need. Twitter is a perfect example: Imagine if Twitter loaded your entire feed, all the way back to when you first created your account? That would be an immense amount of data. Rather, it loads the first 50 tweets or so, and uses infinite scroll to dynamically load the tweets as you scroll down.

This requires making an HTTP request for each new page of data that you need. With something like this in Angular, I'm guessing you are making use of ng-repeat, which has very large performance issues when it comes to displaying a lot of data at once like this. Just another argument for paginating :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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