joystick icon indicating copy to clipboard operation
joystick copied to clipboard

Migrate TuskDB to be @joystick.js/db

Open rglover opened this issue 2 years ago • 2 comments

I wrote a simple in-memory database not too far back and published it as @tuskdb/node. This was mostly to help with Push deployments, but I'd like to incorporate this into Joystick proper.

I'd also like to add Tusk as a default DB option for Joystick apps. The only piece missing is a simple server to handle a write queue so the database doesn't fall out of sync. Other than that, it'd be a great option for apps/sites that don't have a ton of data and want an easy to manage/query database (Tusk mimics the MongoDB query language).

rglover avatar Sep 26 '23 17:09 rglover

When doing this, make sure that changes to the json files are reflected in memory (use a watcher). Just found an issue where deleting the log file on disk doesn't clear memory, so the file is rewritten with the full in-memory DB on the next log.

rglover avatar Sep 28 '23 14:09 rglover

This should be available as the default database option for new Joystick apps. The idea being that you can start playing around without having to install a third-party database. It should be performant enough that you could run a small blog or static site with < 100K posts and never get a performance hit. Technically already there but needs some polish and testing.

rglover avatar Dec 14 '23 20:12 rglover

I've come up with an alternative plan for this. There will be a database option, but will be more robust and scalable for the majority of apps built w/ Joystick (not just a toy/demo DB). Closing this for now.

rglover avatar Jul 23 '24 19:07 rglover