Mobile-specific Database Realm introduction

Source: Internet
Author: User
Tags sqlite

We currently have a swift IOS app that uses realm for data storage, discarding CoreData and SQLite.
Project Address Https://github.com/realm


Realm is an alternative to the mobile database, SQLite and ORM framework that runs directly on mobile, tablet, wearable devices. There are android,ios and react native JS versions. The Realm-cocoa project includes the Ios/os x version of OBJC and Swift implementations.
Characteristics:
    • Mobile-first:realm is the first database to run directly on mobile, tablet, wearable device design and development
    • Simple: Data directly exposed to class objects, through the code query, to avoid the ORM mapping maintenance and performance issues. In addition, realm strives to keep the API to include only 4 base classes (Object, Array, Results and Realms) and a tool class (migrations), which users can use intuitively, using realm in the app within minutes
    • Modern:realm supports correlation, generics, vectorization, and even support for Swift.
    • Fast:realm is faster than native SQLite in basic database operations, while maintaining a richer set of feature features.


The REALM-BROWSER-OSX project is a realm database client tool on a Mac that supports viewing and modifying realm database files, and functions like sqliteadmin.


Required conditions
IOS 8 or later, OS X 10.9 or later & WatchKit, iOS7.0 not supported, The reason is that iOS7.0 does not support third-party dynamic libraries, but contains swift code and cannot be compiled into a static library (but OBJC version realm supports iOS7.0). Xcode 7.0 or later, we recommend swift2.x above.

Sample Code
Import realmswift//Dog modelclass dog:object {    dynamic var name = ""    dynamic var Owner:person? Properties can be optional}//person Modelclass person:object {    dynamic var name = ""    dynamic var birthdate = NSDate (timeintervalsince1970:1) let    dogs = List<dog> ()}


Mobile-specific Database Realm introduction

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.