<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 18, 2019, at 5:52 PM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu" class="">shijunxiao@email.arizona.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class="">Hi Nick<div dir="auto" class=""><br class=""><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div dir="ltr" class=""><div dir="auto" class=""><br class=""></div><div dir="auto" class="">On the other hand, I could have a separate "database" application answering aggregation queries. In this case, the database application could easily provide individual data points as well. Then, is there any value to still have the repo, and store every data point twice?</div></div></div></div></blockquote><div class=""><br class=""></div>I would not add aggregation operators to to the repo.  I would, however, have an aggregation app serving a slightly different namespace, that was able to locally access the data in the repo and provide the aggregated result to any clients requesting it. </div></div></blockquote></div></div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">Would this "aggregation app" be a general purpose utility, or does it have to be tailored to each application such as building sensing?</div><div dir="auto" class="">If it's general purpose, how could the app understand the specific naming and encoding format of building sensing protocol?</div></div></div></blockquote><div><br class=""></div>I would expect it to be designed in concert with the data logging application -- it could start off being single purpose but you might find that it generalizes.  In the same way that a SQL query has to know the naming and encoding of data in tables.</div><div> <br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div dir="auto" class=""><br class=""></div><div dir="auto" class=""><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""> That's going to be local, not network, I/O.  The aggregated response might be cached, possibly in the same repo as the raw measurements.  It doesn't require storing the data twice.</div></div></blockquote></div></div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">Is this "aggregation app" accessing the data directly on the disk, or does it have to send Interests to the repo via a local socket?</div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div dir="auto" class=""><br class=""></div><div dir="auto" class="">If using disk access, what's the benefit of having it as a separate app?</div><div dir="auto" class=""><br class=""></div><div dir="auto" class="">If using Interest-Data exchanges, even if the packets are local, this still has huge overhead (encoding, forwarding, processing, etc) compared to a SQL query on the database.</div><div dir="auto" class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>This is a pretty raw view of my reasoning, having thought about the problem for all of 10 minutes:</div><div><br class=""></div>I'd design it as Interest-Data exchanges to start with, then I'd measure the system performance to see if it was acceptable and if it's scaling properties met my requirements, and if it wasn't performing/scaling reasonably then I'd look at where the problem was and design a solution that addressed the problem.  I am a fan of optimizing implementation/architecture based on actual measurement -- though of course one's choices should be informed by theoretical complexity issues... but the constants matter too!</div><div><br class=""></div><div>I don't immediately come to the same conclusion as you do about a SQL query vs an application such as I'm describing.</div><div><br class=""></div><div>Remember that the repo (at least the one I worked on & with) stores everything in wire-format packets.  It happened to use B-trees with pages of comparable size to a disk page so the I/O performance was good, there were many (if they were small) content packets in a B-tree block and there was caching of the B-tree blocks so the overhead for reading multiple sequential items was minimized.</div><div><br class=""></div><div>The only *encoding* operation should be on the aggregation results.</div><div><br class=""></div><div>All of the forwarding operations should be in-memory.  I doubt that you can get zero-copy from the in-memory repo packet through to the aggregation application's buffer, but it shouldn't be massively bad.</div><div><br class=""></div><div>There are analogous operations in both the repo and SQL cases -- SQL is going to be interpreting a table schema to drive accesses to table data stored on disk (and cached in memory) and decoding and applying the operations from the query etc. etc.  For both SQL and stored content objects you'll be making data representation choices that affect the speed of the operations you'll be doing (e.g., storing measurements as text or binary values).</div><div><br class=""></div><div>People have cared for some time that SQL databases had good performance... so a lot of time has been spent optimizing them.</div><div>Nobody has spent a lot of time optimizing repo query tools, and the supporting NDN components, but I think it would have a good payoff for many applications if someone did.</div><div><br class=""></div><div>Does that give you a better understanding of my position?</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div dir="auto" class="">Yours, Junxiao</div><div dir="auto" class=""></div></div>
</div></blockquote></div><br class=""></body></html>