Blog

Mastering Backendless Database

by on April 11, 2023

Building the perfect database doesn’t have to take months or years. Backendless Database is a robust, powerful, and infinitely scalable database solution perfect for coders and no-coders alike.

In our newest ongoing video course, you will learn all of the ins and outs of our incredibly robust real-time database.

Backendless founder Mark Piller will guide you through all of the powerful functionality of our most innovative feature: Backendless Database. New videos will release each week, expanding on new topics as well as addressing your questions and feedback.

Looking for an explanation of a specific element of Backendless Database? Leave a comment below!

Whether you’re an experienced coder looking to speed up development dramatically or a no-coder looking for a truly scalable database solution, this course can help you. Watch the intro video above for more information and start the course for free today!

This course is part of the Backendless Learning Path that ends with the opportunity to become a Certified Backendless Engineer.

Ready To Build An Infinitely Scalable Database?

Begin the free course and start building with the infinitely scalable Backendless Database today.

Table of Contents

Part 1 – Data Tables, Columns and Records
Part 2 – About Data Types
Part 3 – Adding Data Records
Part 4 – String and Text Data Types
Part 5 – Multiple Choice Data Type
Part 6 – Numeric Data Types
Part 7 – Auto Number Data Type
Part 8 – DateTime Data Type
Part 9 – Boolean Data Type
Part 10 – File Reference Data Type
Part 11 – JSON Data Type
Part 12 – Money Data Type
Part 13 – Color Data Type
Part 14 – Data Import and API Setup
Part 15 – What is API?
Part 16 – Basic Data Retrieval API
Part 17 – Data Retrieval With Sorting
Part 18 – Requesting Specific Properties
Part 19 – Excluding Specific Properties
Part 20 – About the Where Clause
Part 21 – Where Clause Operators and Data Types
Part 22 – Database Functions
Part 23 – Data Paging
Part 24 – Retrieve an Object by ID
Part 25 – Object Update API
Part 26 – Object Delete API
Part 27 – Bulk Create API
Part 28 – Bulk Delete API
Part 29 – Bulk Update API
Part 30 – Object Upsert API
Part 31 – About Database Relationships
Part 32 – Data Object Relationship Column (and 1:1 relations overview)
Part 33 – Set Relationship API (1:1 Relations)
Part 34 – Bidirectional Nature of Relationships
Part 35 – One-to-Many Relations
Part 36 – Relation Retrieval API
Part 37 – Add/Set 1-to-Many Relations
Part 38 – Delete Child Relationship API
Part 39 – Many-t0-Many Relations
Part 40 – Many-to-Many Relations (3 Tables Approach)
Part 41 – Data Retrieval With a Subquery
Part 42 – Visual Schema Modeler
Part 43 – Aggregate Functions
Part 44 – Transactions Overview
Part 45 – Transaction Isolation
Part 46 – Transaction Operations
Part 47 – Transaction Operations Chaining
Part 48 – Transaction Results
Part 49 – Deep Save API

1. Data Tables, Columns and Records

In this video, we explain the core concepts of a backend database. We go over the basic elements of a database, such as tables, columns, and records. We describe how tables are similar to spreadsheets and how they are used to store data of a specific kind. We also explain that when a table is created in Backendless, it automatically provides an API for adding, retrieving, modifying, and deleting records. Finally, we also briefly introduce data types that we will go over in more detail in future videos.

2. About Data Types

In this video, we discuss the importance of data types in building logic for your application. We explain that data types directly relate to columns and records, and that they are important for both frontend and backend development. We introduce some basic data types, such as text and numbers, and explain the operations that they support. We also explain how to identify the data types for the data that you’re working with, which is done early on in the design stage of your application. Finally, we show how to create a table in Backendless Database for the properties of an entity.

3. Adding Data Records

In this video, we will be discussing different ways to add data to your Backendless Database. One way is through the Management Console, which we briefly covered in a previous video. The other way is by using the API. We will go over the mechanics of what it means to get data into the Backendless Database and how it relates to the database schema. We will also go over how to manually enter data into the database through the Management Console and how to use the API to add data to the database through a REST endpoint URL. We will also be looking at how to use the API with external systems such as UI development systems and how to format the data in JSON format.

4. String and Text Data Types

