Saturday, February 9, 2013

BizTalk Hosts, Host Intances and Groups

People new to BizTalk struggle with the concept of Hosts and Host Instances. I've tried to find a simple article that I can direct people to but the articles I've read IMHO don't seem to provide a simple explanation.  So let me have a go.

When you create a new Host in BizTalk all you are doing is creating an entry in a table in the BizTalk Management database and nothing more.  You can attach an Orchestration to this Host, but it won't run until you create a Host Instance.  When you create a Host Instance you actually create a Windows Service and this is what does the work.  So you can start and stop Host Instances but Hosts have no such concept.

So what is the point of a Host? The answer is that its the way BizTalk offers us scalability. Let me provide the analogy of load balancing web servers. As you know you create 2 web servers that have different IP addresses.  And then someone sets up a load balancer for you and gives you the load balanced IP address (or the equivalent DNS entry).  When I point to the web server I use the load balanced IP address.  Same thing with BizTalk Hosts.  The Host entry is my load balanced "address".  Now it should make sense as to why I bind my Orchestrations to the Host name and NOT the Host Instance.  Its so I can get load balancing.  Now obviously with just 1 BizTalk Server this doesn't make a lot of sense so the next thing to understand is BizTalk Groups.

You can have several BizTalk Servers that belong to the same BizTalk Group.  So is it analogous to a load balanced cluster? No, not exactly, its more of a mechanism for distributing the processing across multiple servers.  They key point to understand is that there is only 1 copy of the BizTalk databases sitting on the SQL Server.  They are created when I configure my first BizTalk Server. 

When I add the second BizTalk Server and configure it I select the option to "Join an existing Group".  When configuration is complete and I open the BizTalk Admin console on my second server I see the Hosts that are created on Server 1.  Remember a Host is just a database entry and members of a BizTalk Group share the same database. 

Now here comes the magic bit. I can create a Host Instance on each of these two BizTalk Servers that will run my orchestrations.  So each now has a Windows Service running and BizTalk does the load balancing for me. 

Actually that is NOT how you should start out along the scalability route. There are some good articles on best practices for scaling BizTalk Server. The first configuration is 3 BizTalk Servers in a Group, one configured as a Process Host, one as Receive Host and one as the Send Host.  That's the first step in scalability.  You can then go on to add more servers to the group and use BizTalk's load balancing capability.  But this is where I'm going to stop because I'm not going to repeat what is in those excellent articles. 

Hope that helps.

2 comments:

vasudha dharani said...

Biztalk Server Online Training
http://www.21cssindia.com/courses/biztalk-server-online-training-213.html
COURSE OUT LINE
Introductions to Enterprise Application Patterns and BizTalk Server, Understanding BizTalk Framework, Setting up a BizTalk Server Environment, Messaging Architecture, Setting up a BizTalk Server Environment Engine, Business Activity Monitoring, WCF Services Schemas in BizTalk, Transformations in BizTalk, The BizTalk Messaging Engine and Pipelines, Adapters in BizTalk, Orchestrations, Advanced Orchestrations, Integration Patterns in BizTalkBizTalk Rules with BizTalk, Testing BizTalk Artifacts, BizTalk Server Instrumentation, Error Handling, and Deployment,Tracking and Deploying BizTalk Solutions, Monitoring and Maintenance, Administration, BizTalk Server Performance andTuning, BizTalk Tools, BizTalk 2013 Features, ESB Toolkit 2.
Introduction to EAI
The EAI Business Scenario
21st Century providing Online training and support on All Technologies. If you are seeking training and support you can reach me on 91-9000444287. Online training by real time Experts. Call us 001-309-200-3848 for online training

It Guru said...

This blog contains many lessons. Hope you create more meaningful blogs. Thanks!!! :)

Biztalk Online Training Hyderabad