SQL & Persistent Data

The Barracuda Application Server (BAS) APIs offer several methods for managing persistent data. A simple approach is to serialize Lua tables to a persistent store. However, more advanced options, such as using an SQL database, are also available.

BAS supports embedding SQLite directly into the server; the pre-compiled Mako Server comes with an already integrated SQLite. See the SQLite tutorial and SQLite APIs for details.

In addition to SQLite, BAS provides SQL drivers for external databases, supporting MySQL, Redis, MongoDB, and PostgreSQL. For more information, refer to Database Drivers. The tutorial ESP32 and MySQL Cloud Integration demonstrates how to use the MySQL driver on a microcontroller, enabling it to connect to an online MySQL database instance.