[erlang-questions] Writers Readers problem

Roberto Majadas Lopez <>
Tue Jan 31 12:18:12 CET 2012


2012/1/30 Dmitry Kolesnikov <>

> 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
> > <> wrote:
> >> 2012/1/30 Gianfranco Alongi <>
> >>>
> >>> 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
> >>> <> 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
> >>>> 
> >>>> http://erlang.org/mailman/listinfo/erlang-questions
> >>>>
> >>
> >>
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120131/414b48ea/attachment.html>


More information about the erlang-questions mailing list