What is a Multitenancy Architecture and Why Is it becoming popular?

Поделиться
HTML-код
  • Опубликовано: 25 дек 2024

Комментарии •

  • @sharukhrahman7925
    @sharukhrahman7925 4 года назад +9

    Wow 2 videos in every day... Thats dedication !!! 👍

  • @tonylangworthy5479
    @tonylangworthy5479 Год назад +2

    I developed my first multi-tenant application in 2014. Yes, at that time, I didn't know the terminology.

  • @pavanvhsn
    @pavanvhsn 3 года назад +5

    You always makes development more interesting!! The way you explain is awesome!!

  • @pguti778
    @pguti778 Год назад

    No analogies for techs!! Thank you!!!

  • @ahsannasir6214
    @ahsannasir6214 4 года назад +5

    We had a huge discussion over this in our company but eventually we ended up with a multi-tenant architecture. So far so great though!
    Multitenancy when combined with load balancers, Reverse proxies and especialy Container Orchestration Engine such as Kubernetes, things go pretty good in saving up some of your Cloud Costs/Resources and reduces the container's management complexity exponentially. Imagine having 10000 customers one day and then fixing a bug for all of them (you'll probably restart them all).
    The only difficulty that took sometime for us with this architecture was making our services stateless -- which we have somehow achieved using checkpointing, logging and some minor tweaks to the services.

    • @hnasr
      @hnasr  4 года назад +4

      Ahsan Nasir thanks Ahsan for sharing! I bet building multi-tenent services is challenging, there is the statelessness as you said which will give you Secuirty at the service level. How did you implement the database and storage layer any challenging there besides coming up with good schema?

    • @ahsannasir6214
      @ahsannasir6214 4 года назад +2

      @@hnasr so basically for the database, it might sound crazy but we run an orchestrated (HA) SQL Server with a one DB dedicated for every single customer. Each SQL Server can hold up to 100 databases before we spin up another one if we have more customers. So basically, we use consistent hashing on runtime from our stateless services to identify which database to select (customer DB) at runtime. So every authenticated request to our backend knows where to go regardless of how many replicas of our stateless backend we run. So far works like a charm. Hope it stays that way :D

    • @hnasr
      @hnasr  4 года назад +4

      Ahsan Nasir sounds great! So a single database instance with multiple database still considered multi-tanent on my opinion! And smart and pragmatic decision, each customer can potentially have their own schema if they want to.
      I saw some people make a single database and host multiple customers in that database tough to build I like your approach better. However you might run into challenges synching those schemas or making changes between databases but thats why scripts exists..
      Thats what i love about these discussions you see real production system making great pragmatic decisions to build a real system not a theoretical on paper only.
      Thanks for sharing again !

    • @ahsannasir6214
      @ahsannasir6214 4 года назад +2

      ​@@hnasr I would still call it multitenant, since the CPU/memory etc resources are still 100% shared between customers that help us make great decisions on horizontal scaling and load balancing, which was the real point behind it for us anyway.
      Your point about synchronizing the schemas is actually very good. We thought of that too, but eventually we ended up with this decision because we don't really expect any huge schemas changes in the future (its because of the kind of system/data we have). But guess what, keeping the databases apart gives us pretty good performance and we don't really have the cost of spending days on further normalization, indexing and such complex topics for our customer's data. So it's kind of a unusual paritioning pre-done for us! :D
      And yes, Thank you for the good discussion! :)

    • @anasnadeem7004
      @anasnadeem7004 Год назад

      @@ahsannasir6214 Wow, I like your approach. Can you share the tech stack in which you've implemented it?

  • @LawZist
    @LawZist 4 года назад +5

    Great video Hussein! The company that I work for uses Multitenancy architecture, so this video is very helpful to me :)

    • @hnasr
      @hnasr  4 года назад

      LawZist awesome !! Share some info that I might missed. I know another property of multi-tenant application is customization.. forgot to mention that in the video

  • @inquisitive8086
    @inquisitive8086 4 года назад +3

    Multitenancy is the key to any cloud deployment. Separate instances would not scale and would be costly to implement. The key is to make the implementation robust in terms of separating everything using qualifiers and namespaces. e.g. every database schema has the tenant prefix, even every single table may have the tenant identifier column, every single functionality first uses and needs a tenant qualifier etc.

    • @hnasr
      @hnasr  4 года назад +1

      Well said ! Thanks for the insights! 👍

  • @MohamedEldoheiri
    @MohamedEldoheiri 2 года назад +3

    Really great video!
    I know you talked a lot about stateful vs stateless servers and pros and cons of each, but maybe have a video about your personal opinion about when to go stateful and when to go stateless, and when does being stateless is not a good idea!

  • @david-tracy
    @david-tracy 3 года назад +1

    Any other videos about this (multi-tenant architecture)? Would be great to see it in practice.

  • @NikitaKanoria
    @NikitaKanoria 2 года назад

    Great explanation. Really enjoy your video. Your way of explaining is awesome.

  • @LewisCampbellTech
    @LewisCampbellTech 4 года назад +2

    Good video. I see the benefits for database (or schema) per customer, but it is so much more work. If I had a DBA I'd do it every time. When it's a small team though...

    • @hnasr
      @hnasr  4 года назад +5

      Lewis Campbell i agree! Lots of work. Someone commented a nice workaround they had a single sql server instance with many databases. So less management but high isolation..
      You can put your customers on one database but that require quality database modeling skills to get right

    • @bunnihilator
      @bunnihilator 3 года назад

      @@hnasr When modeling the database to suport multiple vendors in a marketplace, one would unknowingly be modeling a db to support a multi tenancy architecture. I'd imagine it woulnd be much work to design a db that must support only one vendor instead. At least in my country coming out from colledge if i'd build a multi customer application by default i'd be using this architecture because normally in database modelling they don't ecpect you to model for one customer when they expect it to support multiple one, neighter would they be talking about cotainerization as a solution for supporting multiple customers.
      What i'm trying to say is by default, a beginner is already doing this architecture instead of using containers for the isolations. But thank you for the pros and cons of these approach.

  • @atexnik
    @atexnik 8 месяцев назад

    Is web server an example of multi-tenancy? Becuase multiple clients (tenants) connect to it. No?

  • @sariksiddiqui6059
    @sariksiddiqui6059 4 года назад +3

    Hussein, how often do you see the system design changing as a whole in your work?Suppose the ROI on one workflow per tenant model start taking a hit, what sort of way would you be dealing it with?I would like to have your take on this.I know I sometimes I start with a model and it seems to be failing but can't go back and thus have to keep improvising

    • @hnasr
      @hnasr  4 года назад +4

      Siddiqui Sarik that is a very good question, changing design midway is extremely expensive and even impossible sometimes. That is why you need to nail things down correctly. And think of the basic use cases really hard and min ship product.
      Thats a problem of the agile methodology as well where requriements change often and causes design rethinking which slow down projects and introduce a monster app

  • @ssksarraju
    @ssksarraju 4 года назад +2

    You should trademark the greeting line ‘What is going on guys!’ 🙂

  • @adityabharti245
    @adityabharti245 4 года назад +3

    Hey Hussein! Love the content on your channel. However, you might wanna invest in a camera stabiliser. Will increase the video quality dramatically.

    • @hnasr
      @hnasr  4 года назад +1

      Aditya Bharti thanks 🙏 will do!

  • @bhushanam83
    @bhushanam83 4 года назад +1

    WOW thanks ...u are the best sir ...

  • @JenilCalcuttawala
    @JenilCalcuttawala 3 года назад

    Damn these fancy words... Been working for a SaaS product without knowing it was based on a multi tenant architecture...!

  • @YGNCode
    @YGNCode 4 года назад +1

    I think multitenancy is pretty good. Like you said, we need to take care of the security if we are sharing.
    Sharing db and stuff is pretty common multitenancy stuff? Maybe, it's depend?
    For me, I am working on multitenancy application which share only specific features. Quite interesting...

    • @hnasr
      @hnasr  4 года назад +1

      YGNCode thanks YG ! It’s interesting what defines a multi-talent app.
      If your “app” is shared but the database isn’t I would still call your app a multi-tenant app but its not a multi-tenant system hmm

  • @romantsyupryk3009
    @romantsyupryk3009 4 года назад +1

    Thanks very much for this video.

    • @hnasr
      @hnasr  4 года назад

      Thanks Roman 🙏

  • @abura3d2012
    @abura3d2012 2 года назад

    can you talk about Multi-tenant database level ? Single-tenancy or Multi-tenancy

  • @yogipristiawan3899
    @yogipristiawan3899 Год назад

    if we have one instance and many databases instance for each customers, how do we can connect to the right database instance for it customer request?

    • @_dp3po_881
      @_dp3po_881 Год назад

      Im assuming you are talking about "Multitennat" but with more than one database? Or in other words, you have a server that serves multiple customers, and you have a dedicated db for each customer, right? There a couple of ways to go about something like that, but a popular one is based on the concept of "access keys". Essentially each customer is assgined an access key, and that access key is sent, in one way or another, with every request from the client to the server. When the request reaches the server, internal app code disects the request and routes any db data fetching to the correct db based on the acces key.

  • @isaacfrost9798
    @isaacfrost9798 3 года назад

    Can you please explain a single tenant in more details.

  • @305020158
    @305020158 2 года назад

    Each customer requires different customisation to the application, we can ofcourse provide shared db and compute, but , how do i have different application versions for different customers.? Eg : one customer wants normal calculator, one customer wants, scientific calculator, one more customer wants a music player while performing calculations, and one more customer wants voice based calculator

    • @_dp3po_881
      @_dp3po_881 Год назад

      You could version your builds and host them all on one server. In the case of IIS ( default windows server) you can host mulitple sites all on the same server, where each site's code would reside in different root directories, and incoming requests would be routed to, or pointed at, the crorrect site (or version of your build). You could host ten slightly differnt versions of your app, or even ten completley different apps all on your one IIS server.

  • @moumous87
    @moumous87 2 года назад

    wait.... do single-tenant applications even exist?? are single-tenant system basically only softwares that you need to install on you device?

  • @torabekmolodjanov6495
    @torabekmolodjanov6495 2 года назад +1

    Don't we call it SAAS?

  • @p.r.435
    @p.r.435 3 года назад

    Wait, what do you mean by
    "They also charge lots of money for a multi-tenant license.."?
    Is this from hosting side or server/backend?

    • @hnasr
      @hnasr  3 года назад +1

      I was referring to Oracle container database, multi-tenant license

    • @p.r.435
      @p.r.435 3 года назад

      @@hnasr ahhh, I see.. Thanks to make it clear. Always lookin up server or backend side from you, man. 🍻🍻

  • @paulbird2772
    @paulbird2772 4 года назад +1

    In the long term for almost all applications you are not going to compete unless you build this way. For example, what small or midsize business would have their own email system and email sys admin in 2020. What service provider would build an email service for every customer ... or these days what service provider would even build their own email service at all.

    • @hnasr
      @hnasr  4 года назад

      Paul Bird well said

    • @paulbird2772
      @paulbird2772 4 года назад +1

      @@hnasr Thank you, a possible follow on for this video would be to go the next level up and discuss what white label services are.

  • @singularityawaits9298
    @singularityawaits9298 3 года назад

    Good videos bro but you need better audio / volume

  • @oah8465
    @oah8465 3 года назад

    fantastic video

  • @sonythan
    @sonythan 2 года назад

    I don't think this architecture suitable for enterprise level application. Maybe can be used for small application. Really worried about the performance and security.

    • @_dp3po_881
      @_dp3po_881 Год назад +1

      This is actually used all over enterprise. Im not agreeing or disagreeing, but it is quite prevalent and there are many reasons to do so.

  • @gjuoun
    @gjuoun 4 года назад

    I can see why some VPS providers overselling their instances.
    If the performance is guaranteed, so that's very good.
    But it still depends on the customer's security requirements.

    • @hnasr
      @hnasr  4 года назад

      Exactly John, a VM is expensive so if you can build a multi-tenant application that serves multiple of your customers and lives in a single VM (or pool of VMS) you save lots of money

  • @david-tracy
    @david-tracy 3 года назад

    Sounds very expensive.