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.

Deploying web app with Firebase Hosting

Firebase Hosting provides production-grade, fast and secure (HTTPS - HTTP over TLS) static hosting for your web app.It can be used to deploy web applications (JavaScript based applications) or to deploy a static content to a global content delivery network (CDN) with a single command. In this tutorial, In this tutorial static website is hosted using Firebase Hosting feature. Key capabilities Files are served over a secure connection. Content is uploaded to SSDs at CDN edges around the world and cached to provide fast delivery. Firebase CLI provides facilities for rapid deployment. Developers can easily rollback to a previous deployment. Due to the rise of front-end JavaScript frameworks static web apps have become the de facto of modern web development. Whether you are deploying simple static web apps or large scale web app, firebase hosting provides the infrastructure, features, and tooling to successfully deploy the web app. Hosting provides auto-generat...