Provide example for why it is not advisable to store images in CoreData?

前端 未结 3 1424
温柔的废话
温柔的废话 2021-01-07 14:48

this question has been asked many times, I have read many users telling that it is not advisable to store images in a DB, in particular within CoreData. By they all seems to

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 15:42

    The filesystem, and the API:s surrounding it is (just like a webserver) optimized to serve files, of any size, and to apply caching where appropriate.

    CoreData is optimized for handling an object graph with tiny pieces of data, like integers and short strings.

    Also, there are a number of other issues that tend to creep up on you, like periodically vacuuming the SQLite database CoreData uses, or it won't be able to shrink, just grow.

提交回复
热议问题