How to reset database?

I am new to Ceramic and have been playing around with ComposeDB on localhost for a week now, and I have some data saved in the database, and if I want to start over with a fresh database, is there any ComposeDB command to use for resetting the database?

Ok, I just deleted .ceramic folder, but curious if is there a better way to do this.

Hey @autsada. Your approach is right. If you don’t want to start completely from scratch (configuring your daemon.config.json file) you can just delete indexing.sqlite and statestore files inside of the .ceramic directory. This is the approach you can use for resetting your work on your local node.

As you keep learning how to build apps using Ceramic, I would also suggest looking into Data Storage a bit more. This is more relevant once you get closer to the production stage of your app though: Data Storage | ComposeDB on Ceramic

1 Like

Thank you @Justina
I will check the link as I plan to move my node to the cloud for testing soon, one thing that I am not quite clear about is how the users of my app query their data without going through my app, for example, if the app was shut down for some reason, my question is how users can access their data if my app and node are gone?
If I store data on Ethereum, users can access that data via some node (such as Alchemy for example) so they don’t need to rely on my app, but how about Ceramic. Can you please help explain or suggest some documents for me to check?

In general, all data that is stored on Ceramic Network is publicly readable (unless data is encrypted with tools like Lit). So as long as there is at least one node running that stores the data, your data will be available. In production case, node operators can pin and unpin streams - this allows them to choose which data should be persisted on their node.
If your node goes down, and it was the only node that had specific streams pinned, those data streams will not be available to other network participants. There are a few options for how developers can mitigate these risks:

  • Run multiple IPFS nodes and pinning the same streams
  • Archiving data commits into a long-lived persistence state (e.g. using Filecoin or S3)

You can read more details on this here: Data Availability - Ceramic Developers as well as initial Data Storage link I shared :slight_smile:

I see, just to clarify my understanding if my data is stored only on my node it’s no different than using a traditional Postgres database because both are centralized unless I run multiple nodes or have other nodes pin my data, is this correct?
Thank you for the explanation and links.

Using ComposeDB, all data is associated with a Model. If a user or another app wants to access the data created through your app without using your node, they can just run a node that indexes the same set of Models. Then their node will sync and maintain the data from your node on their node, creating redundancy of the data on the network and allowing direct queries against that node for any of the data within that Model.

Yes, I understand this, I will need to somehow have other nodes sync and maintain my data so it can be accessed without solely going through my only node. Thank you for the clarification.