Skip to main content

# KVDB and TableDB

Besides device control, XXTLanControl includes two built-in data tools that you can manage directly from the UI: KVDB and TableDB.

## KVDB​

KVDB is good for lightweight shared state. It contains two structures:

- `queue`: useful for task delivery, consumption order, and waiting lists
- `dict`: useful for configuration, flags, counters, and shared variables

The KVDB manager currently supports:

- creating, renaming, and deleting queues or dictionaries
- queue push, pop, clear, value-based removal, and counting
- dictionary write, copy, move, increment, delete, and read-all
- full backup and restore

If your scripts or schedules need to read the state stored here, you can also use it through `LCC.kvdb`.

## TableDB​

TableDB is good for structured tabular data such as account lists, run results, and other business data.

The TableDB manager currently supports:

- creating new tables
- editing table schema
- adding, editing, and deleting rows
- truncating or deleting tables
- sorting, searching, and paginated browsing
- per-column statistics
- single-table import and export in `JSON`, `CSV`, and `XLSX`
- full backup and restore

If your scripts or schedules need to read or write these tables, you can continue using them through `LCC.db`.

## When to Use Which One​

- Use `KVDB` for simple state, counters, and queues
- Use `TableDB` for structured records, import/export, filtering, and sorting
- If your workflow uses both scripts and schedules, choose by data shape: state and queues fit `KVDB`, while tabular business data fits `TableDB`