In this video, we’ll be discussing the string and text data types. Both string and text are data types that can be assigned to columns in your database tables, and they designate that those columns can store string-based information. The operations that are applicable to text include concatenation, searching within text, and checking if a substring or character is present. We’ll also go over some of the configuration parameters and demonstrate how they come into play when storing or updating data in the database. Additionally, we’ll show the difference between using a string and text data type and the effects it has on search speed.

5. Multiple Choice Data Type

In this video, we will be reviewing the multiple choice data type. This data type is special in that it internally uses the string data type, but it provides extra value by making it easier for you to make selections for values and visualize them accordingly in Backendless Console. We will review the configuration options for the multiple choice data type, such as maximum length, default value, and constraints. We will also show how to rearrange values and how to enable or disable colors. Additionally, we will demonstrate how the “use validation” option works and how it can be used to restrict acceptable values for a particular column. Lastly, we will show how to use the values/labels option and how to enable multiple selection for a column.

6. Numeric Data Types

In this video, we’ll be discussing the numeric data types. We’ll take a look at the core numeric data types: int, double, and decimal, and the ranges they support. Int is for whole numbers and supports a large range of data, double is a floating point with double precision and is not recommended for scientific data due to precision, and decimal has a fixed precision and scale. We’ll also take a look at the shortcut, money, which is a decimal with a precision of 10 and scale of 2, making it convenient to represent a fraction of currency. We’ll also show how to define and configure these data types in Backendless Console and demonstrate how to store data in the Data Browser.

7. Auto Number Data Type

In this video, we’re diving into a powerful data type called Auto Number (also known as Auto Increment). This type of data allows for values in a specific column to be automatically assigned and incremented as new records are added to the table. It’s a simple but effective concept, especially when you need to assign unique values that are easy to understand. We demonstrate how to set up an Auto Number column and highlight some key considerations to keep in mind when configuring this type of column. Additionally, we show you how to control the initial value of the column and how the database will adjust it to the next available value if you attempt to go below a previously established threshold.

8. DateTime Data Type

In this video, we will be discussing the datetime data type. We will demonstrate how to create a column of this data type and the data formats that it supports. We will also show you the kind of things that you can do to retrieve data using this data type. We will start with configuring a column, and as an example, we will take a look at the date of birth column. We will also demonstrate some examples of how to query the database with the syntax that we support. Additionally, we will show you how to store data with the datetime information and how the database automatically converts the data to the client’s time zone.

9. Boolean Data Type

In this video, we discuss the Boolean data type in the Backendless Database. Boolean values are traditionally either true or false and they may indicate whether something happened or not, whether there is a certain quality present or not, and so on. In Backendless, there is a third value that a Boolean type may contain and it is null. We will discuss when and why you may want to use this third option. Finally, we also show how to create a Boolean column in Backendless and the different options available for visualization.

10. File Reference Data Type

In this video, we will be discussing the file reference data type. The file reference data type is designed to provide the ability for your data records to reference a file that is stored somewhere, whether that be in the Backendless file storage system or anywhere on the web with a URL. We recommend using the file storage system for any use cases outside of storing JSON files and manipulating the JSON data inside of them. Backendless provides a file system that is a powerful system where you can store files in directories, upload, download, move them, delete files, and get directory listings. In this video, we’ll show how to create a reference to a file in the file storage system and how the data is returned when querying the database.

11. JSON Data Type

In this video, we’re going to be discussing the JSON data type. The database itself is a relational system that provides support for well-structured data where you can describe pretty much any entity by identifying its properties and declaring those properties as columns and the corresponding data tables as a result. However, there are some cases when any given entity may need to have additional description that does not follow a specific structure, and that’s where JSON comes in. We’ll be discussing some use cases and examples of when it makes sense to start using JSON in Backendless. We’ll also demonstrate how to create a JSON column and work with JSON documents in Backendless Console.

12. Money Data Type

In this video, we talk about the money data type available in Backendless Console. Money is a shortcut for the decimal type that is already pre-configured to express currency values with precision 10 and scale 2. That said, additional formatting may be necessary when displaying currency values in the UI, even though the actual numeric value might return from the API without a trailing zero. We’ll be discussing different ways of formatting data in an upcoming video dedicated to UI Builder – stay tuned!

13. Color Data Type

