How do databases work on glitch?

Hi @DangerCow, welcome to the Glitch forum!

I’m not sure if you’re still looking for an answer to this question, but just in case, you say you looked at the help doc for databases so I presume you looked at https://glitch.com/help/db/ and the collection of database-related projects at https://glitch.com/storage.

You’re curious about how databases work, and that’s probably a bigger topic than can easily be covered here, but many of the sample projects in that list share similar features. A database system generally has three components:

  1. A place to store the data and a way to tell your code where to find the data file
  2. A way to write information to the database
  3. A way to read information out of the database

Each different database system is going to have a different set of commands to do those things, so it’s hard to be more specific without knowing which database technology you’re going to use. A good example for something relatively straightforward like storing links could be something like lowdb as shown in https://glitch.com/~low-db. An intro to how lowdb works and some of the commands available can be found at https://github.com/typicode/lowdb.

We’d be happy to answer more detailed questions if those resources leave you with some.

4 Likes