<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 17, 2013 at 3:39 PM, Erez D <span dir="ltr"><<a href="mailto:erez0001@gmail.com" target="_blank">erez0001@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Sun, Nov 17, 2013 at 10:36 AM, ik <span dir="ltr"><<a href="mailto:idokan@gmail.com" target="_blank">idokan@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi, I think you tackle it wrong.<br><br></div>If there is no need for accessing the database all the time, why not cache the result in tools such as Memcached or Redis ?<br>
</div></div></div></div></blockquote></div><div>then i will still need to poll Memcached or Redis. this may speedup things, but it is still polling, which i try to avoid </div></div></div></div></blockquote><div><br></div>
<div>Both Memcahed and Redis are RAM based, while SQL is disk based.<br></div><div>You handle them with timestamp for resources, for example last update, and once every X amount of time try to update them directly if a timestamp at the db was changed.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr"><div><div><div></div><div>If they are different clients (as in agents), then there are other tools at your disposal, such as Varnish, that create cached version for the web.<br></div></div></div></div></blockquote>
</div><div>still neab client need to poll the server <br></div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>
<div><div>
</div><div><br></div>Secondly, the MySQL/MariaDB triggers really basics if you compare them to PG and Fb (true open source solutions), not to mention non open source databases such as SQL Server and Oracle.<br><br></div>
Third, try to see how you can optimize the page. If there is no need for constant data reading, why does it constantly refresh itself ?<br></div></div></blockquote></div><div>i do not refresh the whole page, i use ajax.<br>
</div></div></div></div></blockquote><div><br></div><div>Again, it does not matter what you use, you need to know how to cache the data. For example AJAX is not HTTP just sockets, but also XML parser (the X part in AJAX).<br>
</div><div>You can create a stored procedure that every changes to the database will create new content to provide (JSON, XML, Plain Text or any other format you wish), and everyone will use the SP itself.<br></div><div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br>
</div><div>i need a repsonse time from db change, to display on browser of 5 seconds, however the db may not change in days, and then can change every second...<br></div><div>if we talk about polling, i need to poll every 5 seconds, but if there is no db change, then this is in vain<br>
<br></div><div>i want to work event driven, and not polling, so i thought mysql has a builtin machanism for this.<br></div><div>if it doesn't i will need to warp it up in some other code - i was trying to avoid that.<br>
<br></div><div>thanks,<br></div><div>erez.<br></div><div class="im"><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">
<div>
<br></div>Ido<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Sun, Nov 17, 2013 at 10:18 AM, Erez D <span dir="ltr"><<a href="mailto:erez0001@gmail.com" target="_blank">erez0001@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="ltr"><div><div><div><div><div><div><div>hello<br><br></div>
i have a web page that refreshes all the time to display things from a mysql database which is updated from time to time.<br>
</div>however. this meens a lot of un-needed acesses to the database. and this refresshing page may be openede by many browsers. causing a huge load on the database.<br>
<br></div>i know mysql supports triggers, but it seems this is only internal (i.e. trigger may do a query, usually an "update" query, but this is not what i need).<br><br>I am looking for a way to leave the connection open with mysql, not sending any queries, just waiting for mysql to notify me when a somthing changes.<br>
<br></div>does mysql support that ?<br></div>examples of doing that will be nice<br><br><br></div>thanks,<br></div>erez.<br></div>
<br></div></div>_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il" target="_blank">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div><br></div></div>
</blockquote></div><br></div></div>