mysql q
ik
idokan at gmail.com
Sun Nov 17 15:51:01 IST 2013
On Sun, Nov 17, 2013 at 3:39 PM, Erez D <erez0001 at gmail.com> wrote:
>
>
>
> On Sun, Nov 17, 2013 at 10:36 AM, ik <idokan at gmail.com> wrote:
>
>> Hi, I think you tackle it wrong.
>>
>> If there is no need for accessing the database all the time, why not
>> cache the result in tools such as Memcached or Redis ?
>>
> then i will still need to poll Memcached or Redis. this may speedup
> things, but it is still polling, which i try to avoid
>
Both Memcahed and Redis are RAM based, while SQL is disk based.
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.
> 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.
>>
> still neab client need to poll the server
>
>>
>> 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.
>>
>> 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 ?
>>
> i do not refresh the whole page, i use ajax.
>
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).
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.
>
> 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...
> if we talk about polling, i need to poll every 5 seconds, but if there is
> no db change, then this is in vain
>
> i want to work event driven, and not polling, so i thought mysql has a
> builtin machanism for this.
> if it doesn't i will need to warp it up in some other code - i was trying
> to avoid that.
>
> thanks,
> erez.
>
>
>>
>> Ido
>>
>>
>> On Sun, Nov 17, 2013 at 10:18 AM, Erez D <erez0001 at gmail.com> wrote:
>>
>>> hello
>>>
>>> i have a web page that refreshes all the time to display things from a
>>> mysql database which is updated from time to time.
>>> 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.
>>>
>>> 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).
>>>
>>> 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.
>>>
>>> does mysql support that ?
>>> examples of doing that will be nice
>>>
>>>
>>> thanks,
>>> erez.
>>>
>>> _______________________________________________
>>> Linux-il mailing list
>>> Linux-il at cs.huji.ac.il
>>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20131117/b38bec7f/attachment.html>
More information about the Linux-il
mailing list