The tool known as GOCDB, or Grid Operations Centre Data Base, consists of a central authoritative database which contains static Grid resource and topology related data. It stores information about regions, countries, sites, nodes, services and users, and links this information together in a logical way. Within the past years, GOCDB has imposed itself as a central authoritative repository for ... [Show full abstract] topology and site information within EGEE and WLCG. As for all other operational tools, the dramatic evolution of EGEE in order to prepare for a sustainable European Grid Infrastructure imposed many changes on GOCDB architecture. One of these changes is the requirement for a distributed architecture, where a central system can collect and display information maintained by regional instances of the system: in May 2010, GOCDB will become the official central topology repository for the European Grid Initiative (EGI), and will propose a regionalised model that will allow National Grids (NGI) to run their own instance of the system while keeping synchronised with the central EGI repository. These new requirements along with the limitations of GOCDB old model (known as GOCDB-3) led us to adopt an innovative database design based on a pseudo object database model (PROM). In this model, constraints and relations are built using meta-data. This allows for a large flexibility in the database schema, thus enabling different instances of the same tool to store different schemas while remaining interoperable. On top of this, a PHP-written input/output module gets and retrieves data in XML format, making the whole system as standard and configurable as possible. After reviewing GOCDB-3 architecture and explaining its limitations and the reasons for changing, the paper will describe GOCDB-4 inner architecture from general system overview down to technical details on database design, application level and standard interfaces. It will show how flexibility is achieved through the use of XML configuration files. Pros and cons of adopted model will also be assessed. The paper will finally review the overall distributed architecture and distribution scenarios, as well as interactions between GOCDB-4 and similar tools.