"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[4144],{151:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>u,frontMatter:()=>a,metadata:()=>t,toc:()=>o});const t=JSON.parse('{"id":"usage/data-management","title":"KVDB and TableDB","description":"Besides device control, XXTLanControl includes two built-in data tools that you can manage directly from the UI: KVDB and TableDB.","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/usage/data-management.mdx","sourceDirName":"usage","slug":"/usage/data-management","permalink":"/docs/en/usage/data-management","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":9,"frontMatter":{"sidebar_position":9},"sidebar":"tutorialSidebar","previous":{"title":"Remote Control and Batch Remote Control","permalink":"/docs/en/usage/remote-control"},"next":{"title":"Batch Authorization","permalink":"/docs/en/usage/batch-auth"}}');var i=s(4848),r=s(8453);const a={sidebar_position:9},d="KVDB and TableDB",l={},o=[{value:"KVDB",id:"kvdb",level:2},{value:"TableDB",id:"tabledb",level:2},{value:"When to Use Which One",id:"when-to-use-which-one",level:2}];function c(e){const n={code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",ul:"ul",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"kvdb-and-tabledb",children:"KVDB and TableDB"})}),"\n",(0,i.jsx)(n.p,{children:"Besides device control, XXTLanControl includes two built-in data tools that you can manage directly from the UI: KVDB and TableDB."}),"\n",(0,i.jsx)(n.h2,{id:"kvdb",children:"KVDB"}),"\n",(0,i.jsx)(n.p,{children:"KVDB is good for lightweight shared state. It contains two structures:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"queue"}),": useful for task delivery, consumption order, and waiting lists"]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"dict"}),": useful for configuration, flags, counters, and shared variables"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"The KVDB manager currently supports:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"creating, renaming, and deleting queues or dictionaries"}),"\n",(0,i.jsx)(n.li,{children:"queue push, pop, clear, value-based removal, and counting"}),"\n",(0,i.jsx)(n.li,{children:"dictionary write, copy, move, increment, delete, and read-all"}),"\n",(0,i.jsx)(n.li,{children:"full backup and restore"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["If your scripts or schedules need to read the state stored here, you can also use it through ",(0,i.jsx)(n.code,{children:"LCC.kvdb"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"tabledb",children:"TableDB"}),"\n",(0,i.jsx)(n.p,{children:"TableDB is good for structured tabular data such as account lists, run results, and other business data."}),"\n",(0,i.jsx)(n.p,{children:"The TableDB manager currently supports:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:"creating new tables"}),"\n",(0,i.jsx)(n.li,{children:"editing table schema"}),"\n",(0,i.jsx)(n.li,{children:"adding, editing, and deleting rows"}),"\n",(0,i.jsx)(n.li,{children:"truncating or deleting tables"}),"\n",(0,i.jsx)(n.li,{children:"sorting, searching, and paginated browsing"}),"\n",(0,i.jsx)(n.li,{children:"per-column statistics"}),"\n",(0,i.jsxs)(n.li,{children:["single-table import and export in ",(0,i.jsx)(n.code,{children:"JSON"}),", ",(0,i.jsx)(n.code,{children:"CSV"}),", and ",(0,i.jsx)(n.code,{children:"XLSX"})]}),"\n",(0,i.jsx)(n.li,{children:"full backup and restore"}),"\n"]}),"\n",(0,i.jsxs)(n.p,{children:["If your scripts or schedules need to read or write these tables, you can continue using them through ",(0,i.jsx)(n.code,{children:"LCC.db"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"when-to-use-which-one",children:"When to Use Which One"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["Use ",(0,i.jsx)(n.code,{children:"KVDB"})," for simple state, counters, and queues"]}),"\n",(0,i.jsxs)(n.li,{children:["Use ",(0,i.jsx)(n.code,{children:"TableDB"})," for structured records, import/export, filtering, and sorting"]}),"\n",(0,i.jsxs)(n.li,{children:["If your workflow uses both scripts and schedules, choose by data shape: state and queues fit ",(0,i.jsx)(n.code,{children:"KVDB"}),", while tabular business data fits ",(0,i.jsx)(n.code,{children:"TableDB"})]}),"\n"]})]})}function u(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>a,x:()=>d});var t=s(6540);const i={},r=t.createContext(i);function a(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);