Android 平台上的数据库框架非常多,但是有一个共同特点就是基于对象关系映射(ORM)模型的。实现的目标也都是不需要写SQL语句,通过对对象的操作保存和操作数据。要是从语法的简洁性来说都有自己的特点,总的来说不相上下,因此只能从数据的性能上来抉择了。


  • GreenDao

  • LitePal
    简单介绍:LitePal是对象关系映射(ORM)模型。它使开发者使用SQLite数据库变得非常容易。 你可以不用写一句SQL语句就可以完成大部分数据库操作,包括创建表,更新表,约束操作,聚合功能等等。

  • Afinal
    简单介绍:是一个android的sqlite orm 和 ioc 框架。同时封装了android中的http框架,使其更加简单易用。FinalDB模块,android中的orm框架,一行代码就可以进行增删改查。支持一对多,多对一等查询。

  • ORMLite
    简单介绍:(Object Relational Mapping Lite)提供了一些轻量级持久化Java对象到SQL数据库,同时也避免了复杂性和更多的标准的ORM包的开销功能。它支持的SQL数据库使用JDBC的数量,还支持原生的Android操作系统数据库API调用sqlite。
    使用方法:Android 数据库框架ormlite使用精要

  • SugarORM
    使用方法:Android SugerORM框架的使用

  • Realm
    简单介绍:是用来替代sqlite的一种解决方案,它有一套自己的数据库存储引擎,比sqlite更轻量级,拥有更快的速度,并且具有很多现代数据库的特性,比如支持JSON,流式api,数据变更通知,自动数据同步,简单身份验证,访问控制,事件处理,最重要的是跨平台,目前已有Java,Objective C,Swift,React-Native,Xamarin这五种实现。
    使用方法:Realm for Android详细教程

  • LiteOrm
    简单介绍:是android上的一款数据库(ORM)框架库。速度快、体积小、性能高。开发者基本一行代码实现数据库的增删改查操作,以及实体关系的持久化和自动映射。设计原则:轻量、专注、性能优先、线程无关,专注数据及其关系存储和操作;无需工具辅助,不需要无参构造,不需要繁多注解,约定优于配置;使用极致简约,例如; db.query(U.class); db.deleteAll(U.class);。
    使用方法:Android 数据库框架LiteOrm使用

  • DBFlow
    简单介绍:综合了 ActiveAndroid, Schematic, Ollie,Sprinkles 等库的优点。同时不是基于反射,所以性能也是非常高,效率紧跟greenDAO其后。基于注解,使用apt技术,在编译过程中生成操作类,使用方式和ActiveAndroid高度相似,使用简单。无缝支持多个数据库,使用annotation processing提高速度,ModelContainer类库可以直接解析像JSON这样的数据,增加灵活性的丰富接口。


Android 数据库框架性能测试

LiteOrm 和 系统原生SQLiteDatabase API 测试数据

LiteOrm 和 greenDAO 的性能表现
greenDAO vs LiteOrm 循环测试

greenDAO vs LiteOrm 批量测试


从图中可以看出 Realm 的性能应该是最好的,同时它执行跨平台,且并不是采用 SQLite 的持久化引擎。但是也有不少的缺点(具体查看文章为什么我不再使用Realm)。

