


A new version of WeChat's full-platform terminal database WCDB is open source, with new support for C++ and Kotlin
News on April 9th, WCDB is a terminal database based on SQLite open sourced by the WeChat team. Since it was open sourced in June 2017, more than ten versions have been launched.
As one of the most frequently used apps in China and even around the world, WeChat internally covers databases for various businesses, and the number of stored messages can reach millions or even tens of millions. This huge amount of data and increasingly rich application scenarios have brought constantly updated needs and challenges to WCDB, and the original code framework has gradually become difficult to cope with.
Therefore, starting from 2019, WeChat decided to abandon the backward compatibility of the interface and make every effort to create a more powerful new version of WCDB. After multiple iterations, WCDB's interface layer and core logic layer have been comprehensively improved, and many new features have also been accumulated.
Now, WeChat announced that the new version of WCDB, which has been majorly upgraded, will be open source. The main changes and updates include:
Richer development language Support: New support for C, complete support for Java and Kotlin language ORM, covering more terminal platforms;
More powerful SQL expression capabilities: Winq has been rewritten, Strengthening, etc.;
More secure data storage capabilities: new data backup solutions, repair solutions, etc.;
More flexible data expansion capabilities : Data migration, data compression, etc.;
More detailed performance optimization capabilities: FTS5 optimization, interruptible transactions, etc.
WCDB version 1.0 supports three development languages: Objective-C, Swift, and Java. Except for the three languages of WCDB, they share the same version of SQLite and the same set of backup and repair logic. The code is all developed independently.
As WCDB continues to iterate, many of WCDB's new capabilities have been developed and verified online on the ObjC version. The Swift and Java versions are basically in a state of stopping iteration, and the differences between them are getting bigger and bigger. . In an ideal state, WCDB in different language versions should have the same capabilities. However, if the new logic of the ObjC version is re-implemented in Swift and Java, it will not only be a heavy workload, but also prone to errors. It will need to be verified online again, which is not very good. Reality.
Fortunately, The core logic of the ObjC version of WCDB is implemented in C, and ObjC is only used to implement the logic of the interface layer. Many libraries that support multiple development languages use C language to implement core logic, and other languages are only used to implement the interface layer, such as the very popular client-side NoSQL database component realmDB. WCDB can also be designed according to this idea, so that the ObjC version of WCDB only needs minor adjustments, and the core logic is completely implemented in C. Swift and Java access the C core logic through the bridging method.
In addition, in order to fully support the database development needs of different scenarios on each side of WeChat, WCDB has also expanded its support for C and Kotlin, thus fully covering the current mainstream languages for terminal development.

At the interface level, the new version of WCDB fully supports the five major terminal development languages C, Java, Kotlin, Swift and ObjC, covering The four major terminal platforms are Android, iOS, Windows and Linux. At the same time, WeChat has also rewritten and strengthened Winq, enabling developers to write arbitrary SQL using native syntax in various languages.
At the functional level, the new version of WCDB has launched a new data backup and repair solution, which improves the data repair rate and reduces the performance consumption of data backup to negligible.
In addition, WeChat has also launched two new functions: data migration and data compression, allowing developers to deal with the two major problems of excessive data aggregation and excessive data expansion in complex businesses through simple configuration. . The new version of WCDB also introduces new features such as FTS5 optimization and interruptible transactions, allowing developers to achieve more extreme performance optimization in specific scenarios.
The new version of WCDB has been open sourced on Github. The project address is attached to this site:
https://github.com/Tencent/wcdb
The above is the detailed content of A new version of WeChat's full-platform terminal database WCDB is open source, with new support for C++ and Kotlin. For more information, please follow other related articles on the PHP Chinese website!

Stay informed about the latest tech trends with these top developer newsletters! This curated list offers something for everyone, from AI enthusiasts to seasoned backend and frontend developers. Choose your favorites and save time searching for rel

This tutorial guides you through building a serverless image processing pipeline using AWS services. We'll create a Next.js frontend deployed on an ECS Fargate cluster, interacting with an API Gateway, Lambda functions, S3 buckets, and DynamoDB. Th

This pilot program, a collaboration between the CNCF (Cloud Native Computing Foundation), Ampere Computing, Equinix Metal, and Actuated, streamlines arm64 CI/CD for CNCF GitHub projects. The initiative addresses security concerns and performance lim


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version
Recommended: Win version, supports code prompts!
