<html><head></head><body bgcolor="#FFFFFF"><div>I see but this is what I mean...</div><div><br></div><div>User session is an erlang n-process. When user asks for token it gets a noncenc + serialized node and pid of n-process + signature.</div>
<div><br></div><div>When it connects to erlang app m-process, user supplies a token. M-process validates signature, deserialize address (pid+node) and asks n-process to validate noncenc. If n-process is not exists then session is expired. </div>
<div><br></div><div>No needs for shared memory like ets, mnesia, etc.</div><div><br>Best Regards,<div>Dmitry >-|-|-*></div><div><br></div></div><div><br>On 31.1.2012, at 13.18, Roberto Majadas Lopez <<a href="mailto:roberto.majadas@openshine.com">roberto.majadas@openshine.com</a>> wrote:<br>
<br></div><div></div><blockquote type="cite"><div>2012/1/30 Dmitry Kolesnikov <span dir="ltr"><<a href="mailto:dmkolesnikov@gmail.com">dmkolesnikov@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
why not pass tokens from (n)-process directly to (m)-process?<br></blockquote><div><br></div><div><br></div><div>The problem is that i've n process representing an user session, and the token is like a "ticket" to authorize to take some information from the server. The real user gets the token and goes to an http server (inside the erlang app) a create one of the (m)-process. This process needs to check if the token is valid or not. If is valid, the user can get the data and the token is removed. </div>
<div><br></div><div>thanks for the hell and regards </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
- D.<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Jan 30, 2012, at 11:21 PM, Gianfranco Alongi wrote:<br>
<br>
> Okay, so here goes some of my immediate thoughts,<br>
><br>
> First - I would write some wrapper that abstracts away from the<br>
> implementation of the storage,<br>
> this way you should be able to try out some of your ideas quickly<br>
> without being punished too much.<br>
><br>
> If you need access across multiple nodes, I would go for a simple<br>
> mnesia implementation.<br>
> If you get too much lock contention - distribute the tokens over a<br>
> deterministic key space using hashes or whatever you need.<br>
> Mnesia is also nice since you get redundancy and persistency - once<br>
> your system comes up again, it's all there<br>
> and you can start chugging along.<br>
><br>
> If this is too slow for you and you don't need redundancy or<br>
> persistency - try it out with ets tables.<br>
><br>
> /G<br>
><br>
> On Mon, Jan 30, 2012 at 10:07 PM, Roberto Majadas Lopez<br>
> <<a href="mailto:roberto.majadas@openshine.com">roberto.majadas@openshine.com</a>> wrote:<br>
>> 2012/1/30 Gianfranco Alongi <<a href="mailto:gianfranco.alongi@gmail.com">gianfranco.alongi@gmail.com</a>><br>
>>><br>
>>> Some questions that can help us give you an accurate answer<br>
>>><br>
>>> 1) How frequent does this happen?<br>
>>> Once a second?<br>
>>> Once a minute?<br>
>>> Once an hour?<br>
>><br>
>><br>
>> less than a second<br>
>><br>
>>><br>
>>><br>
>>> 2) How large is the token?<br>
>>> 1 byte?<br>
>>> 1 Kbyte?<br>
>>> 1 Mbyte?<br>
>><br>
>><br>
>><br>
>> probably 10-20 chars<br>
>><br>
>>><br>
>>><br>
>>> 3) Do you need the storage to scale dynamically with more added nodes?<br>
>><br>
>><br>
>> could be ok, but i think is not required<br>
>><br>
>>><br>
>>><br>
>>> 4) What more do you expect of the storage?<br>
>>> - Automatic signaling on add/delete?<br>
>>> - Triggers?<br>
>><br>
>><br>
>> not required<br>
>><br>
>> Thanks :)<br>
>><br>
>>><br>
>>> etc<br>
>>><br>
>>> Cheers<br>
>>> G<br>
>>><br>
>>> On Mon, Jan 30, 2012 at 7:11 PM, Roberto Majadas Lopez<br>
>>> <<a href="mailto:roberto.majadas@openshine.com">roberto.majadas@openshine.com</a>> wrote:<br>
>>>> Hello everyone:<br>
>>>><br>
>>>> I'm writting a erlang app and i've the next scenario:<br>
>>>><br>
>>>> The app has n process that writes tokens in "somewhere" and there are m<br>
>>>> process that reads one of those tokens and remove it.<br>
>>>><br>
>>>> Which is the best way to store this tokens ?<br>
>>>> * global ets<br>
>>>> * a gen_server + ets<br>
>>>> * mnesia<br>
>>>> * ...<br>
>>>><br>
>>>> thanks in advance<br>
>>>><br>
>>>> Roberto<br>
>>>><br>
>>>> _______________________________________________<br>
>>>> erlang-questions mailing list<br>
>>>> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>>>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
>>>><br>
>><br>
>><br>
> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</div></div></blockquote></div><br>
</div></blockquote></body></html>