  A trade-off between two QoS requirements of wireless sensor networks: query
waiting time and validity (age) of the data feeding the queries, is
investigated. We propose a Continuous Time Markov Decision Process with a drift
that trades-off between the two QoS requirements by assigning incoming queries
to the wireless sensor network or to the database. To compute an optimal
assignment policy, we argue, by means of non-standard uniformization, a
discrete time Markov decision process, stochastically equivalent to the initial
continuous process. We determine an optimal query assignment policy for the
discrete time process by means of dynamic programming. Next, we assess
numerically the performance of the optimal policy and show that it outperforms
in terms of average assignment costs three other heuristics, commonly used in
practice. Lastly, the optimality of the our model is confirmed also in the case
of real query traffic, where our proposed policy achieves significant cost
savings compared to the heuristics.
