Android Realm Fundamentals
To save a large amount of structured data persistently, you need a database system. In this course, you'll discover Realm, an object-oriented database system that stores data in an object tree and performs queries at a very high speed.
What you'll learn
Most Android apps need to save data persistently. Data saved can be the user settings, file based, and can be in a structured form. To save a large amount of structured data persistently, we need a database system. In this course, Android Realm Fundamentals, you'll discover Realm, an object-oriented database system that stores data in an object tree and performs queries at a very high speed. The database remains private to your own application, and by default cannot be accessed from outside the application. First, you'll learn the basic fundamentals of Realm and how to integrate it into your own project. Next, you'll dive further into Realm by exploring how to write queries, perform sync and async transactions, and how to implement Realm into use for creating a professional app. Finally, you'll learn miscellaneous concepts such as, Realm notifications, custom Realm configurations, database migration, and upgrading Realm schema. By the end of this course, you'll have a strong foundation and understanding of the Realm Database System in Android.
Table of contents
- Overview 1m
- Setting up Realm 10m
- Defining Model Classes and Exploring Annotations 6m
- Performing Insert Operation Synchronously in the Main Thread 8m
- Inserting Data to Realm Asynchronously in the Background Thread 7m
- Writing Simple Query to Fetch Records from Realm 3m
- Using Realm Browser App to Check Realm Database Content 3m
- Understanding @RealmClass Annotation 3m
- Summary 1m
- Module Overview 1m
- Relationships in Realm 5m
- Realm Notifications and Asynchronous Queries 8m
- RealmResults and RealmList: Aggregation Methods 2m
- Customising Realm Name and Creating Multiple Realms 4m
- Realm Modules, Realm Schema, and Realm Schema Version 7m
- Upgrading Realm Schema and Applying Migration 13m
- Summary 1m
The database itself is free and open source. Realm for Android appeared in 2014 and has been constantly evolving since then. Some updates break backward compatibility; however fixes can be made quite easily and quickly.
Realm is a lightweight database that can replace both SQLite and ORM libraries in your Android projects. Compared to SQLite, Realm is faster and has lots of modern features, such as JSON support, a fluent API, data change notifications, and encryption support, all of which make life easier for Android developers.
Synchronous basically means that you can only execute one thing at a time. Asynchronous means that you can execute multiple things at a time and you don't have to finish executing the current thing in order to move on to next one.
Realm is an open source object database management system, initially for mobile operating systems (Android/iOS) but also available for platforms such as Xamarin, React Native, and others, including desktop applications (Windows), and is licensed under the Apache License.
Database migration — in the context of enterprise applications — means moving your data from one platform to another. There are many reasons you might want to move to a different platform. For example, a company might decide to save money by moving to a cloud-based database.