Print Page | Close Window

Database multi-tenancy

Printed From: TMS Software
Category: Business Tools
Forum Name: Echo
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=10047
Printed Date: 16 Sep 2019 at 12:46pm


Topic: Database multi-tenancy
Posted By: DA CUNHA MARCO A
Subject: Database multi-tenancy
Date Posted: 05 Jun 2018 at 12:07am
   Reading the uses cases we have:
  • You might have a distributed system where you need a central database server with all data for static purposes, but each client will only have access to a subset of that data (multi-tenancy architecture)

    I will have a central database and each  customer  will see only their. own data. 

    Can Echo handle that ?

     Client A,  with a desktop application and 3 mobiles devices  replicating to the central database   

     Client B,  with a desktop application and 5 mobiles devices  replicating to the central database

     So,  I could have a multi-tenancy database using Echo.

     Is it ok ? If so how is the proper way to implement it ?

     Thanks
     



Replies:
Posted By: Wagner R. Landgraf
Date Posted: 05 Jun 2018 at 1:28pm
Yes, it's possible. You have to add your own routing logic when calling Route:
http://www.tmssoftware.biz/business/echo/doc/web/routing.html - http://www.tmssoftware.biz/business/echo/doc/web/routing.html

The key is the anonymous method in the Route parameter:

Echo.Route(
    procedure(Log: TEchoLog; Node: TEchoNode; var Route: boolean)
    begin
      if SameText(Log.EntityClass, 'AppEntities.TEchoInvoice')
        and (Node.Id = 'Client1') then
        Route := false;
    end;
);  

You have to implement your own logic to tell Echo if that specific record should be routed to that specific node.



Print Page | Close Window