Voedger Internals
  • Introduction
  • 💡Concepts
    • Event Sourcing & CQRS
    • Editions (deprecated)
      • Community Edition
      • Standart Edition
      • Standart Edition (v1)
  • 🚀Server
    • Overview (Server)
    • Design
      • Query Processor
      • API Gateway implementation
      • N1 Cluster
      • N3 Cluster
      • N5 Cluster
      • Orchestration
      • Sequences
      • Packages overview
        • sys
        • registry
    • Features
      • API Gateway
        • API v2
          • Conventions
            • API URL
            • HTTP methods and processors
            • Naming conventions
            • Query constraints
            • Error handling
          • Documents and records
            • Create document or record
            • Update document or record
            • Deactivate document or record
            • Read document or record
            • Read from CDoc collection
          • Queries
            • Read from query
          • Views
            • Read from view
          • Commands
            • Execute command
          • BLOBs
            • Create BLOB
            • Read BLOB
          • Temporary BLOBs
            • Create temporary BLOB
            • Read temporary BLOB
          • Schemas
            • List app workspaces
            • List workspace roles
            • Read workspace role schema
        • API v1
          • API Conventions
          • BLOBs
      • Admin Endpoint
      • Clusters
        • Bootstrap
        • Monitoring
        • Secure prometheus and grafana
        • Alerting
        • Maintenance
          • SELECT, UPDATE
      • VVMs
      • Applications
        • Deploy Application
        • Sidecar Applications
      • AuthNZ
        • Issue Principal Token
        • Refresh Principal Token
        • Enrich Principal Token
        • ACL Rules
        • Global Roles
      • Data types
        • Core types
        • Small integers
        • Uniques With Multiple Fields
        • Verifiable Fields
      • Workspaces
        • Create Workspace
        • Deactivate Workspace
        • See also (Workspaces)
      • Invites
        • Invite to Workspace
        • Join Workspace
        • Leave Workspace
        • Cancel sent Invite
        • Cancel accepted Invite
        • Update Invite roles
      • Users
        • Create a new user
        • Change user password
        • Send Email
        • Reset password
        • Change Email
      • Notifications
        • Heartbeats
      • Devices
        • Create a new device
        • Join device to workspace
      • Jobs
      • DMBS Drivers
        • AmazonDB Driver
      • Frozen
        • Ephemeral Storage
        • Storage Extensions
  • 🛠️Framework
    • Overview (Framework)
    • Features
      • vpm
      • vpm init
      • vpm tidy
      • vpm baseline
      • vpm orm
      • vpm build
      • API for testing
  • Development
    • Requirements Management
    • Requirements Management (Overview)
Powered by GitBook
On this page
  • Motivation
  • Introduction
  • smallint
  • tinyint
  • Functional design
  • Technical design
  • Test plan
  • Addressed issues
  • Footnotes

Was this helpful?

Edit on GitHub
  1. 🚀Server
  2. Features
  3. Data types

Small integers

PreviousCore typesNextUniques With Multiple Fields

Last updated 3 days ago

Was this helpful?

Motivation

As of March 2025, Voedger does not support 2-byte and 1-byte integers. This limitation causes unnecessary storage and processing overhead, particularly for data types that don't require the full range of 4-byte integers.

Introduction

This document outlines the implementation of two smaller integer data types in Voedger: smallint (2 bytes) and tinyint (1 byte). Adding these types will optimize storage utilization and processing efficiency for appropriate use cases.

smallint

A 2-byte signed integer type with range from -32,768 to 32,767.

smallint is declared in ISO/IEC 9075 standard and is widely supported by popular SQL database systems:

  • MySQL:

  • MariaDB:

  • Microsoft SQL Server:

  • PostgreSQL:

  • IBM Db2:

tinyint

A 1-byte signed integer type with range from -128 to 127

While not declared in the ISO/IEC 9075 standard, tinyint is implemented by several major SQL database systems:

Functional design

Example of a view with smallint and tinyint columns:

VIEW MeasurementAggr (

    -- Partion key

    ID smallint,
    Period smallint,
    Cluster smallint,

    -- Clustering key

    Year smallint,
    Month tinyint,
    Day tinyint,
    Hour tinyint,
    Minute tinyint,
    Second tinyint,

    -- Value

    Cnt smallint,           -- Number of measurements
    Sum double precision,   -- Sum of measurements
    Min double precision,   -- Minimal measurement
    Max double precision    -- Maximum measurement

    PRIMARY KEY ((ID, Period, Cluster), Year, Month, Day, Hour, Minute, Second)
)

Technical design

  • ~cmp.AppDef~✅: Support new data types

  • ~cmp.Parser~✅: Support new data types

  • ~cmp.istructs~✅: Add new members to IRowReader and IRowWriter interfaces

  • ~cmp.istructsmem~✅: Implement new members of IRowReader and IRowWriter interfaces

Test plan

  • ~it.SmallIntegers~✅

Addressed issues

Footnotes

MySQL:

MariaDB:

Microsoft SQL Server:

SMALLINT
SMALLINT
smallint
smallint
SMALLINT
TINYINT
TINYINT
tinyint
SMALLINT & TINYINT #3430