Tiles, Definitions and Schemas

I’m creating this topic to know if I’m getting right some concepts and if I’m heading the right path.

You can think a model as the composition of Tiles, Definitions and Schemas (TDS) where:

  • Schema defines the structure that’s the tiles are going to have
  • Definition is a description of the model
  • Tiles are the records of the model.

I’m using the glaze libraries so I’ll refer to their modules and libraries.

  • ModelManager is used to create a model
  • DataModel class is used to add/read TDS from a specific model already created
  • DIDDataStore is used to manage and interact with TDS once you can address them (you can’t create them with this class)

So…
My specific use case is to create 2 models:

  • one where we save users info
  • one where users save their products info

Both needs to be public.

I’ve started following the note-taking app with Glaze tutorial (Build a note-taking app with Glaze - Ceramic Developers) the problem arrives when I try to save a new Tile with:

const newNote = await model.createTile('SimpleNote', { text: 'My new note' })

because when I try to retrieve it with

const exampleNote = await model.loadTile('SimpleNote')

I’m getting that it doesn’t exist. Even when I run them one right after the other.
The only docs I found for DataModel is this DataModel module - Ceramic Developers . But I can’t come with nothing. It seems that I need to update the model anyhow but idk.

Also another odd thing for my mind is that I’m getting the model from a .json .

I’d really apreciate a feedback if I’m going on the correct path for my use case and where can I get more resources keep going.

Thank you so much :green_heart:

@julianPerassi, thanks for your question.

We’re excited to be launching a much more usable and sophisticated way to create and compose models via our new ComposeDB framework. The developer preview has just been launched and we’re working hard on a production-ready version that’s also coming soon.

Please take a look here and let us know how it works for you!

Here’s Justina’s post soliciting feedback, which you’re very welcome to provide once you’ve had a chance to experiment with ComposeDB.