[erlang-questions] Erlang with Thrift
Geoff Cant
nem@REDACTED
Tue May 24 01:31:05 CEST 2011
On 2011-05-23, at 15:51 , Jack Moffitt wrote:
>> If you can get away from Thrift (e.g. no one else is relying on it or
>> you can't talk them off the cliff) I'd stick Erlang terms. BERT is a
>> decent way to let other languages play along, otherwise there are
>> usually language specific Erlang term conversion libraries.
>
> Speaking of BERT, how are people dealing with the possibility that
> rogue/broken clients might fill up the atom table?
>
> jack.
>
The ngmoco bert-rpc server (ngbs) uses the 'safe' option to binary_to_term to avoid this problem: https://github.com/ngmoco/ngbs/blob/master/src/ngbs_bert.erl#L21 . Clients get a protocol/data error if they try to do this.
The trade-off is that you then need to ensure that all the modules for your application are loaded before you start accepting Bert requests, as [safe] decoding will stop modules from being automatically loaded.
ngbs has been stable in production use for six months or so, and recently got request evaluation timing support which has been useful for spotting latency problems in the exposed APIs. I'd be happy to answer questions about ngbs off-list too.
Cheers,
--
Geoff Cant
More information about the erlang-questions
mailing list