SQLite access with an ORM – FAQ

What is an Object-Relational-Mapper (ORM)?

An ORM is a layer between the relational SQLite database and the object-oriented app code. The ORM allows the developer to use the database without the need to transform objects into a format suited for the relational database.

Do I need an ORM to work with SQLite?

No, there are many options to work with SQLite. Because we, however, believe that an ORM increases efficiency in working with SQLite, we have developed a free open-source ORM: greenDAO. With an ORM, you do not have to deal with SQLite directly and can benefit from highly optimized queries.

Do Object-Relational-Mappers harm my app performance?

It totally depends on the ORM, but an ORM definitely does not have to harm app performance. Because for us performance is king, our ORM, greenDAO, is optimized for performance. Therefore, greenDAO is probably the fastest way to access SQLite on the market as you can see in the following benchmarks. Note: All our benchmarks are open source and available for review and feedback by the community to achieve most neutral comparisons. Interested to learn more about benchmarking on Android? We summarized our lessons learned for reliable benchmarks here.

How long does it take to learn how to use the ORM?

Obviously, every developer asks him/herself if it is worth the effort to learn a new tool. Compared to learning to efficiently access SQLite, learning to use an ORM will probably take max. 20% of the time (best guesstimate). And then just have a look on who else is using greenDAO: http://www.appbrain.com/stats/libraries/details/greendao/greendao - as you see it is used by many top apps. So, also for future projects it may come in handy knowing how to work with an ORM already.



Spread the love
Posted in Android and tagged , , , , , , .