Click here to Skip to main content
15,895,827 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I love Deja-Dup Pin
Mark Parity3-Feb-19 23:25
Mark Parity3-Feb-19 23:25 
JokeRe: I love Deja-Dup Pin
Peter_in_27804-Feb-19 0:20
professionalPeter_in_27804-Feb-19 0:20 
GeneralRe: I love Deja-Dup Pin
Rage3-Feb-19 23:26
professionalRage3-Feb-19 23:26 
GeneralRe: I love Deja-Dup Pin
Peter_in_27804-Feb-19 0:19
professionalPeter_in_27804-Feb-19 0:19 
GeneralRe: I love Deja-Dup Pin
dandy724-Feb-19 4:43
dandy724-Feb-19 4:43 
GeneralMicro-services vs Monolith for personal project? Discussion Pin
Member 141388863-Feb-19 10:51
Member 141388863-Feb-19 10:51 
GeneralRe: Micro-services vs Monolith for personal project? Discussion PinPopular
Super Lloyd3-Feb-19 12:25
Super Lloyd3-Feb-19 12:25 
GeneralRe: Micro-services vs Monolith for personal project? Discussion PinPopular
Marc Clifton3-Feb-19 12:34
mvaMarc Clifton3-Feb-19 12:34 
Interesting question!

At a bare minimum, I would put your services into separate DLL's and write interfaces for your "exposed" classes, and use those interfaces everywhere else. Mark your classes internal so you don't accidentally use the concrete class instead of the interface. Use factory methods for singletons and some other static public method for creating instances if needed. If you want to go more microservice later on, this is a big step in the right direction.

A slightly more sophisticated step is to do the same thing but use a simple dynamic loader where you describe the services, as modules, that your main app wants. The only assembly that needs to be shared is the assembly that defines the interfaces. I usually take this approach as I can customize the app for what services (dll's) I need and easily replace a service (dll) with something else, say a stub, if it's not implemented. The core process to the implementation I use is described here[^]. See parts II and III for additional bells and whistles.

BTW, the disadvantage with the above is that you have to implement a post-build copy to copy the DLL's to your app's bin/debug (and release) folder unless you implement a more sophisticated assembly resolver. I cheat by simply referencing the service DLL's in my application, which pulls them in.

Alternatively, you could look at one of the dependency injection frameworks. I personally dislike DI (though .NET Core does a nice job of it) mainly because some of the DI frameworks I've worked with a long time ago add a ton of krufty garbage that makes debugging a nightmare.

If you really want to go nutso, implement each service on a $35 rPi and have them talk to each other over HTTP. Laugh | :laugh:

If you want to be really far out (as if the rPi idea isn't) I propose that microservices is going to be a dead idea at some point. Microservices are based on a "call this service to have it do something" concept. Consider instead an agent-based implementation. Agents are lightweight just like microservices, but instead they sit around waiting for something to work on. This means implementing some kind of a "data bus" where you publish your data and any agent interested in that data does whatever it does and publishes the result back onto the bus. Highly asynchronous, highly extensible, highly distributable, and very autonomous. That, in my warped opinion, is what will eventually replace microservices. Because you see, while microservices solve the monolithic architecture issue, they don't solve the monolithic workflow issue. Agents do.

So that's my 2c wisdom. Smile | :)

[edit]

Member 14138886 wrote:
so I will have to find a way to either send the authorization across services or to tell the gateway service about all my endpoints, thus defeating the purpose.


This may or may not make any sense, but your gateway should authenticate whatever needs to be authenticated. Everything else should be hidden from the public Internet -- any communication between the gateway and the services, or between the services themselves, should be private and assumed to be vetted by the gateway.

You don't have to tell your gateway about all your endpoints, or even your routes. Sounds like you just need a generic gateway that does authorization/authentication and if auth'd, passes the request on to your internal services. You might need some sort of routing table, but I'd flip that around -- have each service, say running in it's own IP/port, Docker container, separate machine, whatever, tell the gateway "hey, these are the routes I'm interested in, these are public, these require auth'ing" -- the gateway then builds the routing table programmatically. Particularly useful if some piece of hardware dies and you need to replace the service it handles, for example.

Though this is beginning to sound a lot like a reverse proxy. Unsure | :~

[/edit]
Latest Article - Slack-Chatting with you rPi

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

Artificial intelligence is the only remedy for natural stupidity. - CDP1802


modified 3-Feb-19 18:42pm.

GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Wastedtalent3-Feb-19 21:15
professionalWastedtalent3-Feb-19 21:15 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Marc Clifton4-Feb-19 0:45
mvaMarc Clifton4-Feb-19 0:45 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Mike Winiberg4-Feb-19 0:09
professionalMike Winiberg4-Feb-19 0:09 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Marc Clifton4-Feb-19 0:52
mvaMarc Clifton4-Feb-19 0:52 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
PIEBALDconsult3-Feb-19 13:19
mvePIEBALDconsult3-Feb-19 13:19 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Keviniano Gayo3-Feb-19 21:19
Keviniano Gayo3-Feb-19 21:19 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Kornfeld Eliyahu Peter3-Feb-19 21:20
professionalKornfeld Eliyahu Peter3-Feb-19 21:20 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
RickZeeland3-Feb-19 21:55
mveRickZeeland3-Feb-19 21:55 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
adudley2563-Feb-19 23:51
adudley2563-Feb-19 23:51 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Sander Rossel4-Feb-19 1:10
professionalSander Rossel4-Feb-19 1:10 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Kirk Wood4-Feb-19 3:57
Kirk Wood4-Feb-19 3:57 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Steve Naidamast4-Feb-19 4:25
professionalSteve Naidamast4-Feb-19 4:25 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
nepdev4-Feb-19 7:07
nepdev4-Feb-19 7:07 
GeneralRe: Micro-services vs Monolith for personal project? Discussion Pin
Asday4-Feb-19 8:56
Asday4-Feb-19 8:56 
NewsDigital exchange loses $137 million as founder takes passwords to the grave Pin
abmv3-Feb-19 9:06
professionalabmv3-Feb-19 9:06 
GeneralRe: Digital exchange loses $137 million as founder takes passwords to the grave Pin
Marc Clifton3-Feb-19 9:30
mvaMarc Clifton3-Feb-19 9:30 
GeneralRe: Digital exchange loses $137 million as founder takes passwords to the grave Pin
OriginalGriff3-Feb-19 10:01
mveOriginalGriff3-Feb-19 10:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.