After reading this article you will know:
- What a data model is used for
- What a data model mainly consists of
- Some sample uses for each kind
The data model is where the application stores all the information. A single model represents a part of this. The data model in your application is a visual tool with an intuitive interface. It has the following elements: models, properties, and relations.
What is the data model used for?
The application's data is defined and stored in the data model so we can use it for other application elements, as for application actions. It is the backbone of all application types you can build with the Betty Blocks platform. It describes all the data in an abstract way and hides unnecessary complexity to increase speed and flexibility. No technical knowledge of databases is needed as writing queries. The data model is visually built (drag and drop). We are taking care of the underlying database.
The data model is logically split up into multiple models, properties and relations:
Models are as real-world objects that can be uniquely identified. A model exists either physically or logically as a concept because of something as Customer, Course, or Account. The name of every model is written as a singular noun. Every new application starts automatically with two models: Role and User.
Properties are information items and live in models. Every property has a data type. The data type defines the kind of data which the property holds as a number, text (string) or price type. Every new model starts automatically with three properties: created at, updated at, and Id. The id property uniquely identifies every object in a model. See our Property Reference for all different types.
Models can be related to one another with relations. These relations are associations that models can have. Customers and Orders are related models. One Customer could have various Orders and an Order is related to one Customer. The relation type indicates the number of related objects in a model. There are the three kinds of relations: has many, belongs to and has and belongs to many.