Open Do-hyun-Kim opened 9 months ago
UserDefaults
Key
Value
자동로그인 여부
환경 설정
localized appleLanguages
소셜 로그인 여부
CoreData
SQLite
OS
iOS
Andriod
Linux
Window
Realm
SwiftData
Swift
SwiftUI
Swift macro
Realm > Core Data > SQLite
앱의 콘텐츠나 데이터 자체를 저장/보관하는 특별한 객체를 무엇이라고 하는가?
UserDefaults
UserDefaults
는 Apple 에서 기본으로 제공하는 기본 데이터 베이스를 사용하여 저장 할 수 있다.UserDefaults
는Key
,Value
로 구성 되어있으며, 런타임시 개체를 이용하여 기본 데이터 베이스에서 사용하는 기본 값을 읽어 오기 때문에 값이 필요할 때마다 데이터 베이스를 열 필요가 없다.자동로그인 여부
,환경 설정
,localized appleLanguages
소셜 로그인 여부
등 단일 데이터등을 보관한다.CoreData
CoreData
는 Apple에서 기본으로 제공하는 FrameWork이다.SQLite
와 같이 테이블을 사용하지 않고 객체를 생성하여, 데이터를 운영하기에 더 많은 저장공간과 메모리 공간을 필요로 한다. 장점은 더욱 빠르게 데이터를 가져 올 수 있다.UserDefaults
와 비교한다면 좀 더 방대하고 복잡한 데이터를 저장하는데 적합하다.SQLite
SQLite
Apple에서 기본으로 제공하는 FrameWork는 아니며 외부 라이브러리이다.CoreData
는 FrameWork인 반면에SQLite
는 데이터 베이스 이다.OS
에 국한되어 있지 않으며iOS
,Andriod
,Linux
,Window
등과 같이 다양한 운영체제에서 사용이 가능하다.Realm
Realm
은 Apple에서 기본으로 제공하는 FrameWork는 아니며 외부 라이브러리의 의존성을 통해 사용할 수 있다.SwiftData
SwiftData
는 최근 Apple에서 제공한 FrameWork이며 선언형 코드를 통해 데이터를 쉽게 유지 할 수 있다.SwiftData
는 여전히 Core Data의 기본 스토리지 아키텍처를 사용한다.Swift
코드를 통해 데이터 쿼리와 필터링 작업을 할 수 있다.SwiftUI
와 원할하게 통합되도록 설계되어 있다.Swift macro
가 제공하는 표현식을 제공해준다.📝 참고 자료