GeePaw Hill Profile picture
Aug 21, 2019 24 tweets 4 min read Read on X
UDispatch #1: Start With a Bulk Reverse Proxy

UDispatch has multiple layers of functionality in it. The first thing it is: a reverse proxy on the dev box that knows your upstreams and knows they're sets.
When you're coding in a downstream, you typically have multiple upstreams you're developing against. Service#1, Service#2, and so on. Your code sends HTTP to those services, they answer with HTTP.
These services are typically arranged in sets. That is, to use Service 1A, one must also be using service 2A and 3A. (Ed. Note: I've never actually seen them named this succinctly, they usually have random strings and letters that don't indicate any sort of grouping at all.)
One encounters, in developing _our_ service, two very typical patterns, then. 1) bouncing our service to change the endpoint URLs it should be hitting. 2) changing several of them -- or forgetting or mistyping one -- whenever you change one of them.
This involves a lot of tacit knowledge, of course. You have to know which upstreams go with which. The upstreams aren't named well, even when they're named consistently, which they often aren't. It eats mental bandwidth.
Solving this problem in your own code isn't hard, it's the same thing we try to do with all tacit knowledge in code: make it explicit. Define data structures to associate them, give them good names. Change *one* variable to change *all* the endpoints.
(Persistence here is usually handled by some sort of profile mechanism, though not always. I've seen it in databases, and seen it require another external service, for instance.)
But there's no very good reason to put this in prod code, and no very good reason to solve it differently (or copy/paste) with every new downstream you create.
Instead. What if we aimed 100% of our URL's at another app running right on our local box. What if it was *that* app's job to actually know the real endpoint and communicate with it?
An app like that is called a reverse proxy. Your downstream is talking to UDispatch. It doesn't know it is (in prod mode). It thinks its talking to the real endpoints.
You'll notice, though, we can't aim our URL's *exactly* at the same endpoint on UDispatch. We have multiple upstreams. We need to talk to all of them. How do we say which one we're talking to? Easy. Add a one-word path variable to the base URL.
So, if you talk to the Mother service and the Father service, the endpoints are http://localhost:XXX/mother/ and http://localhost:XXX/father/.
And UDispatch now knows what the real endpoint is, rewrites the URL, sends the request, returns the response, and bob's yer uncle. (Don't kid yourself, there are gotchas, mostly having to do with security, but let's solve that later.)
We give UDispatch the ability to define these names. We give it the ability to combine them into named sets, one supposes families in this case, "Simpsons", "Cleavers", and so on.
Now, to swap out endpoints in a set, the developer doesn't edit her downstream's profiles/database/service at all. She doesn't *bounce* her app at all. She just hits the UDispatch UI and pulls down a combo, and from that moment forward her app is talking to a different set.
Of course, you don't *have* to change those url's as sets. UDispatch is actually offering an ad hoc arrangement, the sets are just named "presets" to change each item in the ad hoc.
So. Some questions.
1) Can this be done? 2) How hard is it? 3) What does it get us?

1) Yes. I have done it. 2) Not hard, a little finicky, the basic stuff worked right out of the box. 3) It gets us a little -- not enough, and not as much as we want -- a little.
A little: no more bouncing the downstream to change its endpoints.

A little: human-readable names for sets of associated upstreams.

A little: team-wide or org-wide app AND DATASET for all this.
So the first layer of UDispatch is just this: it's a bulk reverse-proxy with a UI that runs locally. The UI can view, edit, associate, share, & select multiple upstreams to offer its downstream. It does this at runtime 100% dynamically, with no reboots of it or its downstream.
There's more. There's actually three more layers to it, each adding another level of value to teams that are using orchestras of services to do their work. We'll get to these.
But this is enough for the moment. The next few muses in this series will just be about getting this going, open-source, binary-downloadable, and so on.
I am wanting to remind you: all of this is possible only because we're re-balancing, because we're looking away from the made to look at the making. UDispatch isn't part of whatever pile of services you're shipping. It's part of how we're going to make that pile.
I better get back to the day-job. In theory, I have some fairly lightweight UI-tightening stuff today, should go smooth and mellow.

Have your own self a smooth and mellow afternoon!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with GeePaw Hill

GeePaw Hill Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @GeePawHill

Nov 19, 2022
In today's episode of Stupid Geek Tricks, I just basically invented Smalltalk using Kotlin.

Before you get angry, please know that I don't approve of this. I don't approve of a lotta shit I do.
120 lines of code. A marker interface for messages, a one-API interface for objects. Any class can handle any message it chooses to. Didn't bother with doesNotUnderstand, but it'd be an easy add.

gist.github.com/GeePawHill/2d7…
Conceptually, it's straightforward: the Interactor wraps a Thing to give it a jump table that switches on the message subclass. It calls the Thing's register() to fill out that jump table. Any given Thing class can register any given Message+Handler pair.
Read 31 tweets
Nov 18, 2022
What is my favorite 20th c song from Broadway?

Oh my gosh, I'm so glad you asked.

[Editor's note: Nobody asxked this. No one. Not one. Nobody asked this.]
Well, of course, it's "At The Ballet" from _A Chorus Line_.

I grew up on stage, community and then semi-pro theatre. I worked 4-8 production a year from the time I was 7 until about 20 years old.

In *Kansas*, yo, in Kansas.
Read 13 tweets
Nov 18, 2022
Anyway, all and sundry, "geepawhill" is not a common moniker. Find me that way. I'm on mastodon, but I also have a whole website, geepawhill.org.
Backstory: "geepaw" means "grandfather", and now, to look at me, it seems obvious. Of *course* this bitter old fucker is a grandfather, just look at him. But "GeePaw" is actually a name I've had for over 30 years.
See, my wife is a little older than me, and when we first got to the bouncy-bouncy, her kids were already almost grown. I was present in the hospital room when my grandson was born. (It was gross.) And I became a grandfather at the ripe old age of 31.
Read 9 tweets
Nov 16, 2022
Please, I'm sorry, please, remember through all this Elon-is-evil-and-stupid shit, remember, please, I'm sorry, please.

This ass-clown *bought* this place where you made community, he didn't steal it. And he *bought* it from the people who sold it to him.
Baby, you were so sure you were the customer, all along, and so mad to discover you were product, all along.
*Fucking* mastodon. There's servers. There's CW's, and bitchy people on your server telling you to CW your random rage-tweets. There's no funded algo stuffing your timeline, just your server's locals and your follows and their follows.
Read 6 tweets
Nov 16, 2022
Jussi Bjorling, "Nessun Dorma".

I once did a bake-off. It was in the early days with spotify, and spotify is the king-hell site for bake-offs. Type in "nessun dorma" and get 500 takes.

So I listened to maybe 200 or so, and I put together a CD of about 20 of them.
And one night -- yes there were substances involved -- I played it for my wife, and we listened to all 20 takes, and we chose our top 3. No commentary. We just listened, and chose our favorites.
Read 6 tweets
Nov 16, 2022
Bob Marley & The Wailers, "Redemption Song". vimeo.com/390484832
Late at night, when no one's around, or they're all abed, or I'm drunk and I don't care, I sing this to the trees outside my house.
My range is very narrow, and it straddles right there, alto and tenor, and I'm old, a practioner of many vices, across many decades. But I sing it, and it fits in my range, and singing it makes me feel good.
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(