microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.03k stars 399 forks source link

Microservices as process vs microservices as containers #169

Open fazilmajeed opened 6 years ago

fazilmajeed commented 6 years ago

Hi , I have a question regarding the microservices as process and microservices as containers..i know sf is capable to accomodate both approach..but which one is most prefferable approach interms of performance?

As we know containers are isolated. And it is not sharing and using resources out the container. Does it cause to performance impact?? And do the process approach sharing the host resources??..

Which is the most prefferable approch if we are targeting only to service fabrics?? No need to port the application in to any other orchastrator..

With Thanks Fasil Majeed..

samedder commented 6 years ago

They're different technologies. Microservices are just a mechanism by which you partition your workload, usually built ontop of a transactional model, or actor model.

Containers are a form of isolation and packaging.

fazilmajeed commented 6 years ago

Yes, Microservices are domain level separation of the application in the small services. As per the service fabrics application model we can create an application with multiple services. And can publish it to service fabrics cluster.and there we have the features like SF remoting and all to implement inter service communication(service discovery is easy with sf api). My question is in the above approach we are publishing the service fabrics application to the cluster without containerized each services.and it is running in service fabrics as processes. At the same time we can containerize each application by using docker and can publish it to service fabrics.but here we have to implement the mechanism for service discovery.and it is running as containers in service fabrics. We know the advantages of containers.like portability isolation etc.

My question is related to these two approaches while developing and application targeting to run in service fabrics. Which is most efficient in terms of performance.??

nareshkhatri81 commented 6 years ago

With containers, we get portablity of moving from one ochestator like SF to K8s.

With containers, you can still use SF feature of Reverse proxy and naming service to locate services for S2S communication

With performance, I don't think containers will be less performanent.

olitomlinson commented 6 years ago

From my understanding, its worth considering cost when making decision to use service-per-container (Mesh) vs service-per-process (Native).

For instance, I have a setup for Native where I have around 700 services at any one time (each service is a tenant). On Native I can pack these 700 services across a 5 node cluster (which costs approx £250 a month).

If I was to take this approach into Mesh, I would be using 700 windows container Instances

700 (instances) 744 (hours) 60 (mins) 60 (seconds) £0.000011 (1 vCPU = container compute duration + software duration) = £20,000

minimum vCPU size is 0.5 so lets halve the cost so far = £10,000

This doesn't even take into account the GB-s memory charging, or charging for volume storage or reliable collections.

So, £250 for using Service Fabric Native, or £10,000~ for using Mesh.

How much do you need performance isolation between your services is the question? There is a considerable cost if you do NEED performance isolation.