3

I am using xamarin Azure SDK to download and manage the local database for my Xamarin . Forms App.

We are facing downloading time issues because we have a lot of data, so I am thinking of taking backup once of the SQLite File from one device and use it to restore on different devices as restoring the same SQLite File.

Planned to use Azure Blob storage to store backup of SQLite files and for different device planning to download that blob of SQLite file and thinking of restore it on different devices.

Any Help will be appreciated.

Thanks :)

Marcos Vasconcelos
  • 18,136
  • 30
  • 106
  • 167
Sanket
  • 452
  • 3
  • 18
  • Did you thought about compress the database to optimize your download time? I couldn't figure out what specifically is you question indeed. – Diego Rafael Souza Dec 14 '17 at 13:34
  • Yes exactly Diego, I need to compress DB and optimize the download time. – Sanket Dec 14 '17 at 13:40
  • Why did you need to do this? You can download data from Azure by using Azure SDK instead. – Vikas Surve Dec 14 '17 at 13:19
  • To download data table by table it takes time to download data using SDK , rather I am thinking to download whole SQLite db file as blob and then trying to replace the existing created DB file with the blob – Sanket Dec 14 '17 at 13:20

3 Answers3

1

An approach I have used in the past is to create a controller method on the azure end which the client app can call that generates a pre-filled sqlite database or 'snapshot' on the server (making sure you include all the extra azure tables and columns) and then return a download url for the file to the client. We also zip-up the snapshot database to reduce the download times. You could store this 'snapshot' in azure blob if you desired.

0

Please refer given link. SQLite is not supporting only relationship like Foreign Key.

Memory Stream as DB

you can upload back up file on Blob with respective user details. and when there is any call with same user details you can download it from blob.

0

Those are the links that provide you with the code / knowledge required to use Azure Blob Storage on Xamarin:

As this question is very general I can provide you only with those general links. There are many details on how to implement that in your case, if you face some specific problem I recommend to ask another question with the exact description of that specific problem.

EDIT: According to your comment you have some problems in replacing the local file. The only thing is that you must replace it before you initialize SQLite, otherwise it is a simple file operation.

Ivan Ičin
  • 9,672
  • 5
  • 36
  • 57
  • Thanks Ivan, I am already done with downloading my sqlite file from blob just I need is I need to replace my App local database with the downloaded file... Unfortunately I can not share my code as we are working for business app – Sanket Dec 14 '17 at 13:43