我正在使用node.js将大量数据聚合到EC2 Micro实例上的Firebase中。该应用程序扫描照片的一些来源,并维护每个照片的元数据的Firebase,如URL,大小,来源,“喜欢”等。限制Firebase内存中缓存
我还保留一些聚合索引更新(按日期,由喜欢等)。实际的代码是非常简单的:
var db = new Firebase('https://my.firebaseio.com')
// Whenever the aggregator updates a photo, update the popularity inedx
db.child('photos').on('child_changed', function(snapshot) {
var instagram = snapshot.child('likes/instagram').val() || 0,
facebook = snapshot.child('likes/facebook').val() || 0,
likes = instagram + facebook
// Update popularity index
db.child('index/popularity').child(snapshot.name()).setWithPriority(true, likes)
})
由于我的实例(t1.micro)仅有的可用我跑出来的RAM作为火力地堡缓存photos
收集的所有孩子RAM 615mb他们正在更新,而。
有没有一种方法可以防止Firebase利用其内存中的缓存耗尽所有可用的RAM?