Base solution for your next web application

Activities of "leonkosak"

If connection string in appsettings.json would be encrypted for host database, how can system admin encrypt changed connection string and replace old one? For tenant it's simple, because C# logic makes encryption and decryption logic.

Answer

I am sure, that guys will upgrade. :) But look abp.io for your new projects. ;)

{{RequestLog["assetID"] }} maybe?

Yes, this is my scenario. So "multiplicationg" the same code list across all tenant databases is technically good solution? :) (This also means that such code list in host database is at least duplicated - for host and for Default tenant. If more tenants is in host database, then "multiplication factor" for such code list is even higher.)

DeviceTypes in our case is defined from us and users cannot add/change/delete these entities in DeviceTypes SQL table (let's say max 100 device types). The number of DeviceTypes is negligible compared to how many instances one DeviceType could have (easily 100k+).

The next specific thing for DeviceTypes is also number of Devices (based on specific DeviceType). For instance, DeviceType1 has basically always much fewer devices because of the "nature" of this DeviceType. For instance, one tenant could not have a single device of DeviceType1, but have many of DeviceType3.

public class DeviceType : AggregatedRoot<int> {
    ...
    public ICollection<object> SomeDataList { get; set; }  //tipically 3-7 for all devicy types, not more
    public ICollection<Device> Devices { get; set; }
}

public class Device : AggregatedRoot<long> {
    ...
    public ICollection<DeviceSatusHistory> DeviceSatusHistory { get; set; }
}

public class DeviceSatusHistory : Entity<long> {
    ...
}

(DT = DeviceType)

Tenant      No. of devices of DT1   No. of devices of DT2   No. of devices of DT3
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
T1              36724                                 1254                                0
T2              146734                               800                                  22
T3              33535                                 135                                  55

Each Device has its own history. Some devices (based on specific DT are sending data, for instance, every 15 minutes, other devices (based on other DT) are sending for instance once per day. So the number of records in ICollection<DeviceSatusHistory> heavily depends on the DeviceType of a specific device. Of course, history table would be shrunk (old records) periodically, but the number of items in ICollection<DeviceSatusHistory> is expected to be huge anyway (the device has to have some history for the purposes of analysis and predictions).

DeviceType code list: NO ONE could add/edit/delete records. Code list is predefined and maintained by us developers only.

Device: This is not code list. These are "concrete data".

It cannot be overriden. So you suggest that such codelist (SQL table) is without TenantId column, BUT the data (rows) are copied in each tenant database (we want this code list that is stored in db)?

MyPeriodicBackgroundMethod()
{
    var tenantIdList = new List<int>();  //all **tenants** which have **dedicated database**
    
    foreach (var tenantId in tenantIdList)
    {
        using (_unitOfWorkManager.Current.SetTenantId(tenantId)
        {
	         //code for specific tenant - inserts, updates, deletes in this tenant database
        }
    }
}

Is somehow possible and safe make foreach loop parallel (TPL - Parallel.ForEach) or not in such background job or worker? Thank you for explanations.

Cool. Tnx. :)

It works (at least we haven't had issues yet). :)

Showing 41 to 50 of 55 entries