Storing books in a database

大兔子大兔子 提交于 2019-12-05 01:04:27

问题


I want to create a system that stores books (and some other documents). Users will be able to log into the system where they can either see a list of all books or enter some search string and get a list of the books containing the search string. My problem is that I don´t know how I should go about storing my books. The books obv have to be searchable and the search needs to return the books ID, Name, and preferable page. Anything more like the text surrounding the search term would be a nice extra.

Some facts that might help you help me get the best answer.

  • The database does not have to be free. If SQL Server or an Oracle DB will help me than I´m all for that.
  • The books will be about ~100 (2-600 pages)
  • The documents will be about ~1000 (10-50 pages)
  • Adding books and documents will be a slow process that will happen infrequently so any type of re-indexing of tables does not need to be fast.
  • I have not decided how to search the documents. I do need my search results to be ranked based on relevance somehow. This might become a source of another question in the future

回答1:


Do not use a RDBMS database. RDBMS are good for storing relational data. Data you are trying to store are a set of documents. Use a document store like couchDB or mongoDB. However, you since have to search this data, it is better to index this data in lucene which is built for such needs




回答2:


Provided you don't intend to search the entire text of the book (perhaps consider initial processing to store a serialized hash of unique words?):

SQL Server 2008R2 has a new FILESTREAM system which will enforce relational integrity using the DB engine but will maintain the files in the file system. It's the "best of both worlds" and you won't have to worry about how DB backup plans affects your BLOBs

http://msdn.microsoft.com/en-us/library/cc949109(v=sql.100).aspx




回答3:


SharePoint Foundation 2010 and 2013 could be your perfect solution which is absolutely free to use. You can store bulk amount of documents to different document libraries, add and edit their metadata, and search them using metadata like Title, Author, etc and even the text content inside the book.



来源:https://stackoverflow.com/questions/4706503/storing-books-in-a-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!