Yún Bridge Library & Device Design.

Hi, first of all I'm new here, I like Arduino really much, almost fall in love hehe.
So, the question. I'm trying to make real-time monitoring on pins via the web interface (php, ajax) and I was(am) using Arduino Uno device with Yún's Bridge sketch logic (e.g http://arduino/digital/1/1) but when I bought Yún and read documentation I was just amazed by embedded Linux & communication between two processors.
So, the only question now I've got is that, I don't quite understood how the Bridge library datastore works. I mean, if I store key/value pairs to the datastore, it is shared memory for both processors, but which of the following is the right/good way to implement real-time monitoring on each pins? to save key/pairs from Linux side and use them on Arduino board within loop() function or vice-versa? also user can switch status for each pin from web interface too.
Here's pseudo code:

// Linux side.
#!/usr/bin/python
import sys
sys.path.insert(0, '/usr/lib/python2.7/bridge/')
from bridgeclient import BridgeClient as bridgeClient
bridge = bridgeClient()
myval = value.get(pinX_status)
// show myval at web interface.
// arduino side
void loop()
{
    Bridge.put(pinX_status, digital(analog)Read(pinX));
}

or

// Linux side.
#!/usr/bin/python
import sys
sys.path.insert(0, '/usr/lib/python2.7/bridge/')
from bridgeclient import BridgeClient as bridgeClient
bridge = bridgeClient()
value.put(pinX_status, 0) #off by default
// arduino side
void loop()
{
    String value = Bridge.get(pinX_status);
    digital(analog)Write(pinX, pinX_status);
}

Excuse me for my English skills, If you don't get what I'm asking for, let me know!

Thank you!