Help with OTP and architectural design for a proxy MUD system

I’ve read the Mix & OTP section of the hex docs and semi-grok things. What I’m struggling with is how everything fits together in my use case, and advice/guidance is appreciated as I’m new to Elixir (and OTP).

I want to create a proxy system for a MUD. Normally, a mud client is used to make a telnet connection to a server; my system will sit in the middle acting as a pass-through while interpreting input from both the server and client.

There will only ever be one pair of connections, so at least for the socket management, I don’t need to worry about multiple simultaneous connections. (I think OTP will be useful for data processing where distribution makes sense.)

Using an umbrella project and wanting to have test coverage, does it make sense to have a telnet_client and telnet_server app? Combine them into a single proxy app? What OTP objects and strategies would you use?

Help is appreciated in how best to tackle this problem space and reason about it.

Deciding for multiple OTP applications should imo be made based on deployment circumstances and not code architecture decisions. There’s no real reason to go for multiple OTP applications if they don’t need to be independently deployed or shared between multiple systems – and things will be simpler if you have a single application. And you can always build the project in a way that spliting things up will be mostly moving files around and maybe a few search and replaces.

So unless you plan to deploy the server and client individually I’d suggest keeping things simple and put them in a single application – skip the umbrella.

As for what you’d use out of OTP’ish things I’d suggest looking at thousand_islands(/ranch) for the tcp server (with gen_tcp underneigh) and likely plain gen_tcp for the client side.

5 Likes

I’ve used umbrella applications both in personal projects, early in my career, and in professional setting. They’re almost never a good choice. I second Help with OTP and architectural design for a proxy MUD system - #2 by LostKobrakai.

2 Likes