In this video, we discuss the Color data type in Backendless Database. With this data type, you can easily store and display colors for your web and mobile applications with Backendless. The Color data type is a specialized string shortcut that returns a hexadecimal value, making it simple to select and create the exact color you need. We’ll show you how to use the intuitive color selector to quickly assign properties to records or use default values if desired. We’ll also discuss how you’ll be able to use our upcoming Visualization feature to easily see all of your data properties at once.

14. Data Import and API Setup

In this video, we dive into the world of Backendless Database APIs. To start learning, we’ll need some sample data to work with. We’ve prepared a sample schema in the sample database data, which can be downloaded using the link below. In this tutorial, we’ll walk you through the process of importing the sample data into your Backendless database and give you a sneak peek of the actual data import process. By the end of this video, you’ll have a better understanding of how to import data into Backendless and how to visualize your data using the schema visual modeler feature.

15. What is API?

In this video, we are taking you through the basics of Backendless Database APIs. Before diving into the actual API lectures, we want to make sure you have a solid understanding of what APIs are and how they are structured. This will make it easier for you to understand our documentation and make you a better engineer in the process. This video will show you how to run a basic API request and take a look at its structure using REST Console and dev tools. We will also cover the elements of an API request including HTTP method, endpoint, headers, and body. By the end of this video, you will have a good understanding of the structure of API requests and responses.

16. Basic Data Retrieval API

In this video, we’ll be focusing strictly on the basics of data retrieval from the Backendless Database. We’ll be using the product table for demonstration purposes and will go through the REST Console to retrieve data. We’ll also show you how to retrieve the data using the API in an application. We’ll switch to the UI Builder where we’ll create a new page using the template for basic data retrieval. The logic for data retrieval sits on the actual page and we’ll briefly go over the on page enter handler. Finally, we’ll preview the page and see how the data is rendered in the UI.

17. Data Retrieval With Sorting

In this video, we will be discussing data sorting. Data sorting is a simple process that sorts data either in ascending or descending order, regardless of whether it’s numeric, alphanumeric, or alphabetic. The data sorting process is made easy in Backendless with the data retrieval API. We’ll also show you how to sort data from the REST console perspective and in UI Builder, the codeless alternative. The process involves identifying the columns, selecting the property to sort by, and modifying the URL with the sort by parameter. We’ll demonstrate how to sort by multiple columns and how to sort in descending order.

18. Requesting Specific Properties

In this video, we dive into the data retrieval API and explore how to request specific properties when making database queries. We demonstrate the process using both the REST Console and UI Builder, showing how to restrict the data returned to optimize performance and ensure security. We also explain the structure of the REST API and how to specify which properties you want to retrieve. Finally, we cover how this applies to relations and how it works in UI Builder, where you can instruct the backend to return only specific properties for every single object.

19. Excluding Specific Properties

In this video, we learn how to specify which properties should be excluded in a request to Backendless Database. Whether you choose to use inclusion or exclusion, it all depends on your use case. We’ll be using UI Builder to demonstrate the process, which will also work for regular APIs with our SDKs. We’ll be exploring the exclude properties connector. This connector expects a list of properties that should not be returned to the client. And to answer the burning question, what happens if you specify a property in both the property list and the exclude properties list? We’ll run the page and find out.

20. About the Where Clause

In this video, we review the power of the “where clause” in Backendless Database. We’ll discuss the structure of the where clause, starting with the most basic form of identifying a column name, operator, and value. We then cover how the where clause can get more complex by combining conditions for multiple columns using “and” and “or” logical operators. Finally, we also cover how to test and run the where clause in Backendless Console and through REST API.

21. Where Clause Operators and Data Types

In this video, we dive into the available operators for various data types in the where clause structure. From numeric data types like integers and decimals, to text data types like string and text, to datetime data types, and Boolean data types, we cover the different operators you can use to build conditions in your queries. We’ll also show specific examples of how these operators work in practice using Backendless Console.

22. Database Functions

In this video, we go through the powerful mechanism of database functions. We explain how functions can be used to transform data coming from the database and make conditions more precise, elegant, and powerful. We start with a demonstration of basic scenarios before going through a list of all the available functions in Backendless. The video covers two main uses of database functions: data transformation and use in the “where” clause. We also categorize the functions in Backendless into three categories: date-time functions, string functions, and aggregate functions.

23. Data Paging

