Will Glitch reset my lowdb file?

So, Glitch updates the nodejs server once every 15 minutes. But my discord bot uses an dashboard I made which uses an database file (of course). But will Glitch update over the database file and therefor resetting it?

Hi Kiron! Lowdb looks pretty cool!

Glitch does not update the nodejs server every 15 minutes. Glitch projects wake on traffic (to the editor or http traffic) and then stay awake for around 5 minutes - though this can vary - and then go to sleep.

The Glitch file system is persistent, but in-memory storage is not persistent. I can’t promise you that lowdb will persist since you might be using lowdb in-memory like this: https://github.com/typicode/lowdb/tree/master/examples#in-memory

but if you’re persisting your lowdb to the filesystem, then it will be persistent.

Hope this helps,


I used https://github.com/typicode/lowdb/tree/master/examples#cli, so guess it’ll work then.

I get my lowDB reset every time I change the code in app.js - Is that a feature or am I implementing it wrongly?

My code is like below

const low = require('lowdb'),
  FileSync = require('lowdb/adapters/FileSync'),
  adapter = new FileSync('.data/db.json'),
  db = low(adapter);

Well it turned out that the key I used “users” is a preserved keyword. All data inside “users” get cleared each time run code to connect to lowdb.
Thanks !

PS: IDK why they use a preserved keyword in the code example ???

1 Like