A Generic Query Model for the Unified Discovery of Heterogeneous Services ABSTRACT: Peer to peer network is the machine, which works as a client and also a server in a connected network. In this project Query processing is used to get the average, sum, minimum, maximum, count is the few aggregate rules. For example, In an organization has the different databases in the different countries. If you want to get the average salary for all the employees who they getting above 10,000 rupees then you have to find the average for each database and collect the all averages and find the solution average. This process will find the average from the database randomly. This project is fully based upon the aggregate rules. Peer-to-peer (P2P) databases are becoming prevalent on the Internet for distribution and sharing of documents, applications, and other digital media. The problem of answering large-scale ad hoc analysis queries, for example, aggregation queries, on these databases poses unique challenges. Exact solutions can be time consuming and difficult to implement, given the distributed and dynamic nature of P2P databases. We present novel sampling-based techniques for range answering of ad-hoc aggregation queries in such databases. Computing a high-quality random sample of the database efficiently in the P2P environment is complicated due to several factors: the data is distributed (usually in uneven quantities) across many peers, within each peer, the data is often highly correlated, and, moreover, even collecting a random sample of the peers is difficult to accomplish. To counter these problems, we have developed an adaptive two-phase sampling approach based on random walks of the P2P graph, as well as block-level sampling techniques. We present extensive experimental evaluations to demonstrate the feasibility of our proposed solution. EXISTING SYSTEM: In existing systems, doesn’t use any random selection of peer algorithm. This will make the system latency. If any of the system has disconnected means very difficult to identify that. So that was not given the accurate output. Also they pass the queries to the peer network one by one. This is also making Latency. They didn’t use Markov chain algorithm and random selection of nodes at all. So the process only by done sequential. Then the average output of all peers and probability of output you should have to find manually. To reduce the latency we are going for range query processing. PROPOSED SYSTEM In our proposed system, we are using range query processing to get the result to decrease the latency. We are using Markov chain random walk algorithm to select the peers from the network randomly. This will make the system faster than the existing systems. In our proposed, we are passing aggregate rules to get the information from the peers which are connected with the network. We are going to pass the aggregate queries to the common database and get the information from all the peers in the same network. If any of the peers has disconnected from the network then our project shows which peer get disconnected. Random selection of peers will reduce the latency of the process. HARDWARE REQUIRMENTS: SYSTEM : PENTIUM IV 2.4 GHz HARD DISK : 40 GB RAM : 256 MB SOFTWARE REQUIRMENTS: IDE : VS .NET 2005 FRONT END : C#.net BACK END : SQL SERVER 2000 OPERATING SYSTEM : WINDOWS XP