In this video, we dive into the concept of data paging, an extremely important aspect of backend systems that has direct impact on data retrieval APIs. Data paging allows for the retrieval of larger sets of data in chunks or pages and can be controlled through the use of parameters in the data retrieval API. This technique is implemented for performance reasons, as retrieving all data at once can negatively impact both the user experience and the performance of the application.

24. Retrieve an Object by ID

In this video, we review an API that allows for the retrieval of a specific object by its object ID. The API has additional parameters that can be specified and we walk you through them in detail. We also demonstrate how this functionality can be useful in a product page scenario, where a product is identified by its object ID and displayed on a screen. We take you through the backend section to show what objects are in the data table and how they can be retrieved.

25. Object Update API

In this video, we discuss the Object Update API that enables the modification of one or more properties of an object in the database. It is different from storing a new object because the object is already in the database, with an object ID assigned to it. In Backendless Console, we demonstrate how modifications done in the data browser do not use the API. We then demonstrate how to use the API to update a record and how it can be used with any of our SDKs.

26. Object Delete API

In this video, we talk about the Object Delete API, which is an API designed to delete a specific object in the database. We identify that object with its object ID. Every single object stored in the database has its own unique ID, and that’s the ID we use to identify a specific object that should be deleted. We demonstrate how to use this API with the REST API provided by Backendless, and we also do a demo using Codeless, but it will equally apply to the API available in all of our SDKs.

27. Bulk Create API

In this video, we learn about the Bulk Create API, which allows users to save multiple objects in the database with a single API call. As an example, we’ll explore how this API can benefit users who are working on a to-do app where they need to save multiple tasks. By using the Bulk Create API, fewer API calls to the database are needed which can result in a better user experience.

28. Bulk Delete API

In this video, we will talk about the Bulk Delete API that allows you to delete multiple objects from a table. We will demonstrate how it works using the REST Console and then show an example in UI Builder. In the UI Builder example, we will show how you can select multiple records with checkboxes and delete them at once. We will also discuss the different types of where clauses you can use, including how to use the “in” operator to specify individual object IDs to be deleted.

29. Bulk Update API

In this video, we will be discussing the Bulk Update API, which allows you to update multiple objects with a single API call. You can update a single or multiple properties, and the objects to be updated are identified with the where clause identical to the way it works with the Bulk Delete API. We will be going over some animations with slides to demonstrate the mechanics of how bulk update works. Then, we’ll review that API in REST Console, and finally, there will be a demo with UI Builder and Codeless bulk update.

30. Object Upsert API

In this video, we will be discussing the Upsert API, a special API that allows you to create new objects in the database and update existing ones using the same method. The convenience of this API is huge, and there are many practical applications where you might need to use it. If your system imports data from an external source, for example, you may need to write extra logic to determine if an item already exists in the database before you can update it. With Upsert, this logic is built into the API, so you don’t have to worry about it. Object ID is a required property for both create and update, and the API uses it to determine if the object needs to be created or updated.

31. About Database Relationships

In this video, we will be discussing database relationships and their importance in making your application work seamlessly. As humans, we often take for granted the deep connections between objects and entities in our daily lives, but as developers, it is essential to recognize and capture these relationships in the data model. We will go over the different types of relationships in databases – one-to-one, one-to-many, and many-to-many – and their classifications. We will also discuss the implications of defining a relationship and the performance impact it can have on your application.

32. Data Object Relationship Column (and 1:1 Relations Overview)

In this video, we will demonstrate how to create relationship columns between two different tables using Backendless. We also explain one-to-one relationships and reconstruct the model for the person and passport entities used in a previous video. We walk you through creating a passport table and a person table with the relationship column, selecting one-to-one cardinality, and naming the column. We show how to establish the connection between the person and passport, and recommend giving the relationship column a logical name for better data retrieval.

33. Set Relationship API (1:1 Relations)

In this video, we discuss how to establish a relationship between objects using the API in Backendless. We explain the difference between establishing a relation between objects and tables, and how a relation column declares that objects in one table can be related to objects in another table. We provide an example of establishing a one-to-one relationship between the order and customer tables. We then explain the four pieces of information required to set a relationship using the API: the name of the parent table, the relation column, and the object IDs of both the parent and child objects. Finally, we show how to use the Set Relation API using Codeless in UI Builder.

