Inhalte aufrufen

Profilbild

Multi-Tenant

Multi=Tenancy

Best Answer stefanmueller , 11 April 2023 - 14:12

Sure. We are currently actively in the development process. At the moment it is planned to release with v5.1. Please check out our github #645 for more details, feel free to add your comments there:

Implement Multi-Vendor/Marketplace system #645

 

https://github.com/s...tore/issues/645

Go to the full post


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
11 Antworten zu diesem Thema

#1 jnicke

jnicke

    Newbie

  • Members
  • Punkt
  • 7 Beiträge

Geschrieben: 16 July 2022 - 19:06

I just installed Smartstore 4 with no issues.

I am interested in provisioning Smartstore as multi-tenant.  I noticed a "App_Data/Tenants/Default" folder.  Is there documentation or blog that explains on the configure multiple tenants?  Let me know how to proceed.

Thanks!

 


  • GalenKa, RidgeOi und longdo gefällt das

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 18 July 2022 - 20:42

This is a simple tenant system to be able to switch between different tenants within an installation. In "App_Data\Tenants" there is a file "current.txt" which contains the name of the current tenant to use. "Default" is the default name. All tenant-related files reside in the subfolder with that tenant name. So, the default tenant folder is "App_Data\Tenants\Default". The application stores all tenant-related files in the tenant folder, including the Settings.txt file with the connection string to the tenant database.

  • GalenKa, RidgeOi und stefanmueller gefällt das

Marcus Gesing

Smartstore AG


#3 jnicke

jnicke

    Newbie

  • Members
  • Punkt
  • 7 Beiträge

Geschrieben: 19 July 2022 - 04:32

Thanks for the info! If I wanted to use something other than "Default" in the case where I want multiple tenants, Is it possible if I set var curTenant to a different tenant name/folder?  The idea is to insert the tenant connect-string at run-time, thus multi-tenant.

var curTenant = ResolveTenant();
  var tenantPath = "~/App_Data/Tenants/" + curTenant;

 

(From dataSettings.cs).

 

Thoughts?

 
  • GalenKa und RidgeOi gefällt das

#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3801 Beiträge

Geschrieben: 19 July 2022 - 15:29

Probably no one has tried this before, but why not?


  • RidgeOi gefällt das

Marcus Gesing

Smartstore AG


#5 jnicke

jnicke

    Newbie

  • Members
  • Punkt
  • 7 Beiträge

Geschrieben: 22 July 2022 - 14:59

So I tried it.  setting var CurTenant = "Tenant2" (in dataSetting.cs); works.  A new Tenants directory is created with a tenant specific connect-string in the settings.txt.

 

Now I am trying to figure out how to set CurTenant based on the requesting url so that http://tenant2.mystore.com would set to "tenant2".  This appears to be all we need to make SmartStore multi-tenant.  Any advice on how do to this in the Smartstore project would be much appreciated.



#6 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 25 July 2022 - 19:03

I'm afraid there is much more to do:

  • Super level, database independent tenant management
  • A new tenant scope for dependencies (Singleton --> Tenant --> Request)
  • Installing/activating plugins & themes on tenant level
  • Serving custom templates/views on tenant level

This all is a heavy load of work, which is the reason why we haven't implemented it yet. All we have now is a comfort mechanism for developers: decide on app startup which tenant to load. Means: 1 instance = 1 tenant. But real multi-tenancy means: 1 instance = many tenants.


  • stefanmueller gefällt das

Murat Cakir
SmartStore AG


#7 jnicke

jnicke

    Newbie

  • Members
  • Punkt
  • 7 Beiträge

Geschrieben: 28 July 2022 - 19:18

I defer to your expertise.  But I want to point out / inquire about the C:\MTA\SmartStore\App_Data\Tenants\Default directory (one for each tenant, this tenant is "Default").

 

The Default tenant directory has these files.  It appears plug-ins, themes, custom views, etc. are stored and managed in the Tenant directory. I can deal with this.

If my idea is correct, if I could set var-curTenant at run-time (having already created the Tenant Directory from a template), I could have autonomous tenants using the same instance of the app.   Thoughts?

Directories:
AssetCache
Hash
Media
Sitemaps
temp

Files:
InstalledPlugins.txt
plugins.assemblies
plugins.hash
Settings.txt



#8 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1118 Beiträge

Geschrieben: 29 July 2022 - 18:34

It appears plug-ins, themes, custom views, etc. are stored and managed in the Tenant directory

 

This is NOT the case. That would have to be developed first.

 

if I could set var-curTenant at run-time

 

Of course you can...

 

I could have autonomous tenants using the same instance of the app

 

... but, no. Because: one instance (aka process aka AppDomain) = ONE TENANT! That is how it works at the moment. You just switch to any tenant during app start. But AFTER app start, you can't switch this tenant anymore.


Murat Cakir
SmartStore AG


#9 jnicke

jnicke

    Newbie

  • Members
  • Punkt
  • 7 Beiträge

Geschrieben: 29 July 2022 - 21:26

Thanks for responding.....  Maybe in a future release you will support the multi-tenant use-case.  It looks like much of the architecture is done.



#10 stefanmueller

stefanmueller

    SmartStore AG

  • Administrators
  • 461 Beiträge

Geschrieben: 09 November 2022 - 14:17

Hi jnicke, gerat news for your request: we will definitly support multi-tenant in an upcoming plugin. 

 

The first preparations for the Marketplace resp. "Multi Vendor Edition" have just started. The release is planned for the third quarter of 2023.
 
Greetings, Stefan
 
Angehängte Datei  roadmap_multi-vendor-q3-2023.jpg   30.95K   2 Anzahl Downloads

 


Stefan


#11 jnicke

jnicke

    Newbie

  • Members
  • Punkt
  • 7 Beiträge

Geschrieben: 11 April 2023 - 08:04

Thats great news!  Keep me posted.


  • stefanmueller gefällt das

#12 stefanmueller

stefanmueller

    SmartStore AG

  • Administrators
  • 461 Beiträge

Geschrieben: 11 April 2023 - 14:12   Best Answer

Sure. We are currently actively in the development process. At the moment it is planned to release with v5.1. Please check out our github #645 for more details, feel free to add your comments there:

Implement Multi-Vendor/Marketplace system #645

 

https://github.com/s...tore/issues/645


Stefan