Home / Companies / Couchbase / Blog / Post Details
Content Deep Dive

Reuse SQL Queries between Server & Mobile App Databases

Blog post from Couchbase

Post Details
Company
Date Published
Author
Aaron LaBeau - Principal Software Engineer
Word Count
2,183
Language
English
Hacker News Points
-
Summary

The Couchbase Mobile 3.0 release introduces support for SQL++ queries, allowing developers to reuse code between Couchbase Server and Mobile applications. To test the query reusability, a sample mobile application was created in SwiftUI with Combine, which displays all ice cream shops in the United States. A simple query is written using the Query Editor from the Couchbase Server Web Console, and its performance is compared to running the same query on the mobile app. The results show that the query runs faster when an index is added to the database. However, reusing queries between Couchbase Server and Mobile may require modifications to optimize performance due to differences in storage and query engines. It's recommended to read through the excellent documentation on SQL++ for Mobile – Differences from SQL++ for Server and SQL++ Query Strings for valuable information on changes needed to use queries in mobile applications.