lemoncodes
lemoncodes

Reputation: 2421

Android: SQLite Deletion Effeciency

I have this question on how is deletion done on Mobile development, in lieu with Database of course, which or what is the best practice in these field, Does deletion of records permanently in database recommended on mobile dev, or flagging in database that a record is deleted more efficient?... i know that in large scale DBMS u have to flag a record that is deleted so u can view past records i just read that on the DBMS book though, does the same principle apply on mobile development, considering that i'm only developing an application for a very small scale only

Any inputs form all you veteran DBAs and Mob. Devs out there are much Appreciated..

Upvotes: 0

Views: 75

Answers (2)

waqaslam
waqaslam

Reputation: 68177

It depends on the design requirements of your application, so it has nothing to do with the efficiency of app. What you read is for large scale systems where audit is required. Since you are developing an application which will run on mobile platform and would probably not require auditing, so in that case its fine to delete such records (at least that's what I would prefer to do).

Flagging records would increase the size of database and is not a good idea to leave unwanted data (memory) on your device.

Upvotes: 0

P Varga
P Varga

Reputation: 20229

As databases on a mobile device are not likely to get large, deletion shouldn't be too inefficient.

But I would say it is useful to flag deleted rows instead, as usually databases in these scenarios are used to hold data locally when the device is off-line pending synchronization to the network, and it's much easier to query deletions and upload them rather than diffing the local rows with remote ones to find what needs to be deleted.

Upvotes: 1

Related Questions