Hello!

Hello!

I am writing a commercial software application and I would like to add cloud storage. This is not for the sake of it but because I want to achieve the following things:

- Be able to backup remotely
- Be able(at some point) to have a mobile viewer

I have no issues on the Delphi side for the actual storage(TMS has components for that) but I am more worried about the formats.

There are three main possibilites that come to my mind:

- JSON
- XML
- SQLite

Personally, I really dislike SQLite because it's just too fragile.
While the other two are fragile as well, though, at least they don't pretend to be a DB :)

I have excluded CSV from the list of possibilites because I am not sure what kind of support there is on mobile platforms for this across the board.

Also, and this is especially true in the case of XML, I would also be interested in knowing which kind of compression you would suggest for this that is available, once again, across the board.

What are your thoughts?

Regards,

A

Comments

  1. I'm not sure I understand your question, but if you need to store backup information "somewhere", a db is the way to go IMHO, if you don't want to install a real db like PostgreSQL, MySQL, etc., then SQLite is the way to go, JSON and XML will require parsing each time you load them, on top of that, a db has transactions, complex query support, etc. db is your only real option IMHO.

    ReplyDelete
  2. Dorin Duminica the application I am writing really begs for both uses: mobile viewer(at the very least, with option to modify data as well later on) and synchronization across desktop machines.

    Internally, I will obviously use a DB both on the desktop and the mobile side, but the cost of parsing, to me, does not seem to be a big problem in the long run due to the increasing computing power of phones and tablets.

    Regards,

    A

    ReplyDelete
  3. Andrea Raimondi I wouldn't count so much on future hardware, you should go with what's fastest for you now, deliver tomorrow, worry the day after (:

    seriously, I think all mobile platforms have support for sqlite built in or at least they have libraries for it, that would be a good start, also, why do you want to store a db on the mobile device since it's a cloud solution? everything should come/go from/to the server.

    ReplyDelete
  4. You don't own a smartphone do you? :)

    A

    ReplyDelete
  5. well, I do, or have been... my trusty e63 is more like a "feature phone" today ((: so I guess the answer is no.

    ReplyDelete
  6. The problem with smart phones is that the internet connection is unstable. Doesn't matter whatever they tell you, it's a lie :)

    The connection is very unstable simply because the GSM network wasn't thought to carry data but voice; there is very little research right now to change that though, thus it will remain pretty much unchanged for at least 5 years.
    This means I have to cater for an unstable or dropping connection, which in turn means I need local data to be accessible at all times.

    Plus, it's an application you won't actively use at the same time both on the desktop and on a phone, thus there are no real time changes unless you actually operate on it, in which case you would know :)

    Regards,

    A

    ReplyDelete
  7. maybe you should sync only via wifi? wifi modules are quite stable on the phones I've played with, including my own which is made in 2008, also, who, in their right mind, sync over GSM to pay huge bills on top of your fee for service?

    ReplyDelete
  8. There are flat internet rates these days  and I expect they'll become more common place.

    This is also the reason for compression you see: if I manage to stuff more data in fewer bytes, internet updates become more doable :) until flat rates become as common as chargable plans.

    Regards,

    A

    ReplyDelete
  9. if you wanna make a sell to Joe Doe, you'd better lie very well and hide your fees or charge a flat fee (:

    maybe you should do incremental updates? for example, today I have 20 contacts, but tomorrow I have 22, grab id's from server, compare with local ones, mark as "deleted" on server if that's the case, upload new contacts and bam! same for other data, however, in order to do this flexible and easy, SQLite is the way to go IMHO.

    ReplyDelete
  10. SQLite fragile? Care to elaborate? I would personally rank it above most of the other databases out there, assuming you don't cut corners and turn off the synchronization features. I've never seen an SQlite db corrupt itself, while I've seen that for MySQL, Oracle and MS SQL, despite running on dedicated hardware woth redundancy and with dedicated DBAs (granted, the DBA is often the weak link). When an SQLite DB goes corrupt it's because the media got corrupt (or your turned off synchronization features)

    Also JSON & XML are not transactional, so any change will likely involve a full rewrite. And they're not ACID, so if anything happens while you're writing into them, they're dead, while SQLite will survive. JSON is perfect for transport, XML is for XSLT, and what you use when you don't have a choice ;-)

    ReplyDelete
  11. Eric Grange SQLite does not have types. SQLite allows you to write "Hello" in an integer column and it won't blink an eye.
    There are no foreign keys. It's enough to have a Firefox extension to change data in it, with potential to destroy it.
    Should I go on?

    ReplyDelete
  12. Andrea Raimondi field are not statically typed, but once written to they are typed. Foreign keys are supported, just optionally enforced. All standard formats can be written to by other apps, and SQLite can be encrypted if that's a concern.

    ReplyDelete
  13. Which TMS controls are you going to be using to store data in the cloud?

    ReplyDelete
  14. Hmm, looking at their web site I would not have guessed that they have a component to access cloud storage, which component are you using to do this?

    ReplyDelete
  15. TAdvDropBox: component for access to DropBox cloud storage
    TAdvBoxNet: component to get access to Box storage
    TAdvSkyDrive: component for access to Microsoft Skydrive cloud storage
    TAdvGDrive: component for access to Google Drive cloud storage

    I don't own them yet - but I will :) TMS is a reputable company and I am pretty sure they'll fit my bill when the need arises.
    And there's a trial, too. I will take care of the finer details when I need them.

    Regards,

    A

    ReplyDelete
  16. I thought I was smart getting the Component Pack subscription, but those aren't in mine! Damn, will have to get them as well, they look very handy!

    ReplyDelete

Post a Comment