By providing an appropriate mechanism for the seamless cooperation of data discovery and application logic in the fast-evolving ad-hoc/P2P networks, we can significantly facilitate the development of a wide range of reactive applications in this dynamic context. In recent years, increasing amount of data sources and requirement of complicated logic make it difficult to implement reactive systems by hard-coded applications. A challenging issue toward above objectives is to achieve high-level portability and reusability of reactive components in the dynamic context. In this paper, we propose a new system architecture of active database including a media-independent active rule processing mechanism, which significantly improves both productivity and throughput performance of reactive systems. By applying our system architecture, developers can rapidly design and implement diversified reactive applications by assembling modular and extensible active rules. We have developed a holistic rule optimizer for sharing the work among multiple concurrently running rules. We report our experimental results to show the effectiveness of our approach.