I guarantee that Facebook does not store this data in arrays inside its database.
What you need to understand in FQL is that you are not directly querying the main Facebook data servers. FQL is a shell designed to provide access to basic social data, not allowing you to run crazy queries on real servers with performance requirements. Arbitrary user queries in the main database will be functional suicide.
FQL provides a well-designed data return structure that is convenient for the type of data you request, so any piece of data that can have multiple associations (for example, "meeting_for") is packed into an array before it is returned as an API result.
As other posters noted, the only way to preserve the structure of a programming language (for example, an array or an object) inside a database (which has no idea about these things) is to serialize it. Serialization is expensive, and once you serialize something, you actually make it unsuitable for indexing and searching. Being a social network, Facebook has to index and search for almost everything, so this data will never exist in the form of an array inside their main schemes.
Usually the only time you ever want to store serialized data in a database is temporary, such as session data, or when you have valid performance requirements. Otherwise, your data quickly becomes useless.
zombat Jan 08 2018-10-10T00: 00Z
source share