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.

Mobile Backend As A Service (BaaS) platform for Android

Many mobile apps and games rely on a backend service for things that can’t be done solely on hosted device, such as sharing and processing data from multiple users, or storing large files. Backend as a service (BaaS) provides a centralised database and other features to manage user-generated data and application data. The developer can link applications to the backend service and backend service expose APIs to manage users, integrate push notification and analytics. BaaS is a recent development of cloud computing technology. Using backend services provide developers functionalities to manage users, data and to analyse real-time changes actively. Backend service should be able to handle the offline case gracefully and minimise battery drain. Back in the day developers had to develop custom backend platforms using server-side technologies. And developers had to scale up and down according to the user base and app usage. It was time-consuming in terms of resources and skills. Most mob