8 Home
Tato edited this page 2025-08-02 21:17:18 +00:00

Need further help?

Feel free to join us in our community server!

So what is this "grapes" thing anyway?

Grapes is a poorly-written, self-proclaimed "database" made entirely using only Python 3.10 out of all things.

Grapes comes with many types of databases:

  • The GrapesDatabase (otherwise known as Vanilla) is a simple database that stores all of its information in a data directory. It keeps a consistent definition.bin file that keeps track of every table's columns, etc. Each table is a table.grape file, and information is fetched or written directly from these files as needed. Every set of data is a tuple.

  • Next, the InMemoryGrapesDatabase (also referred to as Chrome) inherits from the GrapesDatabase class but makes a few key changes:

    1. All data is stored in RAM instead of accessing the files it needs for every request.
    2. Data is written periodically (as defined by the write_rate property in its __init__() function).
    3. Only modified data is written (the definition file is also updated a lot more frequently)
    4. Outsider modifications to the table files without the use of the class or from another instance running in the same directory will not be considered when performing a get request on the data.

This class does not fail to be quite memory hungry, especially the bigger the dataset you are working with is, hence the nickname Chrome. This class will also be much faster in performing its write and get requests; however faces potential data loss if not properly used, and especially in case of sudden shut-downs could lose all of the data written to it in the last 120.0s (depends on the write rate you set). When executing programs that will exit before your set write rate can execute, a write_all_data() method has been provided.