Home Technology peripherals It Industry A new version of WeChat's full-platform terminal database WCDB is open source, with new support for C++ and Kotlin

A new version of WeChat's full-platform terminal database WCDB is open source, with new support for C++ and Kotlin

Apr 09, 2024 pm 04:16 PM
linux git database c++ wcdb WeChat open source Tencent open source

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.

微信全平台终端数据库 WCDB 全新版本开源,新增支持 C++ 和 Kotlin

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

C# vs. C  : History, Evolution, and Future Prospects C# vs. C : History, Evolution, and Future Prospects Apr 19, 2025 am 12:07 AM

The history and evolution of C# and C are unique, and the future prospects are also different. 1.C was invented by BjarneStroustrup in 1983 to introduce object-oriented programming into the C language. Its evolution process includes multiple standardizations, such as C 11 introducing auto keywords and lambda expressions, C 20 introducing concepts and coroutines, and will focus on performance and system-level programming in the future. 2.C# was released by Microsoft in 2000. Combining the advantages of C and Java, its evolution focuses on simplicity and productivity. For example, C#2.0 introduced generics and C#5.0 introduced asynchronous programming, which will focus on developers' productivity and cloud computing in the future.

What to do if the git download is not active What to do if the git download is not active Apr 17, 2025 pm 04:54 PM

Resolve: When Git download speed is slow, you can take the following steps: Check the network connection and try to switch the connection method. Optimize Git configuration: Increase the POST buffer size (git config --global http.postBuffer 524288000), and reduce the low-speed limit (git config --global http.lowSpeedLimit 1000). Use a Git proxy (such as git-proxy or git-lfs-proxy). Try using a different Git client (such as Sourcetree or Github Desktop). Check for fire protection

Python vs. C  : Learning Curves and Ease of Use Python vs. C : Learning Curves and Ease of Use Apr 19, 2025 am 12:20 AM

Python is easier to learn and use, while C is more powerful but complex. 1. Python syntax is concise and suitable for beginners. Dynamic typing and automatic memory management make it easy to use, but may cause runtime errors. 2.C provides low-level control and advanced features, suitable for high-performance applications, but has a high learning threshold and requires manual memory and type safety management.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to solve the efficient search problem in PHP projects? Typesense helps you achieve it! How to solve the efficient search problem in PHP projects? Typesense helps you achieve it! Apr 17, 2025 pm 08:15 PM

When developing an e-commerce website, I encountered a difficult problem: How to achieve efficient search functions in large amounts of product data? Traditional database searches are inefficient and have poor user experience. After some research, I discovered the search engine Typesense and solved this problem through its official PHP client typesense/typesense-php, which greatly improved the search performance.

How to update local code in git How to update local code in git Apr 17, 2025 pm 04:48 PM

How to update local Git code? Use git fetch to pull the latest changes from the remote repository. Merge remote changes to the local branch using git merge origin/<remote branch name>. Resolve conflicts arising from mergers. Use git commit -m "Merge branch <Remote branch name>" to submit merge changes and apply updates.

Python vs. C  : Exploring Performance and Efficiency Python vs. C : Exploring Performance and Efficiency Apr 18, 2025 am 12:20 AM

Python is better than C in development efficiency, but C is higher in execution performance. 1. Python's concise syntax and rich libraries improve development efficiency. 2.C's compilation-type characteristics and hardware control improve execution performance. When making a choice, you need to weigh the development speed and execution efficiency based on project needs.

See all articles