Core Data iPad / iPhone BLOBS vs 20k PDF的文件系统 [英] Core Data iPad/iPhone BLOBS vs File system for 20k PDFs

查看:84
本文介绍了Core Data iPad / iPhone BLOBS vs 20k PDF的文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用核心数据设计iPad / iPhone应用程序。该应用程序的主要焦点是排序和查看多达20,000个PDF他们是〜200KB每个。通常它最好不将BLOBS存储在DB中,但对于桌面系统,我通常看到它说,如果blob是< 1 MB那么它的罚款使用DB。我应该考虑的任何考虑?如果我将它们存储在文件系统中,我可以将它们全部存储在一个目录,没有性能问题(我不需要得到一个目录列表,因为我将每个路径存储在DB中)?我应该把它们分成几个目录吗?

I'm designing an iPad/iPhone app using core data. The main focus of the app is sorting and viewing up to 20,000 PDFs They are ~200KB each. Typically its best to not store BLOBS in a DB, but for desktop systems I've typically seen it said that if the blobs are < 1 MB then its fine to use the DB. Any considerations I should take into count? If I store them in the file system can I store them all in one directory and not have performance issues (I won't need to ever get a directory list since I'd store each's path in the DB)? Should I divide them among a handful of directories? If so is there a good rule on # of files per dir?

推荐答案

我会去数据库中的路径。它更快,通过查找和备份原因。我个人使用目录的相对路径,所以我可以在系统迁移或负载平衡的情况下更改root文件夹。你可以将它们存储在一个目录中,因为当你从数据库中查找它们时,它是由唯一的id(如果你的架构设计的方式)。

I would go for paths inside your database. It's faster, by lookup and for backup reasons. I personally use a relative path to a directory, so I can change the "root" folder in case of system migration or load balancing. You can store them in a single directory, because when you are looking them up from your database, it's by unique id (if your schema is designed that way).

您可以在SQLite(其他数据库)中轻松存储1兆BLOB。只是不推荐它。

You can store easily 1 meg BLOB's inside SQLite (other databases too). Just wouldn't recommend it.

这篇关于Core Data iPad / iPhone BLOBS vs 20k PDF的文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