34. Bidirectional Nature of Relationships

In this video, we explain an essential aspect of Backendless Database design that becomes vital when working with relationships. We highlight that relations in Backendless are bi-directional, meaning that establishing a relation between two tables creates an explicit relation from parent to child and an implicit relation from child to parent. We use the example schema between the tables “Person” and “Passport” to illustrate how the relation between objects in Backendless goes both ways. We show how to access the relation column and “pseudo” column in the console and demonstrate how to use them in queries using Backendless’ API.

35. One to Many Relations

In this video, we discuss one-to-many relationships, which is a type of relationship where one entity of one kind is related to a collection of other related entities of another kind. We provide examples such as country and cities. We demonstrate how to import a sample database to your application, which has a country and a city table with a one-to-many relationship. We show how to manage the relations, how to add and remove related objects, and how to navigate through the schema. Additionally, we discuss the design considerations when establishing one-to-many relationships, and why it is essential to consider them during the design phase.

36. Relation Retrieval API

In this video, we talk about the Relation Retrieval API and specifically focus on two-step relation retrieval. We explain that when you have one side of the relation in a one-to-many relation, and you need to retrieve related data, this becomes two-step relation retrieval. We demonstrate how to use this API in Backendless Console and show how to achieve the same functionality with REST Console. We then use UI Builder to demonstrate the API in action using data from our Country and Cities tables.

37. Add/Set 1-to-Many Relations

In this video, we will discuss an API that manages relationships between parent and child objects. Specifically, we will talk about the API that sets relationships between the parent and children, updates existing relationships, and how this works in the context of a one-to-many relationship. Since in a one-to-many relationship, one parent object may reference technically zero or more child objects, we have a collection of related children, and you can add or remove elements from this collection or reset the entire collection. We will discuss the use case of adding child objects to a collection of related children or resetting the entire collection using the add and set relation APIs.

38. Delete Child Relationship API

In this video, we explain the Relation Deletion API, which is the reverse action of creating or expanding relations between parent and child objects in a database. We clarify that the API does not delete the actual objects, but only the links between them. The API allows you to break the relationship between a parent object and its related children. We emphasize that you need to know the parent object to use the API and can identify the children that you want to disassociate the parent from either explicitly or implicitly using a where clause.

39. Many-to-Many Relations

The video discusses many-to-many relationships, starting with their nature and implementation using a one-to-many relationship in Backendless. The bi-directional nature of the relationship in Backendless makes it a many-to-many relationship. Various use cases are demonstrated, including sorting courses by the number of students enrolled in them using the “count” function, which can be applied to relationships. The “sorting” function is also introduced to sort courses by popularity, and a Codeless block is used to get courses sorted by student enrollment. Finally, the video reviews the use case of getting students sorted by the number of courses they are enrolled in.

40. Many-to-Many Relations (3 Tables Approach)

In this video, we continue the discussion of many-to-many relations with an approach where three tables are used. We return to the example consisting of a table for courses, a table for students, and an intermediate table that describes the actual relationship between them. We explain how this design allows additional data about the relationships, such as grades or enrollment dates, to be captured. We also provide a demonstration of what the students and courses table would look like in Backendless Console, and how to populate it with data. Lastly, we review previously discussed use cases with this new design.

41. Data Retrieval With a Subquery

In this video, we will be discussing fetching data with a subquery. This feature applies to cases where you have two data tables that don’t have a relation between them but share some common data. For example, let’s say we have a table called Product with a column called category, which contains the names of the categories that the product records belong to. Another table called Category defines the valid categories with some additional data about those categories. We show how to craft a query that fetches data from the Product table based on characteristics in the Category table. Since there is no relationship between these two tables, we need to use a subquery. The subquery is a full-blown where clause that runs off the Category table. Although it has a slightly different syntax, once you understand how to structure it, you can come up with any kind of subquery.

42. Visual Schema Modeler

In this video, we will learn about the Visual Schema Modeler, a graphical and visual interface for managing schema, such as creating and editing columns, establishing relations, and more. As you build your application and the schema becomes more complex, a big picture view of your schema becomes important. The Visual Schema Modeler provides just that, displaying your schema with all its relations in one glance. You can also group tables and assign them colors to help with functionality or data storage. The video walks you through the functionality available in the Visual Schema Modeler, including creating and editing columns, creating relations, renaming tables, exporting schema as PDF or PNG files, and more.

