React Native

Data Persistence

AsyncStorage, MMKV, SQLite, Realm, secure storage, caching strategies

20 면접 질문·
Mid-Level
1

What is the main characteristic of AsyncStorage in React Native?

답변

AsyncStorage is an asynchronous, unencrypted, persistent key-value storage system. It works globally across the app and stores data as strings. It's the simplest storage solution built into React Native, ideal for simple user preferences or non-sensitive data.

2

How to store a JavaScript object in AsyncStorage?

답변

AsyncStorage can only store strings. To store a JavaScript object, it must be serialized with JSON.stringify() before storing, then deserialized with JSON.parse() when reading. This step is mandatory because AsyncStorage does not accept objects directly.

3

What is the main advantage of MMKV compared to AsyncStorage?

답변

MMKV (Memory-Mapped Key-Value) offers performance up to 30 times faster than AsyncStorage thanks to memory-mapping and synchronous data access. Developed by WeChat to handle billions of users, it's particularly suited for applications requiring frequent reads/writes or large data sizes.

4

When should SQLite be used instead of AsyncStorage or MMKV?

5

What is the main characteristic of Realm compared to SQLite?

+17 면접 질문

다음 면접을 위해 React Native을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기