2

I'm designing an iOS application and have decided to separate the persistence requirements into three separate SQL databases.

  • Static Data - read-only but downloaded from external sources
  • Client Request Data - data that the client is queuing to send to an external source
  • Application Meta Data - Holds meta information about the state of the other two db's and the application as a whole. This might be but not limited to table/app version information, time the app last communicated with an external source.

The idea behind this separation is that the first DB is effectively replaceable, the second is a transactional source while the meta information should not grow.

Are there any caveats to this approach, of course I understand I can not join across each, though I don't intend to.

Brett Ryan
  • 26,937
  • 30
  • 128
  • 163
  • This is better but you should decide according to your project time. and this design is more helpful for schedule Backup if you want to make some realtime backups,, like every 15 min on small size of DB. – Mohammad Shraim Feb 27 '12 at 23:51

3 Answers3

3

Certainly not anything inherently "bad" about this approach. In fact, it's often a good idea and in your case sounds like it probably is. You can possibly get performance gains depending on how you create and open the various databases as well.

A couple specific pointers:

  • Static Data: Since this database is read-only, open it as read-only
  • You can can actually join across databases like: Use the ATTACH DATABASE SQL statement and go from there.
NuSkooler
  • 5,391
  • 1
  • 34
  • 58
0

Before using two databases, I would think about having one or two JSON files. It may be ok for your Static Data, and will probably be enough for metadatas.

Obviously, it depends on the quantity and organization of your datas, and if you do or not crossed CRUD operations.

Nicolas Zozol
  • 6,910
  • 3
  • 50
  • 74
0

I'm not familiar with iOS, but I'd consider it from a space standpoint. What's the minimum size of an SQL DB vs. the size of the data you're going to store in it? If the DB doesn't add a significant amount of overhead, then it should be fine. But if you're going to be storing 1K of data and an empty database is 16K, I'd reconsider.

TMN
  • 3,060
  • 21
  • 23