43. Aggregate Functions

In this video, we will talk about aggregate functions. We will go over the four different functions that we support: count, min, max, and avg. Being able to calculate numbers quickly and efficiently and have the database do it for you is what makes databases quite powerful. We will demonstrate how aggregate functions work in Backendless by going over various examples. In the first example, we will review how to get an average price for products in the widget category. The second example will be getting an average order amount for products in the widget category. In both examples, we will demonstrate how to use aggregate functions in Backendless, and we will show how the requests should be sent to the table to retrieve the results we need.

44. Transactions Overview

In this video, we will dive into the Transactions API. The Transactions API is a vital element of our database technology. Thus, this video is essential for those who manage applications with frequent user activity and where constant data changes occur. Maintaining data integrity and consistency is pivotal, and that’s where the Transactions API comes in. When the server executes the transactions in the database, you will see the result, ensuring data integrity with every data change. In this video, we will show a specific transaction example of saving an order and how we use a transaction to save the order and create relations within the same transaction.

45. Transaction Isolation

In this video, we will dive into transaction isolation which is important to understand when building logic or writing code that uses transactions. In order to provide consistency and integrity of your data, transactions become quite useful. If an application has a lot of concurrency, a lot of users hitting the database at the same time and multiple users modifying the same database record concurrently, isolation ensures data integrity. In this video, we will review all the models of isolation of transaction isolation that are present in Backendless: Read uncommitted, Read committed, Repeatable read, and Serializable. Understanding the different isolation modes is essential when designing your transactions. Although repeatable read works for most cases, it is always good to consider your application’s specific requirements for how data needs to be handled.

46. Transaction Operations

In this video, we continue our dive into the Transactions API. We will explore how to create a transaction using the “Create Transaction” block and add operations to transactions using the “Add Operations to Transaction” block. We cover individual operations such as the “Find Operation,” “Create Operation,” “Upsert Operation,” “Update Operation,” and more. As always, with Backendless SDKs you can use transactions with code in addition to Codeless.

47. Transaction Operations Chaining

In this video, we will learn how to use the Backendless Transactions API to perform a bulk update operation on a collection of orders. We will see how to retrieve a collection of orders that meet a specific condition by using the find operation, and how to chain operations together by using the result of the find operation as the input for the update operation. We will also show a simpler way to achieve the same outcome using the bulk update operation with a where clause. We demonstrate how to extract a single object from a collection of orders and update only that object by using the operation result reference. Finally, we will modify the logic to update all of the orders by using the bulk update operation, and successfully update all of the orders to the new value.

48. Transaction Results

In this video, we discuss transaction results and their significance in the logic of an application. We explain how the APIs surrounding transaction results can be used to determine the success or failure of a transaction, and how the underlying APIs can be used to retrieve the internal result of each operation within the transaction. We demonstrate how the transaction results are displayed in the network traffic and walk you through the structure of the results. We then show how this information can be used programmatically to extract data from the transaction results and display it in a table.

49. Deep Save API

In this video, we introduce the Deep Save API, which provides an efficient and easy way to work with data, specifically saving data in the database. We first highlight the limitations of using the Transactions API when saving complex data that includes multiple objects with related fields. Then, we demonstrate how the Deep Save API works and how it is much more efficient in saving such complex data. The Deep Save API allows you to take a root object with all its related child objects and save it in a single shot, making the code more compact and efficient. It recognizes what needs to be done and creates tables and establishes relationships automatically, saving us time and effort.

Conclusion

This course is the second video in the ideal Backendless learning path. Between the video courses and Backendless Missions, you will have a strong foundation that will allow you to build virtually any type of application with Backendless.

  1. Codeless Fundamentals
  2. Backendless Database Training Course <- You are here
  3. Backendless User Management
  4. UI Builder Intro
  5. UI Builder Masterclass

Complete the path to have the opportunity to become a Backendless Certified Engineer.

Not a Backendless developer yet? Get started for free today!

More Videos Coming Weekly

Unlike our previous courses, this course is ongoing. Mark will be adding new videos weekly.

If you have specific questions or areas of Backendless Database you’d like to learn more about, leave a comment below. Your feedback may be the basis for a future video!

Leave a Reply