.net - Multiple services or single service with multiple threads -
we rewriting our .net application. current application has 4 windows services. first service accepts requests ui , updates ui publishing events refreshing ui. service internally uses 2 thrall pools max 16 threads each service gui. requests ui requires business processing passed on worker process windows services(there 2 such windows service).msmq used passing requests , forth between services. fourth windows service acts load balancing , directs requests first service workers. services running on same box
now while rewriting, know if should maintain same architecture or can clubbed same service separate threads. better performance perspective.
for running on same box, think may require scale multiple boxes in future?
the architecture involving multiple services more scalable, more maintainable , more flexible. of key benefits are,
- your architecture more loosely coupled
- you can scale each service / workload separately
- you can replace each service in different technology (maybe someday implement worker process using c++ on linux), have flexibility that
- its easier add new features system, example if want add additional logging, can hook msmq , start logging messages without touching actual code
multi-threading may give bit of performance boost due reduced latency, if running both systems on same machine, there won't difference. if every trouble due high-load , want scale business logic service only; out of luck. go multi-services (kind of micro-service architecture) gives separation of concerns , other benefits.
i hope helps.
Comments
Post a Comment