greenDAO 是基于AndroidSQLite的最快、性能最强悍的数据库框架,因为他不涉及反射,靠的是代码辅助生成。




  • www.eliquid-depot.com回复

    This can be such a great position, plus took place sense very much exactly the same myself. Another fantastic keep posted.

  • MoisesGergo回复

    viagra pillen teuer

    [url=]buy cheap viagra[/url]

    <a href="">buy viagra online</a>

    viagra rezeptfrei schnel

  • Business回复

    I really wanted to post a brief note to say thanks to you for some of the magnificent concepts you are sharing on this site. My prolonged internet search has at the end been paid with incredibly good points to write about with my pals. I would admit that most of us readers actually are rather endowed to live in a superb network with very many special professionals with good tips and hints. I feel very much fortunate to have used your entire web site and look forward to many more entertaining times reading here. Thanks a lot once more for everything.

  • Health and Fitness回复

    But wanna tell that this is invaluable , Thanks for taking your time to write this.

  • Health and Fitness回复

    It's actually a great and helpful piece of info. I'm glad that you just shared this useful info with us. Please stay us informed like this. Thank you for sharing.

  • Health and Fitness回复

    excellent issues altogether, you simply received a brand new reader. What could you recommend about your publish that you just made a few days in the past? Any positive?

  • valeraGergo回复

    cialis schweiz ohne rezept

    [url=]cialis coupon[/url]

    <a href="">buy cialis</a>

    cialis 25 price

  • Health and Fitness回复

    I like what you guys are up too. Such intelligent work and reporting! Carry on the excellent works guys I have incorporated you guys to my blogroll. I think it will improve the value of my website :).

  • Health and Fitness回复

    Thanks for sharing excellent informations. Your web-site is so cool. I am impressed by the details that you have on this web site. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found just the info I already searched all over the place and just couldn't come across. What a perfect website.

  • Health and Fitness回复

    Hey there, You've done an excellent job. I’ll definitely digg it and personally recommend to my friends. I am sure they'll be benefited from this site.

  • Health and Fitness回复

    You actually make it seem so easy with your presentation however I find this topic to be actually one thing that I believe I might by no means understand. It seems too complex and extremely huge for me. I am looking forward to your next post, I¡¦ll try to get the hang of it!

  • Home Improvement回复

    Just wanna input that you have a very nice website , I love the style it really stands out.

  • Health and Fitness回复

    Some really nice and utilitarian information on this internet site, besides I believe the design contains superb features.

  • Health and Fitness回复

    Thanks for sharing superb informations. Your site is so cool. I am impressed by the details that you've on this blog. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my pal, ROCK! I found just the information I already searched everywhere and just couldn't come across. What a perfect web-site.

  • Contact Us - Madden Mobile Hack Tool [2017]回复

    Test it your self: –

    When you attempt to establish the budget for madden mobile, your must always
    check it out yourself with your personal accounts, like that
    you will be sure certain system performs or otherwise not, don’t feel on somebody test
    anything yourself then just display if this has value to fairly share together with your family and friends, As various other people’s confidence both
    you and they don’t need fake claims.

    Very first time generate lowest information: –

    As you maybe once you understand many internet tend to be blocking the access
    to the internet generator due to bots and things hence they apply real
    person verification exams on their website, which has to be completed by the individual
    to confirm they truly are peoples, you understand exactly why is that happening?
    That’s because people exactly who got the accessibility the madden mobile on-line hack and cheats appliance overused
    it and tried to establish endless means each time, That’s why we'd advise
    you that, if you use the internet generator very first time next just
    make use of it to generate minimal quantities possible that way your account won’t get flagged or blocked through the program.

    To learn additional about maddenmobilehacktool and Madden Mobile Hack Tool [2017] - Online Cheats for FREE Coins, please check
    out our internet site Contact Us - Madden Mobile Hack Tool [2017].

    The game are cool that there are million subscriptions and players.

    The good thing about it is that this baseball online
    game contains members of the past additionally the gift so that the teams may be
    opted for while you wish.

    With Madden Mobile Hack you could be ensured you will get playing with all the current experience and method that will allow you
    to get the money and coins you'll want to get the then degree.

    Immediately this game awaits the participation very join in and acquire a possibility of accumulating madden coins, madden earnings and enjoy under the labels of this leading professionals all with the
    help of the hack.

    Thank you for visiting this site concerning the Madden Mobile Hack.

    1st, let’s mention exactly what the game from EA is about.
    Madden Mobile try a tremendously preferred online game in america.

    It is played by significantly more than 1 million people every month.
    This NATIONAL FOOTBALL LEAGUE game for mobiles video game is designed to getting starred best
    on smart phones. You're able to understand it from the term.
    That is available for Android os and iOS on the Bing

    Store and iOS Store. Its produced by EA Sporting events.
    You will need a wi-fi connections most likely because the game provides
    alone about 55MB, it is really not the smallest games but in addition perhaps not the greatest.
    Whether you want the activities or not the overall game will get you.
    Its very addicting that it's starred by loads of participants every day.
    It was probably one of the most performed activities games on yahoo Play.
    You can install the video game on iTunes right
    here at no cost.

  • Home Improvement回复

    Thanks for the sensible critique. Me & my neighbor were just preparing to do a little research on this. We got a grab a book from our local library but I think I learned more from this post. I'm very glad to see such great information being shared freely out there.

  • www.linux.ca回复

    Would Ᏼecoming A Freelance Paralegal Be A
    Goodd Рossіbility For You?

  • Education回复

    I do trust all the concepts you have offered to your post. They are really convincing and will certainly work. Nonetheless, the posts are very quick for newbies. Could you please lengthen them a bit from subsequent time? Thank you for the post.

  • Health and Fitness回复

    Hi, Neat post. There is an issue with your website in internet explorer, might check this¡K IE nonetheless is the marketplace chief and a large component to folks will leave out your excellent writing due to this problem.

  • stainless steel kitchens are回复

    Thanks for revealing your ideas right here. The other matter is that if a problem develops with a laptop or computer motherboard, persons should not consider the risk of repairing this themselves because if it is not done correctly it can lead to irreparable damage to the entire laptop. It is almost always safe just to approach the dealer of that laptop for your repair of motherboard. They've already technicians who may have an know-how in dealing with mobile computer motherboard issues and can make right prognosis and conduct repairs.

  • visit website回复

    It as nice to definitely arrive a web internet site in which the blogger is intelligent. Thanks for creating your web internet site.

  • coupon codes回复

    Major thankies for the blog post.Really thank you! Keep writing.

  • Health and Fitness回复

    I do agree with all of the ideas you've offered in your post. They're really convincing and can definitely work. Nonetheless, the posts are very brief for newbies. Could you please extend them a bit from next time? Thanks for the post.

  • house painters回复

    I am curious to find out what blog system you happen to be utilizing?
    I'm having some small security problems with my latest website and I'd like to find something more safe.
    Do you have any recommendations?

  • Health and Fitness回复

    We're a group of volunteers and starting a new scheme in our community. Your site provided us with valuable information to work on. You've done an impressive job and our whole community will be thankful to you.

  • Health and Fitness回复

    Hi my loved one! I wish to say that this post is amazing, nice written and include approximately all vital infos. I would like to peer more posts like this.

  • Health and Fitness回复

    I do not even know how I ended up here, but I thought this post was good. I don't know who you are but certainly you are going to a famous blogger if you are not already 😉 Cheers!

  • weed delivery回复

    I truly appreciate this post. I ave been looking everywhere for this! Thank God I found it on Bing. You ave made my day! Thx again

  • Health and Fitness回复

    I in addition to my guys were found to be viewing the best guides on your web blog and then unexpectedly developed an awful suspicion I never expressed respect to the web site owner for those techniques. All of the young men had been as a result passionate to study them and now have in truth been making the most of those things. Thank you for simply being indeed accommodating and then for obtaining certain decent ideas most people are really desirous to understand about. My personal sincere regret for not expressing appreciation to sooner.

  • Health and Fitness回复

    Some really excellent articles on this website, thanks for contribution. "We are always in search of the redeeming formula, the crystallizing thought." by Etty Hillesum.

  • short mens haircuts回复

    Too many times I passed over this link, and that was a tragedy. I am glad I will be back!

  • Ice packs回复

    Hi, i think that i saw you visited my website so i came to “return the favor”.I'm trying to find things to enhance my web site!I suppose its ok to use some of your ideas!!

  • Home Improvement回复

    My brother suggested I might like this blog. He was totally right. This post truly made my day. You cann't imagine just how much time I had spent for this info! Thanks!

  • payday loan store回复

    What’s Happening i'm new to this, I stumbled upon this I've found It positively helpful and it has helped me out loads. I hope to contribute & aid other users like its aided me. Good job.

  • www.pomeb.ru回复

    I know this site presents quality based content and additional information,
    is there any other website which provides these data in quality?

  • pro回复

    My brother recommended I might like this blog. He was entirely right. This post actually made my day. You can not imagine just how much time I had spent for this info! Thanks!

  • Health and Fitness回复

    Keep up the excellent work , I read few content on this website and I think that your website is rattling interesting and has got sets of fantastic info .

  • Health and Fitness回复

    Hello, you used to write excellent, but the last several posts have been kinda boring… I miss your great writings. Past several posts are just a bit out of track! come on!

  • Health and Fitness回复

    Hello there, You have done an incredible job. I will definitely digg it and personally suggest to my friends. I am confident they'll be benefited from this web site.

  • Game Maker回复

    I¡¦ve been exploring for a little bit for any high-quality articles or blog posts in this kind of area . Exploring in Yahoo I eventually stumbled upon this web site. Reading this information So i¡¦m satisfied to convey that I have an incredibly just right uncanny feeling I found out exactly what I needed. I such a lot certainly will make certain to do not put out of your mind this site and give it a look regularly.

  • Health and Fitness回复

    I have learn a few just right stuff here. Definitely value bookmarking for revisiting. I wonder how so much attempt you set to make one of these magnificent informative site.

  • Health and Fitness回复

    I am really impressed with your writing skills as well as with the layout on your weblog. Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, it’s rare to see a nice blog like this one these days..

  • Digital Marketing回复

    Hi there to all, since I am actually keen of reading this
    weblog's post to be updated regularly. It contains good material.

  • Health and Fitness回复

    fantastic issues altogether, you simply gained a new reader. What could you suggest in regards to your put up that you just made a few days in the past? Any sure?