droidcon NYC 2017 - The Resurgence of SQL

Поделиться
HTML-код
  • Опубликовано: 1 дек 2024
  • Jake Wharton, Google & Alec Strong, Square, Inc.
    SQL may have fallen out of fashion over the last decade, but libraries like SQL Delight and Room are now placing it at the forefront of their use. As a language, SQL is more declarative and expressive than any ORM could hope to be. With the support of strong tooling, database interactions not only become easier but you're able to leverage more of its power. This talk will be a re-introduction to the SQL language for those that have seen it before. We will focus on specific examples where you can offload work that would have otherwise been done in code into the database. Finally, we'll compare and contrast the SQL Delight and Room libraries.
    goo.gl/YKEx1x
    droidcon NYC - droidcon.nyc
    *********************************************
    droidcon NYC has become an event where the American and International Android development and design community come together to share what’s new and what they’ve been working on. Our goal is to serve the community and move the Android platform forward.
    Organized by droidcon - www.droidcon.com/
    *********************************************
    droidcon is the largest global network of developer conferences which bring together the industry's foremost experts dedicated to advancing the Android platform. droidcon engages a global network of over 25,000 developers attending our events in 26 countries.
    Content by touchlab - touchlab.co
    *********************************************
    droidcon NYC content organized by Kevin Galligan, President of touchlab
    Android and iOS Mobile App Development / Doppl Open Source Code Sharing Platform / Mobile Innovation Advisory / UIUX Design. Our goal is to keep growing our company by serving the community. Stop by our next meetup: www.meetup.com...
    Big thanks to our video sponsors:
    American Express - jobs.americane...
    mParticle - www.mparticle....

Комментарии • 10

  • @TechYourChance
    @TechYourChance 7 лет назад +3

    I can't imagine a better overview of SQLite and ORMs given in 40 minutes. Simply outstanding!
    The only piece of information missing (probably due to time constraints) is that SQLite is transactional database, and the default transaction mode on Android is EXCLUSIVE.
    The implications is that even if you optimize the queries to run very quickly, but the query is being executed while a long running transaction is in progress - the query will wait for the transaction to complete. This can lead to super-optimized queries still taking many seconds to complete just because they are waiting.
    This scenario is especially important to handle properly if you implement offline support using a framework that manages synchronization attempts with the server (SyncAdapter, JobScheduler, etc.).

    • @Bozacar
      @Bozacar 6 лет назад

      If you are using WAL mode that's not a problem.
      Also the way to workaround that issue if not using WAL, is to not have long running write transactions by aggregating all data in memory and then commit it to db in one transaction.
      I was working on Email app with full offline support (offline-first) and this worked great.

    • @jeremiahcayden9125
      @jeremiahcayden9125 3 года назад

      you probably dont give a shit but does any of you know a method to get back into an Instagram account?
      I was stupid lost the login password. I would appreciate any assistance you can offer me!

  • @AnnaTheFallMaiden
    @AnnaTheFallMaiden 7 лет назад

    why was friend2 not indexed, if it's part of the primary key?

    • @alecstrong6007
      @alecstrong6007 7 лет назад +1

      Good question! Because its a composite primary key, the order you declare the primary key in matters. In our case we did PRIMARY KEY (friend1, friend2) which means it indexes (essentially sorts) the friend1 column, and then for rows which have the same friend1, it sorts friend2 after. So only friend1 is sorted over the whole table, friend2 is just sorted for rows with the same friend1.
      If we instead declared the primary key as PRIMARY KEY (friend2, friend1), then the opposite happens. friend2 is sorted for the whole table so when we EXPLAIN QUERY PLAN, the query against friend2 is a search using our primary key index.

  • @MichaelRogger
    @MichaelRogger 7 лет назад +3

    object database == realm ?

  • @FrantisekNovak55
    @FrantisekNovak55 7 лет назад

    But relationships!

  • @anonimo0486
    @anonimo0486 6 лет назад

    😍

  • @methodsignature
    @methodsignature 7 лет назад

    Jaav-u