Redis connection across tenants, Data Migrations UI feature - This week in Orchard (05/05/2023)
Redis connection across Tenants, simplify email body, and a demo about the Data Migrations UI Feature! Check out our post for the details!
Orchard Core updates
Redis Connection across Tenants
The number of Redis connections scales with the number of tenants. This leads to a large number of Redis connections being required when you have a large number of loaded tenants, even if individual tenants may not have a lot of actual activity. The problem is that when you use something like Azure Redis, you will quickly run into cost issues to allow for enough connections to exist even though Redis is barely being used (CPU/memory usage is very low). If we were able to share the Redis connection pool across all tenants, then scaling would be correlated with the actual usage of the system as opposed to tenant count.
From now on, the connection creation was refactored, such that each tenant doesn't have its own connection but you can share the connection to the same Redis instances across tenants. The connection string is the same, and you can use different prefixes for the tenants.
The CreateAsync
method in the RedisDatabaseFactory
class is responsible for returning only one connection, even if there are multiple accesses to the same connection string.
Simplify email body
Nowadays, when you are trying to create an email message, you should set either Body
or BodyText
, not only that you also need to set up another property: IsBodyHtml
or IsBodyText
. This needs simplification to make the setup easier. Furthermore, if someone set IsBodyText
to true while they set the Body
property, the email will be sent as plain text.
So, instead of having two properties to set whether the email body contains HTML formatted text or not, there is a single one, called IsHtmlBody
. So, there are no more BodyText
and Body
properties to set the body of your email. You can simply use the Body
one and decide whether the body contains HTML or not based on the IsHtmlBody
Boolean property. The IsBodyText
and IsBodyHtml
properties are also marked as obsolete.
Demos
Data Migrations UI Feature
A few weeks ago, we showed you a conceptabout improving the data migrations in Orchard Core. This time we will check out a new feature, called Data Migrations UI, which allows us to manage the data migrations from the user interface.
If you navigate to Configuration -> Features and enable the Data Migrations UI feature, you will find a new option in the root of the admin menu, called Data Migrations. This feature scans and discovers all the migrations from the enabled features and shows them in this list. Here, you can see that we have one migration in the Google Maps feature, which is already migrated. If you click on the Rollback button, you can roll back the given migration. The Migrate button of course runs the given migration.
As you can see, the Gravatar feature contains multiple migrations. Migration1 is already applied, Migration2 should be skipped, and there are two migrations that are not applied. If you click on the Migrate button, you can apply the given migration.
And as always, if you want to know more about this feature, check out this recording on YouTube!
News from the community
Orchard Harvest Online
As many of you know, we have been working hard over the past months to organize the next Orchard Harvest in Las Vegas after the last Harvest in 2017. Unfortunately, based on the current economic situation and personal feedback, Las Vegas won’t work this year. Not to mention that unfortunately Microsoft Build, announced after we decided on our dates, also falls in line with the original dates we chose. So, a date change was also necessary.
However, we did not want to let go of this opportunity to meet completely. Therefore, we are pleased to inform you that we will be holding our first online Orchard Harvest starting on the 31st of May at 13:00 UTC. You can start your registration for the event right now.
Of course, we are still looking for speakers. You can apply to present by 12 May at the following link: https://forms.office.com/e/pfiExtEUuZ. Check out the details on the official site of Orchard Core!
Orchard Dojo Newsletter
Lombiq's Orchard Dojo Newsletter has 457 subscribers! We have started this newsletter to inform the community around Orchard of the latest news about the platform. By subscribing to this newsletter, you will get an e-mail whenever a new post is published to Orchard Dojo, including This week in Orchard of course.
Do you know of other Orchard enthusiasts who would like to read our weekly articles? Tell them to subscribe here!