# Lưu trữ dữ liệu bền vững (React Native) > AsyncStorage, MMKV, SQLite, Realm, lưu trữ an toàn, chiến lược caching - 20 câu hỏi phỏng vấn - Mid-Level - [Câu hỏi phỏng vấn: React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van.md) ## 1. Đặc điểm chính của AsyncStorage trong React Native là gì? **Câu trả lời** AsyncStorage là một hệ thống lưu trữ key-value bất đồng bộ, không mã hóa và bền vững. Nó hoạt động toàn cục trong toàn bộ ứng dụng và lưu dữ liệu dưới dạng chuỗi. Đây là giải pháp lưu trữ đơn giản nhất được tích hợp sẵn trong React Native, lý tưởng cho các tùy chọn người dùng đơn giản hoặc dữ liệu không nhạy cảm. ## 2. Làm thế nào để lưu một đối tượng JavaScript trong AsyncStorage? **Câu trả lời** AsyncStorage chỉ có thể lưu chuỗi. Để lưu một đối tượng JavaScript, bạn phải tuần tự hóa nó bằng JSON.stringify() trước khi lưu, rồi giải tuần tự hóa bằng JSON.parse() khi đọc. Bước này là bắt buộc vì AsyncStorage không chấp nhận đối tượng trực tiếp. ## 3. Ưu điểm chính của MMKV so với AsyncStorage là gì? **Câu trả lời** MMKV (Memory-Mapped Key-Value) mang lại hiệu năng nhanh hơn tới 30 lần so với AsyncStorage nhờ memory-mapping và truy cập dữ liệu đồng bộ. Được WeChat phát triển để xử lý hàng tỷ người dùng, nó đặc biệt phù hợp cho các ứng dụng cần đọc/ghi thường xuyên hoặc dữ liệu kích thước lớn. ## Còn 17 câu hỏi nữa - Khi nào nên dùng SQLite thay vì AsyncStorage hoặc MMKV? - Đặc điểm chính của Realm so với SQLite là gì? Đăng ký miễn phí: https://sharpskill.dev/vi/login ## Các chủ đề phỏng vấn React Native khác - [Kiến thức cơ bản về JavaScript](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/javascript-essentials.md): 25 câu hỏi, Junior - [Kiến thức cơ bản về React](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/react-fundamentals.md): 20 câu hỏi, Junior - [Kiến thức cơ bản về React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/react-native-basics.md): 22 câu hỏi, Junior - [React Hooks](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/react-hooks.md): 20 câu hỏi, Junior - [TypeScript cho React & React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/typescript-for-react-native.md): 22 câu hỏi, Junior - [Thành phần & API React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-components-api.md): 20 câu hỏi, Junior - [Styling & Layout trong React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-styling-layout.md): 18 câu hỏi, Junior - [Điều hướng React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-navigation.md): 22 câu hỏi, Mid-Level - [Quản lý State trong React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-state-management.md): 24 câu hỏi, Mid-Level - [Networking & API trong React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-networking-api.md): 20 câu hỏi, Mid-Level - [Form & Validation](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-forms-validation.md): 18 câu hỏi, Mid-Level - [Animation trong React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-animations.md): 22 câu hỏi, Mid-Level - [Native Modules & Bridge](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-native-modules.md): 20 câu hỏi, Mid-Level - [Mã đặc thù theo nền tảng](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-platform-specific-code.md): 18 câu hỏi, Mid-Level - [Quyền & Device API](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-permissions-apis.md): 20 câu hỏi, Mid-Level - [Push Notifications](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-push-notifications.md): 18 câu hỏi, Mid-Level - [Testing React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-testing.md): 20 câu hỏi, Mid-Level - [Debugging React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-debugging.md): 18 câu hỏi, Mid-Level - [Build & Deployment](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-build-deployment.md): 20 câu hỏi, Mid-Level - [Expo vs React Native Bare](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/expo-vs-bare-rn.md): 18 câu hỏi, Mid-Level - [Tối ưu hóa hiệu suất](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-performance-optimization.md): 24 câu hỏi, Senior - [Quản lý bộ nhớ](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-memory-management.md): 20 câu hỏi, Senior - [Architecture Patterns](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-architecture-patterns.md): 22 câu hỏi, Senior - [New Architecture của React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-new-architecture.md): 24 câu hỏi, Senior - [Các Phương Pháp Bảo Mật Tốt Nhất](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-security-best-practices.md): 20 câu hỏi, Senior - [Offline-First Architecture](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-offline-first.md): 20 câu hỏi, Senior - [CI/CD React Native](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-ci-cd.md): 20 câu hỏi, Senior - [Monorepo & Chia sẻ mã](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-monorepo-architecture.md): 18 câu hỏi, Senior - [Chủ đề nâng cao](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-advanced-topics.md): 22 câu hỏi, Senior - [Vòng đời ứng dụng & Thực thi nền](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-app-lifecycle-background.md): 20 câu hỏi, Mid-Level - [Xác thực & Quản lý phiên](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-auth-session-management.md): 22 câu hỏi, Mid-Level - [Monitoring & Crash Reporting](https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-monitoring-crash-reporting.md): 20 câu hỏi, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/vi/technologies/react-native/cau-hoi-phong-van/rn-data-persistence