Soon it will be necessary to implement a database in your application. Fluently reviewed, singled out SQLite, Realm, ORMlite, GreenDAO, Memory. But according to official documentation it is a little difficult to conclude about these databases. I would like to know from you dear developers what is better to deal with and in what cases.

  • one
    I recommend using Realm. ORMLite, GreenDAO and TP. only a stratum to SQLite, speed and implementation suffer. Pure SQL is somewhat hardcore, composing the correct and optimal query is sometimes quite troublesome, and working with the cursor is not always convenient, though fast. Also, the environment for SQLite to work in android is rather “verbose” in terms of the code necessary for the work. Realm 100% noSQL ORM, fast, convenient, concise .. disadvantage - about 4 MB of the library itself, but it is definitely worth it. - pavlofff

3 answers 3

You put several different things on the same line.

SQLite and Realm is a СУБД .

ORMlite and GreenDAO are libraries implementing ORM technology (the first supports many СУБД , in particular, SQLite , the second - only SQLite ).

You can use, for example, SQLite directly without ORM , you can use SQLite using layers in the form of ORMlite or GreenDAO .

If you haven’t worked with databases before this point, then I would advise you to first dig in bare SQLite to understand how it all works from the inside. How to understand - try to use SQLite using one of the ORM libraries. And after that you can try Realm .

If in your application you are actively working with the database, I would advise something from the ORM systems (for it is more convenient, but you will lose at speed).

You can read more on the following links:

SQLite, ORMs, NoSQL: what Android developers use and why

Comparative testing of nine ORM for Android

  • Realm in most operations is not inferior in speed to SQLite. Very fast noSQL ORM - pavlofff

IMHO, if you want something strongly customizable and flexible, then this SQLite is the creation of pure SQL queries.

If something fast quality and fairly powerful, then this is Realm . All ORM libraries are slow compared to these two СУБД

    If you need speed then use bare sqlite and do not use orm. They are all very slow in speed. If you need to store simple data, you can use Cupboard. It is very simple and convenient. In second place in speed like Realm, but it weighs a lot, because pulls native dependencies for different processors. You can of course specify in the config specific processors. There is also a Requery library. She is very flexible