Jump to content
Larry Ullman's Book Forums

Database Design: Structure For A Book


Recommended Posts

A database design example commonly available pressumes that one wants to organize a collection of books, and depicts the usual author, title, isbn, etc., breakdown, and may even normalize to several tables.

 

Generally not seen, however, is an example that includes the books contents, i.e., chapters, headings, footnotes, and body copy

 

Any thoughs on why this is?

 

Would MYSQL even be capable of managing the task?

 

 

~ David

Link to comment
Share on other sites

Just a couple of ideas:

- Have the actual book contents in separate PDF files, and then manage those as files with metadata about the files in the DB. Larry actually does this for the first of two sites he constructs in his e-commerce book.

- Use one of the TEXT or BLOB datatypes (i.e., TEXT, MEDIUMTEXT, LARGETEXT, BLOB, MEDIUMBLOB, etc.). The TEXT and BLOB datatypes are capable of storing massive amounts of data. In addition, while it may appear so in the DB interface, the data is not actually stored in the DB, but in separate text files to which pointers are stored in the DB.

 

Either one of those solutions would probably be fine. These days, most people seem to go the PDF route though.

Link to comment
Share on other sites

Just a couple of ideas:

 

Thank you.

 

Ideas will help get me going in the right direction - or at least any direction, at this point..

 

 

- Have the actual book contents in separate PDF files, and then manage those as files with metadata about the files in the DB.

 

This would definitely get the job done in short order.

 

You could not have known - however - that I had neglected to mention that the reader will need to be able to perform a search and see every hit returned with a link attached that - when clicked - takes them to the part of the book (or, displays the 'page') where the search term(s) are/is located.

 

 

- Use one of the TEXT or BLOB datatypes (i.e., TEXT, MEDIUMTEXT, LARGETEXT, BLOB, MEDIUMBLOB, etc.). The TEXT and BLOB datatypes are capable of storing massive amounts of data. In addition, while it may appear so in the DB interface, the data is not actually stored in the DB, but in separate text files to which pointers are stored in the DB.

 

Interesting. Very interesting. And, this method would concievably allow for a search function to perform as required.

 

Again, thank you for the insight.

 

~ David

Link to comment
Share on other sites

Just a couple of thoughts (and this is coming from a non-DB expert):

 

Being able to search the entire contents of a book will be super, super slow. Larry made a post somewhere else a while ago about how to create a search feature for just such occasions.

The basic gist is that you have to pick certain keywords from each page (or every so many pages) and then store those keywords in a DB to be searched on. I would recommend a similar methodology.

As for jumping to the correct page, well, I don't know much about handling PDFs in browsers, but I'm sure PHP has some sort of plug-in that would allow you to do that.

Link to comment
Share on other sites

 Share

×
×
  • Create New...