About Backendless Database¶
A database in your Backendless application consists of data tables. A table is where data of some specific kind is stored. For example, every application comes with the
Users table that stores information about the users of your app. If you are not familiar with the concept of data table, you can think about it as a spreadsheet that has columns and rows. You can create your own data tables and configure them by declaring columns and various other parameters. The combination of columns for a table is what we refer to as Table Schema, while the combination of all tables becomes the Database Schema.
Deciding what tables are needed for your app should be based on the entities the application works with. For instance, an order management app is likely to have tables such as Order, OrderItem, Product, Vendor, ShippingCompany to name a few. The columns for a table typically should match the properties of the corresponding entity. For example, a table where you store product information, may have columns such as name, description, price, manufacturer, image, etc. Every single column must have a type associated with it. The type defines the behavior and formatting of the data. For example, a column of the
INT type will store numeric data, while a column of the
STRINGtype, will contain alphanumeric values. Below is a sample schema for a table called
Person, as you can see the columns and their data types:
Similar to a spreadsheet, individual rows in a table are data records. The intersection of a row with a column may contain a value. The value must be of the data type that is assigned to the column. However, unlike a spreadsheet, database records are atomic, that is all the elements in a single row should be viewed as parts of one database record. This becomes very important as you start working with the database APIs. The image below illustrates data records for the same
Person table shown above.
When you create a table in Backendless, the APIs to work with the data records become instantly available. Most of the APIs operations operate on data objects, which is another term for data record. Everywhere in this guide the terms of data object and record refer to the same concept - a row in a data table. When a record from a table is represented as a data object, tables columns are represented as properties of the object and the values in the corresponding columns are referred to as property values.
Column data types become particularly important with the APIs. Whether you use the REST API or any of our SDKs, property values will be formatted according to the rules associated with each data type. Consider the example below, it shows a response of fetching data records using the REST API from the
Person table reviewed above:
As you can see, the formatting of the values for the