Primitive Data Types


What is the list of primitive types provided by the type system (i.e. double, int, string, long string, decimal, etc.)? What are the treatments of each of those types in: Sql, NoSql, Javascript runtime, Java runtime, python runtime?



Numeric types:

  • integer
  • long int
  • byte
  • double
  • float
  • decimal

These are all stores as native number values in the RDBMS and their natural Java representations in the key/value store.

All these are represented as Number in JavaScript.

Other types:

  • string
  • boolean
  • datetime
  • json
  • binary

These are stored using the native types in the RDBMS. The atomic values above are stored in their natural Java representation in the key/value store. JSON is stored as a serialized string and binary is stored as a raw byte sequence.

In JavaScript, string boolean and json have natural representations. Datetime uses the C3 DateTime object. Binary uses the ES5 ArrayBuffer.



why should we use double vs. float vs. decimal in our code?



this is essentially correct: