Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:47:28+00:00 2026-05-24T13:47:28+00:00

I have an app with an SQLite database for storing information for a user’s

  • 0

I have an app with an SQLite database for storing information for a user’s account. I designed the database on the assumption that the app would only have one user. As such, the user’s ID isn’t stored in the database (but it is stored in a central database on a server). However, it is possible to logout of the app and let another user log in, but the problem with this is at the moment, their data is downloaded and then appended to the other user’s data. This is not what I want to happen, but I’m not sure how best to change the databse design to solve this. I have thought about:

  1. One database per user. Could result in unecessary data storage if a user just logs in once on their friend’s phone and never again. Also I guess this could be hard to manage.
  2. Add a user ID column to all tables, so appending doesn’t cause a problem. Still has the unecessary data issue that (1) has, and loses 1’s modularity.
  3. Wipe the database when the user logs out. If the user has a lot of data on the server, it will take a long time to sync the data when the application starts (this will be done on another thread, but it’s still a pain).

Is one of these approaches good? Or is there a better way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:47:29+00:00Added an answer on May 24, 2026 at 1:47 pm

    I would go for option 1. Keeping it as a separate file will ensure that there won’t be any performance implication whatsoever by having multiple databases.

    You can append the user ID to the database filename. You could have some sort of LRU system where you automatically delete the oldest database if you have more than 4 (or if you exceed a certain amount of data).

    The specifics of this choice would be up to you, since you know how much data storage you’d like to use up, and how many users would be likely to use the app on the same device.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that must get data from the Sqlite database in order
I have what I would consider a small sized iPhone app that uses SQLite.
I have an app that uses a SQLite database. When the app updates at
I have an app that uses an sqlite database. Currently I have a database
I have a Sinatra DataMapper app hitting a sqlite3 database that I am attempting
I have a Core Data-based iPhone app with a pre-populated read-only database. What protection
i am creating an app that needs a database. i created it using sqlite
I'm working on my first android app and have an SQLite database set up
My iPhone app uses a sqlite3 database for storing the data that it generates.
I have created one application, where I am storing the data into database and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.