dimanche 24 janvier 2016

How to most efficiently store a book (rich text) in database or XML?

I have a book here, in plain text. I want to write a tool in objective-c / cocoa that enables me to search the book for single words or phrases. I also want to be able to make notes after sentences and tag sentences with certain words. I am a complete beginner when it comes to databases, so I have a few questions: (basically, what it comes down to is the question: how to store a book in rich or plain text format most efficiently, so it is searchable, quick and most flexible)

1) Would I even use a database for sth like this, or maybe just use XML or HTML? Are there any others options?

2) Would I then store each sentence individually or whole chapters? What would be more efficient?

3) I might sometimes need to include images. I have read that images are not to be stored in databases. How could I solve this? Just include a path to the image?

4) Let's say I do not have plain text, but rich text. Would it be more efficient to store rich text as such, or use HTML or XML to save that information (intendation, italics, etc.)

For possible solutions please also keep in mind that the software I am writing will be in Objective-C / Cocoa, on OSX.

PS: I know that there are questions on here regarding storing large texts in databases etc., but I would like to know what would be the most efficient way for storing a book.

Aucun commentaire:

Enregistrer un commentaire