cheatcode / joystick

A full-stack JavaScript framework for building stable, easy-to-maintain apps and websites.
https://cheatcode.co/joystick
Other
209 stars 11 forks source link

Migrate TuskDB to be @joystick.js/db #347

Closed rglover closed 2 months ago

rglover commented 1 year ago

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 commented 1 year ago

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 commented 9 months ago

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 commented 2 months ago

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.