Skip to main content

Alternatives to the SQLite in Android

At the moment there are several embeddable databases and libraries out there that you can use in a mobile application. In this post, I examine most popular libraries and databases and highlight some of their characteristics.

Realm

Realm is a mobile platform and a replacement for SQLite & Core Data. According to the website, it has more than 100k active developers. Realm is fully open source and distributes under Apache License. Realm Mobile Database is much faster than an ORM, and often faster than raw SQLite due to zero-copy design. Some of the benefits of Realm are fast queries, safe threading, encryption of data and reactive architecture. You can learn more about Realm by visiting this page.


Sugar ORM is a library that can be used to interact with SQLite database using Object-Relational Mapping. Object-Relational Mapping (ORM) is a technique that used to query and manipulate data from a SQLite database using an object-oriented paradigm. And Sugar ORM takes care of the things like the creation of the database, management of object relationships and provides clear and simple APIs for database operations. To get started visit this page.


LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values (Keys and values are arbitrary byte arrays). Data is stored sorted by key. LevelDB supports multiple changes to be made in one atomic batch. And users can create a transient snapshot to get a consistent view of data. However, LevelDB is not a relational database. It does not support SQL queries, and it has no support for indexes. And only a single process (possibly multi-threaded) can access a particular database at a time. There is no client-server support builtin to the library. An application that needs such support will have to wrap their own server around the library.


Firebase is a real-time NoSQL cloud-based database. It stores and syncs data with NoSQL cloud-based database in real time. And data is synced across all clients in real-time and remains available when your app goes offline. Data is stored as JSON and developer can browse the data using a web-based console. And it includes offline support as well. It is very easy to integrate Firebase to Android project. To learn more about Firebase database visit this page.



Comments

  1. As another alternative to easily access a SQLite database, JDXA is a simple, non-intrusive, and flexible ORM product for the Android platform. Based on some well thought-out KISS Principles, JDXA dramatically decreases development time by presenting a more intuitive object-oriented view of on-device SQLite relational data, eliminating the need to write and maintain endless lines of complex low-level SQL code.

    JDXA easily supports complex object modeling including inheritance, one-to-one, one-to-many, and many-to-many relationships and offers a POJO (Plain Old Java Objects) friendly non-intrusive programming model, which does not require you to change your Java classes in any way: no need to subclass your domain model classes from any base class; no need to clutter your source code with annotations; no source code generation (no need for DAO classes), and no need for pre-processing or post-processing of your code. JDXA also offers convenient persistence for JSON objects. JDXA automatically creates the required database schema.

    To learn more about JDXA visit: http://softwaretree.com/v1/products/jdxa/jdxa.html

    ReplyDelete
  2. Two others you should have included: Couchbase Mobile (https://developer.couchbase.com/mobile) and Green Robot DAO (http://greenrobot.org/greendao/)

    ReplyDelete

Post a Comment

Popular posts from this blog

Laravel 5.4 Bootstrap row class for every 3 columns

Sometimes you need to show three or four columns in a row using Laravel 5.4 and blade template engine. Here I show how to do it using chunk function in Laravel blade. As the first step let's get products from the database and pass it to the blade view. And let's check our blade file. In the following example,  @ foreach  takes the  $ products array and chuck it. In this example, I split it by three. You can pass any number according to your specification. And you will see the inner @ foreach loop through  $ items. If you have any question please comment it and I will try to solve it.

Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) Part - 2

This tutorial is the second part of the Deploy Laravel 5.4 App on LEMP Stack (DigitalOcean Guide) . Before I install LEMP stack, I am going to update the package installer. To do that run the following command in the terminal. It will grab the package list and update it. sudo apt-get update Install Nginx (Engine-X) Run the following command to install Nginx server. sudo apt-get install nginx   After the installation, you should be able to visit your IP address and it will show the Nginx default page. Install MySQL Run the following command to install MySQL on your server. sudo apt-get install mysql-server The above command will start the MySQL installation process. You will have to enter 'Y' and proceed. After few steps you will see the following screen. Enter root password and proceed. Default MySQL installation is famous for insecure. MySQL has a helper script to secure the MySQL installation. To run the script type the following command i...