<commit_before># Redis #

## List of Redis Databases ##

The databases used by CartoDB are:

  - **0 - tables_metadata**: stores metadata from user tables
  - **1 - queries_log**: stores an entry per request performed, storing the IP of the request and some information of the request (deactivated)
  - **2 - threshold**: stores the number of queries run per user and per table, and the kind of those queries (selects, inserts....)
  - **3 - api_credentials**: stores the credentials to access to CartoDB via API. This credentials are OAuth validated tokens and API keys
  - **4**: base DB used for nodejs tiler. Will change in future

### tables_metadata database ###

`tables_metadata` database stores metadata from the user tables. This metadata can be the privacy of the table, the owner identifier, the schema, and so on. 

The database is structured in hashes. The key of each hash has the following format:

  rails:<database_name>:<table_name>
  
The values of the hash are:

  - `schema`: the schema of the table, as an array of arrays. Example: `["cartodb_id,integer,number", "name,text,string", "description,text,string", "the_geom,geometry,geometry,point", "autono_id,smallint,number", "autono_name,character varying(255),string", "provincia_id,smallint,number", "provincia_name,character varying(255),string", "municipio_id,smallint,number", "municipio_name,character varying(255),string", "area_id,smallint,number", "created_at,timestamp,date", "updated_at,timestamp,date"]`
  - `columns`: an array with the names of the columns. Example: `["cartodb_id","name","description","the_geom","autono_id","autono_name","provincia_id","provincia_name","municipio_id","municipio_name","area_id","created_at","updated_at"]`
  - `the_geom_type`: the geometry type. Example: `point`
  - `privacy`: the privacy of the table. 0 means **private** and 1 means **public**
  - `user_id`: the identifier of the owner
  
### queries_log database ###

_deactivated_

`queries_log` database stores in a list each request performed to the API. Each list is identified by this key:

  log-<date>
    
Where date has the format `%Y-%m-%d`, i.e. 2011-10-3.

The information stored per request is a string which contains the IP, the controller name and the action name, separated by '#'. Example:
<commit_msg>updated redis keys to reflect simplified schema call<commit_after># Redis #

## List of Redis Databases ##

The databases used by CartoDB are:

  - **0 - tables_metadata**: stores metadata from user tables
  - **1 - queries_log**: stores an entry per request performed, storing the IP of the request and some information of the request (deactivated)
  - **2 - threshold**: stores the number of queries run per user and per table, and the kind of those queries (selects, inserts....)
  - **3 - api_credentials**: stores the credentials to access to CartoDB via API. This credentials are OAuth validated tokens and API keys
  - **4 - node_details**: base DB used for nodejs tiler. Will change in future

### tables_metadata database ###

`tables_metadata` database stores metadata from the user tables. This metadata can be the privacy of the table, the owner identifier, the schema, and so on. 

The database is structured in hashes. The key of each hash has the following format:

  rails:<database_name>:<table_name>
  
The values of the hash are:

  - `the_geom_type`: the geometry type. Example: `point`
  - `privacy`: the privacy of the table. 0 means **private** and 1 means **public**
  - `user_id`: the identifier of the owner
  
### queries_log database ###

_deactivated_

`queries_log` database stores in a list each request performed to the API. Each list is identified by this key:

  log-<date>
    
Where date has the format `%Y-%m-%d`, i.e. 2011-10-3.

The information stored per request is a string which contains the IP, the controller name and the action name, separated by '#'. Example:

{'fraction_non_alphanumeric': 0.10379292670425423, 'fraction_numerical': 0.009482316760635571, 'mean_word_length': 4.640173410404624, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5746013', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1092, 'n_words': 485}