We present the framework of a new grid architecture based on the peer-to-peer and the component paradigms. In our architecture, several peer-to-peer components are loosely coupled or even independent from each other. Components affect others indirectly by monitoring the system, recognizing changes caused by other components' actions, and by issuing own actions. This approach is generic and open for future extensions. It allows to design scalable, self-optimizing, and resilient grid systems that have no single point of failure. A component is a distributed software system that uses a peer-to-peer algorithm to achieve its goal. The peer-to-peer paradigm was invented for large, voluntary PC networks. We apply this concept to the field of self-optimizing grid systems and show how this new architecture can be deployed in the domain of data management. Here, various management aspects like replica creation, placement, access optimization, synchronization, etc. are cooperatively solved in separate peer-to-peer component layers. All components run concurrently. Each of them optimizes the system with respect to its goals. This separate optimization process performed by the interaction of small, manageable components yields similar or even better results, while being less complex than the holistic approach that tries to optimize the system in one step.