A balanced and nested grid file (known as a BANG file) is a file which breaks its component space into a non-periodic grid, in which cells within the file refer to sets of points. These files are used in spatial databases, where an overarching organizational layout is required to reduce search indexing time, making it easier to retrieve files following a query. A BANG file stores information in a specific way according to the relationships between the various items within the file.
Spatial databases are databases which store information in virtual "space," allowing the end user to organize information in geometric shapes such as lines and polygons. This adds distance as a factor to the relationship between data points, as data in a spatial database is not just separated by values, but by physical proximity from other information in the database. A BANG file is a point-method for arranging these types of spatial files within a system.
A BANG file operates like an ordinary X-Y graph. When information is stored in a BANG file, it is sequestered within specific cells in the file. This organizes the data, allowing related items to be placed "closer" to one another and locating the items in the same or adjacent cells. The BANG file provides a higher level of order within the computer.
Cells in BANG files may intersect with one another. There can be overlap among cells, as in a Venn diagram. This allows information which falls into multiple categories to be stored correctly. For example, the overlap between cells in a BANG file could be used to store a piece of information that could fall into multiple organizational categories, such as a business contact who also happens to be a close personal friend.
This additional level of organization allows data to be more easily retrieved from the system. When accessing a BANG file, computers have a basic idea of where to search for desired data. In addition to assisting in data retrieval, this can provide an indication of the relationship of any one piece of data to other data in the file.