[erlang-questions] Writers Readers problem

dmitry kolesnikov dmkolesnikov@REDACTED
Tue Jan 31 13:31:19 CET 2012


I see but this is what I mean...

User session is an erlang n-process. When user asks for token it gets a
noncenc + serialized node and pid of n-process + signature.

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.

No needs for shared memory like ets, mnesia, etc.

Best Regards,
Dmitry >-|-|-*>


On 31.1.2012, at 13.18, Roberto Majadas Lopez <roberto.majadas@REDACTED>
wrote:

2012/1/30 Dmitry Kolesnikov <dmkolesnikov@REDACTED>

> why not pass tokens from (n)-process directly to (m)-process?
>


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.

thanks for the hell and regards


>
> - D.
>
> On Jan 30, 2012, at 11:21 PM, Gianfranco Alongi wrote:
>
> > Okay, so here goes some of my immediate thoughts,
> >
> > First - I would write some wrapper that abstracts away from the
> > implementation of the storage,
> > this way you should be able to try out some of your ideas quickly
> > without being punished too much.
> >
> > If you need access across multiple nodes, I would go for a simple
> > mnesia implementation.
> > If you get too much lock contention - distribute the tokens over a
> > deterministic key space using hashes or whatever you need.
> > Mnesia is also nice since you get redundancy and persistency - once
> > your system comes up again, it's all there
> > and you can start chugging along.
> >
> > If this is too slow for you  and you don't need redundancy or
> > persistency - try it out with ets tables.
> >
> > /G
> >
> > On Mon, Jan 30, 2012 at 10:07 PM, Roberto Majadas Lopez
> > <roberto.majadas@REDACTED> wrote:
> >> 2012/1/30 Gianfranco Alongi <gianfranco.alongi@REDACTED>
> >>>
> >>> Some questions that can help us give you an accurate answer
> >>>
> >>> 1) How frequent does this happen?
> >>>    Once a second?
> >>>    Once a minute?
> >>>    Once an hour?
> >>
> >>
> >> less than a second
> >>
> >>>
> >>>
> >>> 2) How large is the token?
> >>>    1 byte?
> >>>    1 Kbyte?
> >>>    1 Mbyte?
> >>
> >>
> >>
> >> probably 10-20 chars
> >>
> >>>
> >>>
> >>> 3) Do you need the storage to scale dynamically with more added nodes?
> >>
> >>
> >> could be ok, but i think is not required
> >>
> >>>
> >>>
> >>> 4) What more do you expect of the storage?
> >>>    - Automatic signaling on add/delete?
> >>>    - Triggers?
> >>
> >>
> >> not required
> >>
> >> Thanks :)
> >>
> >>>
> >>>   etc
> >>>
> >>> Cheers
> >>> G
> >>>
> >>> On Mon, Jan 30, 2012 at 7:11 PM, Roberto Majadas Lopez
> >>> <roberto.majadas@REDACTED> wrote:
> >>>> Hello everyone:
> >>>>
> >>>> I'm writting a erlang app and i've the next scenario:
> >>>>
> >>>> The app has n process that writes tokens in "somewhere" and there are
> m
> >>>> process that reads one of those tokens and remove it.
> >>>>
> >>>> Which is the best way to store this tokens ?
> >>>>  * global ets
> >>>>  * a gen_server + ets
> >>>>  * mnesia
> >>>>  * ...
> >>>>
> >>>> thanks in advance
> >>>>
> >>>> Roberto
> >>>>
> >>>> _______________________________________________
> >>>> erlang-questions mailing list
> >>>> erlang-questions@REDACTED
> >>>> http://erlang.org/mailman/listinfo/erlang-questions
> >>>>
> >>
> >>
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120131/22f26046/attachment.htm>


More information about the erlang-questions mailing list