Plugins in Dynamics 365 CRM are a powerful way to extend the platform’s capabilities, automate processes and implement custom business logic. When it comes to deploying plugins, there are three primary methods. GAC (Global Assembly Cache), Database, and Disk. Each method has its advantages and specific use cases. In this blog post, we’ll explore the differences between these deployment options to help you choose the right one for your scenario.
1. What is a Plugin in Dynamics 365 CRM?
Before diving into deployment methods, it’s important to understand what a plugin is. In Dynamics 365 CRM, a plugin is a custom business logic that is triggered by events in the system. For example, you can create a plugin that executes when a record is created, updated, or deleted.
Plugins can be registered to execute in two modes:
- Synchronous: Executes immediately and blocks the CRM operation until completion.
- Asynchronous: Executes in the background and does not block the CRM operation.
2. Deployment Methods Overview
Now that we know what a plugin is, let’s explore the three deployment methods:
- GAC (Global Assembly Cache) Deployment
- Database Deployment
- Disk Deployment
GAC Deployment
GAC Deployment involves placing the plugin assembly in the Global Assembly Cache of the CRM server. This method was commonly used in on-premises environments where direct access to the server was possible.
Advantages:
- Performance: Since the assembly is loaded from the GAC, it tends to be faster as it is already compiled and stored in memory.
- Security: Assemblies in the GAC are strongly named and verified, adding an extra layer of security.
- Centralized Management: Easier to manage and update for large deployments across multiple servers.
Disadvantages:
- Server Access Required: Requires administrative access to the CRM server to install or update plugins, which is not possible in Dynamics 365 Online.
- Complexity: GAC deployment can be more complex to manage, especially in a cloud environment.
- Limited to On-Premises: Not supported in Dynamics 365 Online, making it less relevant as organizations move to the cloud.
When to Use GAC Deployment:
- Large on-premises deployments where performance is critical.
- When managing plugins centrally across multiple servers.
Database Deployment
Database Deployment is the most common method used in Dynamics 365 CRM, especially in online environments. Here, the plugin assembly is stored directly in the CRM database.
Advantages:
- Ease of Deployment: No need for server access, making it ideal for Dynamics 365 Online.
- Version Control: Easy to update or rollback plugins directly within the CRM interface.
- Accessibility: Plugins are stored in the database, making them accessible from any CRM server.
Disadvantages:
- Performance Impact: Plugins stored in the database can have a slight performance overhead, especially for large assemblies.
- Database Size: Storing large assemblies in the database can increase its size, affecting overall system performance.
When to Use Database Deployment:
- Dynamics 365 Online environments.
- Scenarios where ease of deployment and update flexibility are more important than raw performance.
- Small to medium-sized plugins that don’t significantly impact database size.
Disk Deployment
Disk Deployment involves placing the plugin assembly on the disk of the CRM server, outside of the GAC.
Advantages:
- Performance: Similar to GAC, assemblies loaded from the disk can offer better performance than database-stored plugins.
- Simplicity: Easier to update than GAC, as it doesn’t require strong naming or GAC registration.
- Flexibility: Can be useful in hybrid scenarios where some plugins are stored in the GAC and others on disk.
Disadvantages:
- Server Access Required: Like GAC deployment, disk deployment requires access to the CRM server, limiting its use in cloud environments.
- Management Complexity: Managing plugins on disk can be more challenging, especially in large and distributed environments.
When to Use Disk Deployment:
- On-premises environments where direct server access is available.
- Scenarios where you need the performance benefits of GAC without the complexity of strong naming.
3. Choosing the Right Deployment Method
The choice between GAC, Database, and Disk deployment depends on several factors:
- Environment Type: For Dynamics 365 Online, Database deployment is the only option. For on-premises, you can choose based on performance and management needs.
- Performance Needs: GAC and Disk deployments offer better performance but require server access.
- Ease of Management: Database deployment offers the simplest management, especially in online environments.
4. Conclusion
Understanding the differences between GAC, Database, and Disk deployment methods is crucial for effective plugin management in Dynamics 365 CRM. While GAC and Disk deployments offer performance benefits in on-premises environments, Database deployment is the most versatile and commonly used method, especially for Dynamics 365 Online.
When deciding on a deployment method, consider your environment, performance requirements and management capabilities. For most scenarios, especially in the cloud, Database deployment will be the go-to choice.