In the context of Factorio, the term "global" refers to two different things:
localare global: https://www.lua.org/pil/14.2.html.
globaltable each mod has access to, which is a table with the name
global, declared as a global variable that is persisted between saves and loads.
During the lifetime of a mod, it will frequently want to save mutable data. Although mods are free to store such data in any variable, the game will not persist it between saving and loading.
To address this, Factorio provides the
global table: a Lua global variable that is serialized and persisted between saving and loading of a map. Each mod has access to its own instance of this table, so there is not need to worry about namespacing. Circular references are handled properly as well.
Only specific data can be stored in
nil, strings, numbers, booleans.
Functions are not allowed in
global and will throw an error when saving.