Home  >  Q&A  >  body text

sqlite - How to handle multi-user data storage in Android?

The current implementation is that one User corresponds to one database. But I think it is also possible to add a User table and use foreign key association. Don't know which implementation is better? Are there any other ways to achieve this?

大家讲道理大家讲道理2713 days ago2596

reply all(5)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:35:38

    From the perspective of easy upgrade, it is better to use 一个数据库+外键关联, especially when using a third-party ORM.

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:35:38

    Same as the website backend, use User+foreign keys, as mentioned above, if you upgrade the table structure one by one, you will be exhausted.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:35:38

    One User corresponds to one database, and data search is fast

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 13:35:38

    What effect do you want to achieve?
    Or what data is stored?

    reply
    0
  • PHPz

    PHPz2017-05-16 13:35:38

    You can create tables by user (table name + user ID)

    reply
    0
  • Cancelreply