Usage of SQLite Memory Database

Source: Internet
Author: User

SQLite can not only store the database on the hard disk, but also in the memory (sqlite3_open (": Memory:", & dB). After testing, under the same conditions, the speed of storing databases in the memory is about three times faster than that of inserting records on the hard disk. However, when the database is stored in the memory, the following defects exist:

1. Power failure orProgramThe database will disappear after the crash. You need to attach the database to the hard disk regularly;

2. databases in the memory cannot be accessed by other processes (because there is no name, it may be supported later). The same handle must be used even in multiple threads;

3. read/write mutex processing on a hard disk is not supported. Lock it by yourself.

It seems that the pursuit of speed has to pay the price!

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.