RE: [flexcoders] Re: AIR and SQLLite
I've never used the feature but I understand LCDS using data management services will auto sync in both directions from the sqlite ( in air ) and an online db. J.D.Hoover MageWindMedia http://www.magewindmedia.com Ph (415) 261-3000 [Moderator note: Could people at least try and trim their replies ?] --- On Tue, 1/13/09, Tim Rowe tim.r...@carsales.com.au wrote: From: Tim Rowe tim.r...@carsales.com.au Subject: RE: [flexcoders] Re: AIR and SQLLite To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com Date: Tuesday, January 13, 2009, 7:34 PM You also need to consider how you patch your DB when you don't want it to be destructive. I would suggest for this that you have your base version-1 database, and every change from then on is applied as a patch, incrementally. If you have 60 different database structure changes, then that's just an unfortunate situation you'll have to deal with. This solution is kinda easier than exporting the data from an old DB (of which could be any version) and importing it into a new one. Yeah, there's other ways around it, but version compatibility is always a pain. The idea of tagging every row with a version is also a good one - you could probably achieve this better using a log table and triggers though, rather than on the same table. If you really want absolute tracking of every data modification, you could do it like say instead of users(id, appversion, time, username, password) have users(id, username, password), users_log(id, action, username, password, appversion, time), and frequently archive/compress users_log - 'action' is something like pre-update, post-update, pre-delete, post-insert etc. Just remember that by doing this you increase the data stored by about a factor of 4. Just some ideas to think about. --Tim From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Kevin Benz Sent: Wednesday, 14 January 2009 2:24 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: AIR and SQLLite If you don't have to preserve any existing client data, then you could simply rip and replace the existing db file. Your Air application could drop the file, back it up or whatever and then replace it with another copy downloaded from a server. If you need to preserve some of the data then your problem becomes much more daunting. First you need to determine the rules by which an update is to occur. Is it at application start or part of some predefined schedule? What happens if one user leaves their client up for days/weeks/months and another restarts hourly? If you base on application start, how will you insure that you cover both use cases? How will you insure that client A and client B don't have different data? I would suggest adding timestamps to every server synchronized row allowing you to implement some concept of knowing what data might be stale. K From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bonny_us Sent: Tuesday, January 13, 2009 7:02 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AIR and SQLLite Hi Kevin, i want to do synchronize all client sqlite db's from a common back-end db? Thanks, Bonny --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Kevin Benz kb...@... wrote: What are you asking? Are you wanting to synchronize all client sqlite db's from a common back-end db? Are you wanting to replicate the client data on the server? Air doesn't provide any facilities to help with either although both could be accomplished with a non-trivial development effort. I know there is some discussion on the web of tools to help although you need to be aware of the fact that Adobe extended SQLite with support for AS datatypes (like Date for example) so beware of tools that may not be aware of your whole schema. K From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of bonny_us Sent: Monday, January 12, 2009 7:57 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] AIR and SQLLite Hi All, Any one have idea of SQLLite and AIR Synchronization. I want to create one POC using SQLLite. If any one have any example regarding this then please let me know. it will be very helpful to me. Thanks, Bonny
[flexcoders] Re: AIR and SQLLite
Hi Kevin, i want to do synchronize all client sqlite db's from a common back-end db? Thanks, Bonny --- In flexcoders@yahoogroups.com, Kevin Benz kb...@... wrote: What are you asking? Are you wanting to synchronize all client sqlite db's from a common back-end db? Are you wanting to replicate the client data on the server? Air doesn't provide any facilities to help with either although both could be accomplished with a non-trivial development effort. I know there is some discussion on the web of tools to help although you need to be aware of the fact that Adobe extended SQLite with support for AS datatypes (like Date for example) so beware of tools that may not be aware of your whole schema. K From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bonny_us Sent: Monday, January 12, 2009 7:57 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] AIR and SQLLite Hi All, Any one have idea of SQLLite and AIR Synchronization. I want to create one POC using SQLLite. If any one have any example regarding this then please let me know. it will be very helpful to me. Thanks, Bonny
RE: [flexcoders] Re: AIR and SQLLite
If you don't have to preserve any existing client data, then you could simply rip and replace the existing db file. Your Air application could drop the file, back it up or whatever and then replace it with another copy downloaded from a server. If you need to preserve some of the data then your problem becomes much more daunting. First you need to determine the rules by which an update is to occur. Is it at application start or part of some predefined schedule? What happens if one user leaves their client up for days/weeks/months and another restarts hourly? If you base on application start, how will you insure that you cover both use cases? How will you insure that client A and client B don't have different data? I would suggest adding timestamps to every server synchronized row allowing you to implement some concept of knowing what data might be stale. K From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bonny_us Sent: Tuesday, January 13, 2009 7:02 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AIR and SQLLite Hi Kevin, i want to do synchronize all client sqlite db's from a common back-end db? Thanks, Bonny --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Kevin Benz kb...@... wrote: What are you asking? Are you wanting to synchronize all client sqlite db's from a common back-end db? Are you wanting to replicate the client data on the server? Air doesn't provide any facilities to help with either although both could be accomplished with a non-trivial development effort. I know there is some discussion on the web of tools to help although you need to be aware of the fact that Adobe extended SQLite with support for AS datatypes (like Date for example) so beware of tools that may not be aware of your whole schema. K From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of bonny_us Sent: Monday, January 12, 2009 7:57 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] AIR and SQLLite Hi All, Any one have idea of SQLLite and AIR Synchronization. I want to create one POC using SQLLite. If any one have any example regarding this then please let me know. it will be very helpful to me. Thanks, Bonny image001.jpgimage002.jpg
RE: [flexcoders] Re: AIR and SQLLite
You also need to consider how you patch your DB when you don't want it to be destructive. I would suggest for this that you have your base version-1 database, and every change from then on is applied as a patch, incrementally. If you have 60 different database structure changes, then that's just an unfortunate situation you'll have to deal with. This solution is kinda easier than exporting the data from an old DB (of which could be any version) and importing it into a new one. Yeah, there's other ways around it, but version compatibility is always a pain. The idea of tagging every row with a version is also a good one - you could probably achieve this better using a log table and triggers though, rather than on the same table. If you really want absolute tracking of every data modification, you could do it like say instead of users(id, appversion, time, username, password) have users(id, username, password), users_log(id, action, username, password, appversion, time), and frequently archive/compress users_log - 'action' is something like pre-update, post-update, pre-delete, post-insert etc. Just remember that by doing this you increase the data stored by about a factor of 4. Just some ideas to think about. --Tim From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Kevin Benz Sent: Wednesday, 14 January 2009 2:24 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: AIR and SQLLite If you don't have to preserve any existing client data, then you could simply rip and replace the existing db file. Your Air application could drop the file, back it up or whatever and then replace it with another copy downloaded from a server. If you need to preserve some of the data then your problem becomes much more daunting. First you need to determine the rules by which an update is to occur. Is it at application start or part of some predefined schedule? What happens if one user leaves their client up for days/weeks/months and another restarts hourly? If you base on application start, how will you insure that you cover both use cases? How will you insure that client A and client B don't have different data? I would suggest adding timestamps to every server synchronized row allowing you to implement some concept of knowing what data might be stale. K From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of bonny_us Sent: Tuesday, January 13, 2009 7:02 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: AIR and SQLLite Hi Kevin, i want to do synchronize all client sqlite db's from a common back-end db? Thanks, Bonny --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, Kevin Benz kb...@... wrote: What are you asking? Are you wanting to synchronize all client sqlite db's from a common back-end db? Are you wanting to replicate the client data on the server? Air doesn't provide any facilities to help with either although both could be accomplished with a non-trivial development effort. I know there is some discussion on the web of tools to help although you need to be aware of the fact that Adobe extended SQLite with support for AS datatypes (like Date for example) so beware of tools that may not be aware of your whole schema. K From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of bonny_us Sent: Monday, January 12, 2009 7:57 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] AIR and SQLLite Hi All, Any one have idea of SQLLite and AIR Synchronization. I want to create one POC using SQLLite. If any one have any example regarding this then please let me know. it will be very helpful to me. Thanks, Bonny