[{"data":1,"prerenderedAt":428},["ShallowReactive",2],{"footer-primary":3,"footer-secondary":93,"footer-description":119,"around-the-world-keep-the-money-flow":121,"around-the-world-keep-the-money-flow-next":160,"sales-reps":176},{"items":4},[5,29,49,69],{"id":6,"title":7,"url":8,"page":8,"children":9},"522e608a-77b0-4333-820d-d4f44be2ade1","Solutions",null,[10,15,20,25],{"id":11,"title":12,"url":8,"page":13},"fcafe85a-a798-4710-9e7a-776fe413aae5","Headless CMS",{"permalink":14},"/solutions/headless-cms",{"id":16,"title":17,"url":8,"page":18},"79972923-93cf-4777-9e32-5c9b0315fc10","Backend-as-a-Service",{"permalink":19},"/solutions/backend-as-a-service",{"id":21,"title":22,"url":8,"page":23},"0fa8d0c1-7b64-4f6f-939d-d7fdb99fc407","Product Information",{"permalink":24},"/solutions/product-information-management",{"id":26,"title":27,"url":28,"page":8},"63946d54-6052-4780-8ff4-91f5a9931dcc","100+ Things to Build","https://directus.io/blog/100-tools-apps-and-platforms-you-can-build-with-directus",{"id":30,"title":31,"url":8,"page":8,"children":32},"8ab4f9b1-f3e2-44d6-919b-011d91fe072f","Resources",[33,37,41,45],{"id":34,"title":35,"url":36,"page":8},"f951fb84-8777-4b84-9e91-996fe9d25483","Documentation","https://docs.directus.io",{"id":38,"title":39,"url":40,"page":8},"366febc7-a538-4c08-a326-e6204957f1e3","Guides","https://docs.directus.io/guides/",{"id":42,"title":43,"url":44,"page":8},"aeb9128e-1c5f-417f-863c-2449416433cd","Community","https://directus.chat",{"id":46,"title":47,"url":48,"page":8},"da1c2ed8-0a77-49b0-a903-49c56cb07de5","Release Notes","https://github.com/directus/directus/releases",{"id":50,"title":51,"url":8,"page":8,"children":52},"d61fae8c-7502-494a-822f-19ecff3d0256","Support",[53,57,61,65],{"id":54,"title":55,"url":56,"page":8},"8c43c781-7ebd-475f-a931-747e293c0a88","Issue Tracker","https://github.com/directus/directus/issues",{"id":58,"title":59,"url":60,"page":8},"d77bb78e-cf7b-4e01-932a-514414ba49d3","Feature Requests","https://github.com/directus/directus/discussions?discussions_q=is:open+sort:top",{"id":62,"title":63,"url":64,"page":8},"4346be2b-2c53-476e-b53b-becacec626a6","Community Chat","https://discord.com/channels/725371605378924594/741317677397704757",{"id":66,"title":67,"url":68,"page":8},"26c115d2-49f7-4edc-935e-d37d427fb89d","Cloud Dashboard","https://directus.cloud",{"id":70,"title":71,"url":8,"page":8,"children":72},"49141403-4f20-44ac-8453-25ace1265812","Organization",[73,78,84,88],{"id":74,"title":75,"url":76,"page":77},"1f36ea92-8a5e-47c8-914c-9822a8b9538a","About","/about",{"permalink":76},{"id":79,"title":80,"url":81,"page":82},"b84bf525-5471-4b14-a93c-225f6c386005","Careers","#",{"permalink":83},"/careers",{"id":85,"title":86,"url":87,"page":8},"86aabc3a-433d-434b-9efa-ad1d34be0a34","Brand Assets","https://drive.google.com/drive/folders/1lBOTba4RaA5ikqOn8Ewo4RYzD0XcymG9?usp=sharing",{"id":89,"title":90,"url":8,"page":91},"8d2fa1e3-198e-4405-81e1-2ceb858bc237","Contact",{"permalink":92},"/contact",{"items":94},[95,101,107,113],{"id":96,"title":97,"url":8,"page":98,"children":100},"8a1b7bfa-429d-4ffc-a650-2a5fdcf356da","Cloud Policies",{"permalink":99},"/cloud-policies",[],{"id":102,"title":103,"url":81,"page":104,"children":106},"bea848ef-828f-4306-8017-6b00ec5d4a0c","License",{"permalink":105},"/bsl",[],{"id":108,"title":109,"url":81,"page":110,"children":112},"4e914f47-4bee-42b7-b445-3119ee4196ef","Terms",{"permalink":111},"/terms",[],{"id":114,"title":115,"url":81,"page":116,"children":118},"ea69eda6-d317-4981-8421-fcabb1826bfd","Privacy",{"permalink":117},"/privacy",[],{"description":120},"\u003Cp>A composable backend to build your Headless CMS, BaaS, and more.&nbsp;\u003C/p>",{"id":122,"slug":123,"vimeo_id":124,"description":125,"tile":126,"length":127,"resources":8,"people":128,"episode_number":132,"published":133,"title":134,"video_transcript_html":135,"video_transcript_text":136,"content":8,"status":137,"episode_people":138,"recommendations":149,"season":150,"seo":8},"fa893567-1d64-43e6-9cfd-a79380b49d8e","keep-the-money-flow","894205126","Andreas uses Directus in lots of personal projects to improve the efficiency of his household. In this talk, we hear about his pocket money tracker used with his kids.","2985311c-f9d6-414c-b2ea-394109e4b0ea",21,[129],{"name":130,"url":131},"Andreas Morgner","https://github.com/amo42",1,"2023-07-14","Keep the Money Flow - Berlin Meetup","\u003Cp>Speaker 0: I will talk to you, about how I, how I use, directors within, my family for this talk. So basically, I would start with who I am. So my name is Andreas. As already mentioned, I'm father of 3. Actually, I'm working as a Atlassian consultant in a technical way, so, mostly for digitalization, optimization, and so on.\u003C/p>\u003Cp>So at work, I do not have any contacts with directors at all, so it's more on a hobby side and, a private interest. Yeah. I'm living in a countryside outside of Berlin, so, quite interesting journey today, and I like directors a lot. At some point, yeah, Kevin asked me, to no. I don't the other way around.\u003C/p>\u003Cp>I was, helping out in the Discord and ask questions, answering questions, and so on, and then he just promoted me from, a regular member to a moderator, and just overnight I was not informed about this. Thank you. Yeah. Today, I will talk about one project I'm using directives for. So what where's the problem?\u003C/p>\u003Cp>My children, I get 2 children or 3 2 of them get pocket money already. So they get, they get them from different people, from the grandparents, from us, from aunts, auntles, and so and, yeah, they just play around with it. It's dirty. They stick it all over the the the the rooms and so on, and also they try to stole it from each other. So in the end, they lose it.\u003C/p>\u003Cp>So yeah. Then we started to write some paper notes with the amount of money, gave it to them, and collect the money for them, but then they lose the paper. And in the end, they don't have the pocket money anymore, and they were sad. So my idea was to, yeah, use just as I do it on work, some digital, assistance, and I came up with directors. In the past, I've already worked with directors several times, so, I've wrote my master thesis with directors as a back end.\u003C/p>\u003Cp>There was, a testing environment for automated UI tests, so I know the tool already, and, yeah, started with directors implementing, a pocket money system. So it's very, very easy, but I guess the use case could be interesting because it's not a website or asset store or something like this. Basically, it's just containing, a couple of collections, as you can see. So, these were the actually, yeah, collections where I store the information about the accounts of the children so each each child get one account. Then they have transactions and also, there's the third one which is core transfer.\u003C/p>\u003Cp>This is currently not implemented completely, but the idea is there to store all the information, and have an overview about the money, how much, what is the income, what goes out, and so on. So, basically, it's just a couple of selections. Currently, a single flow that is updating all this stuff in the background once a new transaction is placed. And, yeah, in the end, no more struggle. If they want to pay something, they ask us, we pay for it with our money because we have all the money on our personal, bank accounts, and they just have some virtual money they can spend.\u003C/p>\u003Cp>So, I guess yesterday, my son came up, want to have a new game on the Switch. I paid for it, reduced his amount on the account, and they can have a look at any time what is the current amount. So yeah basically that's it and I'd like to show you how I was implementing this just indirect this, like this. Yes. I am.\u003C/p>\u003Cp>At home, it was working. I swear. So that's the pain of self rusting it, so I really should consider using the cloud. Now it's working. Yeah.\u003C/p>\u003Cp>As you can see, I've got a lot of collections just for all the private stuff I did. And today, we will look at the PocketMiner sections. So as mentioned, you see the accounts. This is real data by, mentioned. So my son is currently saving for a personal computer, and my daughter just bought an iPhone.\u003C/p>\u003Cp>So that's the result. So the current pocket money goes into this account. And, yeah, there are also 2 testing accounts. I currently using this for, setting up the new flow, because right now, I get only the, transaction implemented. So, currently, you have to, select the transaction, and this will just bring up a new dialogue for you where you can enter all the details about which account, which amount, Is it income?\u003C/p>\u003Cp>Is it outgoing? So, yeah, you can just select the account. You can also specify, some date just for the record where you, would like to look this up later on. So you can just use the interface here, from the Data Studio and then you can decide if you would like to have it an in as an income or an outgoing transaction. I used both fields and not a negative value for outgoing just to have some differences because sometimes they gave us, €10 and want to have 20, and I don't want to calculate this by my own, so I just put the numbers in and fine with it.\u003C/p>\u003Cp>So as you can see, I can just enter amount, optional, some comments to have the information later on what was this about. And just as I enter it, it will automatically, update the account. So right now, the account was just increased by 10 as expected. And if I go to a new, transaction, I can also reduce it, of course. So let's say we want to buy something for today of the same account, of course.\u003C/p>\u003Cp>It's very basic. Yeah. In the end, it's currently just, a single flow that, just uses, very basic information about what is going on. So every time a new transaction was placed, I will look up the account, get the current, information about this account, read out the values, do some calculations. So get the current account at the income at the outgoing and then save the new information within this account.\u003C/p>\u003Cp>If something goes wrong, it's locked. And yeah. The next step would be to implement this for the transactions as well. But as mentioned, this is currently not implemented. Just starting about it.\u003C/p>\u003Cp>So it goes from one account to another directly. So right now I have to do 2 transactions. 1 was outgoing, 1 was incoming. This should be, much easier so they can transfer sometimes money from one account to another account. Currently, they're not, having the needs for it, but I guess this could be much easier if they have to use this.\u003C/p>\u003Cp>Yeah. Basically that's it. Are there any questions or should I talk about some other fancy things I do with my hobby projects? Sorry? Do you charge interest\u003C/p>\u003Cp>Speaker 1: to Isabelle and overdraft fee?\u003C/p>\u003Cp>Speaker 0: I was thinking about it. So there there is there is actually a flow about about since as we call it in German. So yes, I were thinking about it, but currently it's disabled as you can see. But yeah.\u003C/p>\u003Cp>Speaker 1: It's okay. There's a little threat there.\u003C/p>\u003Cp>Speaker 0: Yeah. Yeah.\u003C/p>\u003Cp>Speaker 1: So how do they interact with it or do they always interact with it through you?\u003C/p>\u003Cp>Speaker 0: Currently just with with me directly, as they now have an iPhone of course. I was also starting about, building up an app for this. I've started couple of months ago, but have actually no time to yeah, but I want to keep it simple for a moment. Yeah. Of course, I have some, some insights as well.\u003C/p>\u003Cp>For for instance, this this is very basic. So just yes. I'm not the only one using it. I have no benefits, right now. But yeah.\u003C/p>\u003Cp>Could be as well used for this. So are you are you using direct as as, like, something for for a lot of stuff I saw there? Yeah. So for instance, another one is, about our newborn. So she has a tracking, fitness tracker, about the the, temperature, the heart rate, the oxygen level, and so on.\u003C/p>\u003Cp>And, actually, it's tracking this also by using a flow. So I've kind of injected the app that comes with the tracker, which is not really handy because it sometimes turns off or it could get only connection to one phone and not to my wife, only to my and so on. So I've started to track the data on the network and get the, token they're using to transmit the data. And as you can see, this is now going to bed for 70 minutes since he's sleeping yay and yeah this is all the information I get from from the, from the tracker. And with this, I can just have, some more information using insights for instance.\u003C/p>\u003Cp>So it's tracking this every minute as mentioned so you can see there are 30 minutes here. So usually the heart rate should go down further and further as she's sleeping, and the last 12 hours are not working because she's not wearing it over the day. And here's the data with just 2 hours. So we can also see if she gets awake because then the heart rate starts to increase. And for instance, if she's, ill or got fever, we also could see the information that the heart rate, for instance, is much higher.\u003C/p>\u003Cp>And also this is, currently implemented that once, some thresholds are broken or overwritten an alert is created so I will not have to use the the app that comes from the vendor. But instead, an Opsgenie is, alert is created. So it fires my Apple Watch, my phone. 10 minutes later, I get a a phone from Opsgenie that are calling and shouting to me that I should have look up what is going on here. Currently also working for the battery level, for instance.\u003C/p>\u003Cp>So, yeah, also very special use case I would say. I actually is just, reading the data from the application they offer. So, the the tracker sends the information to website and I just read the website similar to the app that is on the phone. So it's not synchronizing the data actually it's just reading out and saving it indirect. Like periodically?\u003C/p>\u003Cp>Yes. Like\u003C/p>\u003Cp>Speaker 1: scraping a web page knowing that\u003C/p>\u003Cp>Speaker 0: actually, it's an API that I'm calling with the flow. So the flow runs every minute, asking for the data, transform this, into actual fields. So there's coming some JSON payload from the API, and I using a flow to transform this all into actual fields I can then work with. As you can see, the Opsgenie's Opsgenie alerts are here as well so every time, a new record is created it's checking about some variables and if one of them is not okay then, and the node is created with an oxygen, And then all the rest is done by oxygen. But I have to notice, you have to turn off the tracking and logging all of the flow and all the create events within those databases because it started to get really slow on my instance, because every minute so much data is collected and stored.\u003C/p>\u003Cp>I have 2,200 30,000 items in this collection, and it's just a single core instance with 2 gigabyte of RAM or so. It's coming to the end, but it's working fine. What else? I've already told, I'm using it for laser cutter. So we have laser cutter for for handmade stuff.\u003C/p>\u003Cp>So, my wife is kneeling, and every time she has an idea, I save the material and the settings. And I also have, I guess, some pictures. No. I don't I have one, so I can just see the result or not here it is. So this is the data from my newborn.\u003C/p>\u003Cp>So I can see which, sets I using, which material, was it cutting, was it engraving. Yeah. So I store all this information within directors as well. Yeah. Also some invoicing that comes to our, mailbox, but I don't want to show you this.\u003C/p>\u003Cp>Also, the the days of sickness of my child are tracked. So I can just have a look and compare this to the school. So I track each day a child is ill and also started to use this as a PDF creation. So it just comes with one click. Currently, it's generating a PDF or it doesn't.\u003C/p>\u003Cp>It's We\u003C/p>\u003Cp>Speaker 1: will start.\u003C/p>\u003Cp>Speaker 0: No. No. No. It's still referring to a wrong URL. I see.\u003C/p>\u003Cp>So it's the the old one. That's the problem. It's generating a PDF, but not with the actual data yet. So that's still on my to do list. Anything else?\u003C/p>\u003Cp>No. Oh, yeah. One one funny thing. I've tracked the state of the TV power of my son because because it's in HomeKit, and there's an automation that sends the information to directors because he have a smart switch on the wallet and thinks he can trick me and turn it on after I turn it off. So every time he turns it on again, I will see it and can show him he turned it on again.\u003C/p>\u003Cp>So Yeah. Yeah. It's just about communicating to each other. It's also possible to call back to HomeKit, but I guess I have to implement this on some Raspberry Pi solution that is able to receive those requests. Yeah.\u003C/p>\u003Cp>So basically, it's a problem that I think of and try to find out a solution for this as often, And, yeah, I'm very familiar with with databases in general and with issue issue tracking systems. So I always think of how can I automate things and which information are necessary? And the cool thing is you can just add new fields, remove them, change them, add add a new collection that just combines some information or features. So it's just more iterative. So starting with, the accounts and at the the current, just overall value and do the math manually.\u003C/p>\u003Cp>Afterwards, I store the transactions, and then flows come in because in the middle, I was just about to develop an own extension that do this, what flows now offers. But as not a full time developer, I'm not so happy with the solution. It was not working, I guess. So with flows, it's super easy. Yeah.\u003C/p>\u003Cp>So it was just, starting with a simple one and then add some more features, change something, add new fields, remove them. Does it answer the question? Or For me, is it it's easy. Yes. To be honest, it's much easier to have some simple automations compared to Jira, for instance.\u003C/p>\u003Cp>So I've also had the the the automation to have the, cat litter cleaned by children with an automation in Jira, but it was too complex. It it is you can set it up, but it direct us. It's more easy.\u003C/p>","I will talk to you, about how I, how I use, directors within, my family for this talk. So basically, I would start with who I am. So my name is Andreas. As already mentioned, I'm father of 3. Actually, I'm working as a Atlassian consultant in a technical way, so, mostly for digitalization, optimization, and so on. So at work, I do not have any contacts with directors at all, so it's more on a hobby side and, a private interest. Yeah. I'm living in a countryside outside of Berlin, so, quite interesting journey today, and I like directors a lot. At some point, yeah, Kevin asked me, to no. I don't the other way around. I was, helping out in the Discord and ask questions, answering questions, and so on, and then he just promoted me from, a regular member to a moderator, and just overnight I was not informed about this. Thank you. Yeah. Today, I will talk about one project I'm using directives for. So what where's the problem? My children, I get 2 children or 3 2 of them get pocket money already. So they get, they get them from different people, from the grandparents, from us, from aunts, auntles, and so and, yeah, they just play around with it. It's dirty. They stick it all over the the the the rooms and so on, and also they try to stole it from each other. So in the end, they lose it. So yeah. Then we started to write some paper notes with the amount of money, gave it to them, and collect the money for them, but then they lose the paper. And in the end, they don't have the pocket money anymore, and they were sad. So my idea was to, yeah, use just as I do it on work, some digital, assistance, and I came up with directors. In the past, I've already worked with directors several times, so, I've wrote my master thesis with directors as a back end. There was, a testing environment for automated UI tests, so I know the tool already, and, yeah, started with directors implementing, a pocket money system. So it's very, very easy, but I guess the use case could be interesting because it's not a website or asset store or something like this. Basically, it's just containing, a couple of collections, as you can see. So, these were the actually, yeah, collections where I store the information about the accounts of the children so each each child get one account. Then they have transactions and also, there's the third one which is core transfer. This is currently not implemented completely, but the idea is there to store all the information, and have an overview about the money, how much, what is the income, what goes out, and so on. So, basically, it's just a couple of selections. Currently, a single flow that is updating all this stuff in the background once a new transaction is placed. And, yeah, in the end, no more struggle. If they want to pay something, they ask us, we pay for it with our money because we have all the money on our personal, bank accounts, and they just have some virtual money they can spend. So, I guess yesterday, my son came up, want to have a new game on the Switch. I paid for it, reduced his amount on the account, and they can have a look at any time what is the current amount. So yeah basically that's it and I'd like to show you how I was implementing this just indirect this, like this. Yes. I am. At home, it was working. I swear. So that's the pain of self rusting it, so I really should consider using the cloud. Now it's working. Yeah. As you can see, I've got a lot of collections just for all the private stuff I did. And today, we will look at the PocketMiner sections. So as mentioned, you see the accounts. This is real data by, mentioned. So my son is currently saving for a personal computer, and my daughter just bought an iPhone. So that's the result. So the current pocket money goes into this account. And, yeah, there are also 2 testing accounts. I currently using this for, setting up the new flow, because right now, I get only the, transaction implemented. So, currently, you have to, select the transaction, and this will just bring up a new dialogue for you where you can enter all the details about which account, which amount, Is it income? Is it outgoing? So, yeah, you can just select the account. You can also specify, some date just for the record where you, would like to look this up later on. So you can just use the interface here, from the Data Studio and then you can decide if you would like to have it an in as an income or an outgoing transaction. I used both fields and not a negative value for outgoing just to have some differences because sometimes they gave us, €10 and want to have 20, and I don't want to calculate this by my own, so I just put the numbers in and fine with it. So as you can see, I can just enter amount, optional, some comments to have the information later on what was this about. And just as I enter it, it will automatically, update the account. So right now, the account was just increased by 10 as expected. And if I go to a new, transaction, I can also reduce it, of course. So let's say we want to buy something for today of the same account, of course. It's very basic. Yeah. In the end, it's currently just, a single flow that, just uses, very basic information about what is going on. So every time a new transaction was placed, I will look up the account, get the current, information about this account, read out the values, do some calculations. So get the current account at the income at the outgoing and then save the new information within this account. If something goes wrong, it's locked. And yeah. The next step would be to implement this for the transactions as well. But as mentioned, this is currently not implemented. Just starting about it. So it goes from one account to another directly. So right now I have to do 2 transactions. 1 was outgoing, 1 was incoming. This should be, much easier so they can transfer sometimes money from one account to another account. Currently, they're not, having the needs for it, but I guess this could be much easier if they have to use this. Yeah. Basically that's it. Are there any questions or should I talk about some other fancy things I do with my hobby projects? Sorry? Do you charge interest to Isabelle and overdraft fee? I was thinking about it. So there there is there is actually a flow about about since as we call it in German. So yes, I were thinking about it, but currently it's disabled as you can see. But yeah. It's okay. There's a little threat there. Yeah. Yeah. So how do they interact with it or do they always interact with it through you? Currently just with with me directly, as they now have an iPhone of course. I was also starting about, building up an app for this. I've started couple of months ago, but have actually no time to yeah, but I want to keep it simple for a moment. Yeah. Of course, I have some, some insights as well. For for instance, this this is very basic. So just yes. I'm not the only one using it. I have no benefits, right now. But yeah. Could be as well used for this. So are you are you using direct as as, like, something for for a lot of stuff I saw there? Yeah. So for instance, another one is, about our newborn. So she has a tracking, fitness tracker, about the the, temperature, the heart rate, the oxygen level, and so on. And, actually, it's tracking this also by using a flow. So I've kind of injected the app that comes with the tracker, which is not really handy because it sometimes turns off or it could get only connection to one phone and not to my wife, only to my and so on. So I've started to track the data on the network and get the, token they're using to transmit the data. And as you can see, this is now going to bed for 70 minutes since he's sleeping yay and yeah this is all the information I get from from the, from the tracker. And with this, I can just have, some more information using insights for instance. So it's tracking this every minute as mentioned so you can see there are 30 minutes here. So usually the heart rate should go down further and further as she's sleeping, and the last 12 hours are not working because she's not wearing it over the day. And here's the data with just 2 hours. So we can also see if she gets awake because then the heart rate starts to increase. And for instance, if she's, ill or got fever, we also could see the information that the heart rate, for instance, is much higher. And also this is, currently implemented that once, some thresholds are broken or overwritten an alert is created so I will not have to use the the app that comes from the vendor. But instead, an Opsgenie is, alert is created. So it fires my Apple Watch, my phone. 10 minutes later, I get a a phone from Opsgenie that are calling and shouting to me that I should have look up what is going on here. Currently also working for the battery level, for instance. So, yeah, also very special use case I would say. I actually is just, reading the data from the application they offer. So, the the tracker sends the information to website and I just read the website similar to the app that is on the phone. So it's not synchronizing the data actually it's just reading out and saving it indirect. Like periodically? Yes. Like scraping a web page knowing that actually, it's an API that I'm calling with the flow. So the flow runs every minute, asking for the data, transform this, into actual fields. So there's coming some JSON payload from the API, and I using a flow to transform this all into actual fields I can then work with. As you can see, the Opsgenie's Opsgenie alerts are here as well so every time, a new record is created it's checking about some variables and if one of them is not okay then, and the node is created with an oxygen, And then all the rest is done by oxygen. But I have to notice, you have to turn off the tracking and logging all of the flow and all the create events within those databases because it started to get really slow on my instance, because every minute so much data is collected and stored. I have 2,200 30,000 items in this collection, and it's just a single core instance with 2 gigabyte of RAM or so. It's coming to the end, but it's working fine. What else? I've already told, I'm using it for laser cutter. So we have laser cutter for for handmade stuff. So, my wife is kneeling, and every time she has an idea, I save the material and the settings. And I also have, I guess, some pictures. No. I don't I have one, so I can just see the result or not here it is. So this is the data from my newborn. So I can see which, sets I using, which material, was it cutting, was it engraving. Yeah. So I store all this information within directors as well. Yeah. Also some invoicing that comes to our, mailbox, but I don't want to show you this. Also, the the days of sickness of my child are tracked. So I can just have a look and compare this to the school. So I track each day a child is ill and also started to use this as a PDF creation. So it just comes with one click. Currently, it's generating a PDF or it doesn't. It's We will start. No. No. No. It's still referring to a wrong URL. I see. So it's the the old one. That's the problem. It's generating a PDF, but not with the actual data yet. So that's still on my to do list. Anything else? No. Oh, yeah. One one funny thing. I've tracked the state of the TV power of my son because because it's in HomeKit, and there's an automation that sends the information to directors because he have a smart switch on the wallet and thinks he can trick me and turn it on after I turn it off. So every time he turns it on again, I will see it and can show him he turned it on again. So Yeah. Yeah. It's just about communicating to each other. It's also possible to call back to HomeKit, but I guess I have to implement this on some Raspberry Pi solution that is able to receive those requests. Yeah. So basically, it's a problem that I think of and try to find out a solution for this as often, And, yeah, I'm very familiar with with databases in general and with issue issue tracking systems. So I always think of how can I automate things and which information are necessary? And the cool thing is you can just add new fields, remove them, change them, add add a new collection that just combines some information or features. So it's just more iterative. So starting with, the accounts and at the the current, just overall value and do the math manually. Afterwards, I store the transactions, and then flows come in because in the middle, I was just about to develop an own extension that do this, what flows now offers. But as not a full time developer, I'm not so happy with the solution. It was not working, I guess. So with flows, it's super easy. Yeah. So it was just, starting with a simple one and then add some more features, change something, add new fields, remove them. Does it answer the question? Or For me, is it it's easy. Yes. To be honest, it's much easier to have some simple automations compared to Jira, for instance. So I've also had the the the automation to have the, cat litter cleaned by children with an automation in Jira, but it was too complex. It it is you can set it up, but it direct us. It's more easy.","published",[139],{"people_id":140},{"id":141,"first_name":142,"last_name":143,"avatar":144,"bio":145,"links":146},"afd23bef-c147-478f-8878-59675bda62c4","Andreas","Morgner","d244629d-b089-431c-a694-6cc51335e7a2","Senior Technical Consultant at Valiantys",[147],{"url":131,"service":148},"github",[],{"id":151,"number":132,"year":152,"episodes":153,"show":157},"dac1d26f-8071-4acc-a556-3fc30d03496a","2023",[122,154,155,156],"c1bf3bba-c29b-4d08-91b2-9c53b86d21cf","0edf83f5-87d4-4ea1-8030-0dbf472d228f","a25a20b8-6c18-49fb-b0a1-84a57025aebb",{"title":158,"tile":159},"Around the World","430ec649-8c29-4657-9425-2981fbae18c6",{"id":154,"slug":161,"season":151,"vimeo_id":162,"description":163,"tile":164,"length":127,"resources":8,"people":165,"episode_number":169,"published":133,"title":170,"video_transcript_html":171,"video_transcript_text":172,"content":8,"seo":8,"status":137,"episode_people":173,"recommendations":175},"multitenancy-at-hybrid-heroes","894205000","We will walk you through the steps to implement segregation of client data using Directus fields and scripts to create the appropriate roles and permissions. We will also showcase a real-world use case and how our client benefit.","fbaa2f85-6d9b-4f92-9b1b-c07cda31e3d5",[166],{"name":167,"url":168},"Mariana Costa","https://marianacosta.xyz/",2,"Multitenancy in Directus - Berlin Meetup","\u003Cp>Speaker 0: Okay then. So welcome everyone. So I'm Mariana. And today, I'm going to be talking a little bit about, we handle multi tenancy in one of our projects. So basically, like a startup guide for if you need to set up multitenancy in your project, just from the director's point of view, but hopefully it'll help you, like, make the process a little less, painful.\u003C/p>\u003Cp>Let's let's put it that way. So, yeah, I'm Mariana. I'm a software developer at Ivory Heroes. I've been at the company for, okay, a year 8 months, I think. And this is Joliel who is not here.\u003C/p>\u003Cp>Unfortunately, he was going to be co presenting with me, but something came up. So it's easier in spirit. So, and without without any further delays, let's just get right get right into it. So basically, the structure of the talk will be like, defining multi tenancy. So what it is, then the advantages, how why you might need it, why it may make sense for your own projects.\u003C/p>\u003Cp>Then basically, we'll do a small case study of 1 of our own projects where we had to implement multi tenancy. How we approached it, how we got started, and also the downsides of our approach and some other, like, general topics that also came up while we were doing this implementation. So, yeah, let's let's get right into it. So, basically, multi tenancy is an architecture where you have essentially one single instance to serve multiple clients. So let's say you want to set up a CMS to, for schools to set up their own block content.\u003C/p>\u003Cp>With multitenancy, you can have you can also only one instance of, of directors and serve all of all of the schools you want, while having the data collocated but separated from each other. So each school would only see the information that pertains to their own school. But, like, why would you want to do that? Why not just set up individual instances for for each school that would like to to use your services? So maybe maybe you want to lower infrastructure costs.\u003C/p>\u003Cp>So in some situations, and now we'll stress the some parts of the sentence because it's it's very dependent on the context. It may be cheaper to just have one single instance, if you don't, like, expect any crazy loads. So, the problem here is that sometimes scaling up just one instance may be more cumbersome than just having several single instances separated and deployed individually. So, yeah, as I said, this is very much it very much depends on on the context. For our case, it makes sense, but it may not make sense for for yours.\u003C/p>\u003Cp>So another possible benefit is that it can lower the the, entry barrier for your your potential clients. So and this is actually one of the reasons why we also choose this. So let's say we have a client that wants to use your product, but they don't really want to worry about the infrastructure. So they don't want to want to deploy anything. They don't want to run any infrastructure.\u003C/p>\u003Cp>They just want you to take care take care of all of it. And let's say you also don't really have the resources. We have multiple instances. Multi tenancy can help it can help with this. Like, a good compromise could be to just bear the costs of one single instance that can support multiple, tenants.\u003C/p>\u003Cp>And so you can also support multiple clients and a lower cost. And finally, this isn't really a reason that we, that resonated with us for our context, but it may resonate with you. It can make it easier to kind of aggregate data. So let's say you want to see which features of your, CMS are being used the most often by the most clients. It's easier when you just have, your data collocated.\u003C/p>\u003Cp>And, again, we don't really have a lot of experience with it, but it may be something that you are interested in. So let's let's say these these benefits, did convince you to to try out multi tenancy. I thought it would be the best to kinda look at a real life, example, And that's why we're going to use, our project that my team is currently working on as as an inspiration. So direct, which is kind of similar to directors and sometimes gets confusing when we talk about the project, in a company, is a platform that we're developing for Freunde visited Berlin. And it's basically focused on the management of, psychological studies.\u003C/p>\u003Cp>So it's basically a one stop shop for, coordinating a study, creating content for a study, distributing that content to potential study participants. Like one example of of, possible psychological study could be, like, to analyze the impact of immigration of an immigration process in an asylum seeker, for example. So where does multitenancy come into play in in in our product? So the main goal of our clients of AIUN VISITED was to be able to offer the platform to other partners. So think other universities, without having to ask them to set up their own infrastructure.\u003C/p>\u003Cp>So I feel would bear the cost of of the infrastructure and would offer the platform to other, to to other clients. But, Fine Infrastructure Debt also didn't really want to, push their own infrastructure cost too much. So the goal was to lower their own infrastructure costs and make it easier for other clients to adopt the platform. And so if, the these these requirements kinda match up nicely with with the advantages that I listed, above. So we kinda went ahead and implemented multi tenancy for this.\u003C/p>\u003Cp>So before we get started actually looking at the implementation, a quick side note. So today we'll be focusing on multitenancy just from the CMS point of view. However, your project and as our own did, probably has more moving parts. So there are more places where you have to implement multitenancy and there are more places where you have to set up systems that guarantee that multitenancy is insured on all of, on your entire platform. So direct direct itself is composed of several different systems.\u003C/p>\u003Cp>So we have a CMS to create the content. We have an app that is used by the study, participants. We have an admin panel that's used by the coordinators and then an API to kind of tie it all together. So we had to do a lot of changes in all of these, on all of these parts of the app. So today, we're gonna look at a small subset of, of multitenancy, obviously, focused on directors.\u003C/p>\u003Cp>And, hopefully, it'll be at least, like, a starting point for you to to kinda go through with with a pullbacking multi tenancy on at least one part of your of your product. So, yeah, with that said, like, let's jump right into it. So when you Google direct us multi tenancy, there are not a lot of results. Like there's not like one major guy that pops up to to, as as being, like, super relevant for your use case. We have a couple of, like, GitHub, issues, a glossary entry in the Directus website.\u003C/p>\u003Cp>We also have, like, more discussions, more GitHub discussions, the down further. So let's maybe look at the glossary entry for for multi tenancy. So, this entry provides a very similar definition to, the one that we looked at previously, but it adds some director specific details. So, basically, that's the two main ways that you can achieve multi tenancy, indirect. So either through project scoping or through wall scoping.\u003C/p>\u003Cp>So we, for our product opted for wall scoping because project scoping was just not a viable option for us. We self host, and we weren't really, it wasn't really viable to deploy multiple instances of directors as a project scoping approach does. But maybe if if you happen to use Directed Cloud, then, yeah, this definitely could be an option. It's just a disclaimer that we opted for rollscoping because it's all flows and at the moment, at the time, it's was the most reasonable option. So in this presentation, we're going to I'm going to showcase like a slightly modified approach of the roll scoping.\u003C/p>\u003Cp>So basically, instead of using, one word per tenant, we're gonna assign tenants to users. We found this approach to be a bit simpler, and it is also one that is, kind of promoted by direct. This is one of in one of their more or less recent videos, that talks about multitenancy. But both options are obviously, good, and it's just the context dependent. There's not much to one over the other.\u003C/p>\u003Cp>So regardless of which approach you choose, either assigning tenants to roles or to users, the main concept to keep in mind is permissions. So, in in our approach, the tenant based permissions are the core of the logic. So, essentially, it's these permissions that allow us to filter which items a user has access to based on the, on the tenant of that item and that user. So let's maybe to to kind of make it easier to visualize this. Let's take a look at all the data structure.\u003C/p>\u003Cp>So in in this approach, we have a tenant's collection, as a matter of guess, which allows you to to find the tenant. So in a real life scenario scenario, which is what we do, this creation, the credit permissions for the tenants are limited to the super admin role, and which is something that you also might consider because the tenants are a very, very privileged is a very privileged privileged collection. So after we create the tenants collection, we also need a way to actually assign the tenants to to things, to tenants and to users and other collections. So we create one to many, relations between the whichever collections you want to be, multi tenant and to the users, collection as well. So now we can assign tenants to things and to users, but we don't have data segregation at this point.\u003C/p>\u003Cp>So a a user from one tenant can see data from another tenant. So, but first, let's maybe look at at permissions. So, users belongs to roles and roles can have many permissions. And these permissions basically dictate how the roles can interact with the collections. So let's say we have a customer role and we, we have an admin role.\u003C/p>\u003Cp>We may want to prevent the customer role from creating in tenants while a site while allowing the admin role for correct permissions to to the tenant collection. So you may have noticed that in these two diagrams, the permissions, collection doesn't really have, a connection with the tenants. So how do we actually create the tenant based permissions that our system depends on? So to put it all together, we kind of need the last piece of the puzzle, which are rules, permission rules. Rules allow you to make this permission the permissions more specific.\u003C/p>\u003Cp>So in this case, we're adding a rule that states that the user can only access, an item in a collection if their tenant matches a tenant of that item. So let's say, this is a permission for the customer role to to read from the product collection. So this is basically the gist of how the multi tenancy solution with, with user permissions, goes. So you may be aware that also, besides the data structure, there are there's also the question of actually creating sorry. I have a question about that.\u003C/p>\u003Cp>Yes. Isn't it pretty tedious Exactly. We're gonna we're gonna we're gonna cover this right in the right in the next slide. So as I like like you said, it's it's very tedious to set up roles and permissions automatically, especially if you have like multiple deployments of, of the application. So and it's Stephenson is also error prone.\u003C/p>\u003Cp>So, if you forget to add a permission to a credit collection, then you're gonna be using our app and then you're gonna be, like, scratching your head, trying to understand why isn't is this not returning the items correctly? Or when I when I quit because I know that I created a collection. Why are they not showing up? So, you know, it's a very, very prominent. It's very tedious.\u003C/p>\u003Cp>So because we have a lot of collections and because we have several deployments, like in review apps, in staging and production environments, we kinda set up, automated permissions through, scripts. So we don't use it for this. We use external scripts, but the concept concept is is the same. So using the direct SDK, we fetch all of the collections that should support multi tenancy. So, in this case, we check the collect the collections that have a tenant field.\u003C/p>\u003Cp>And then we update the director's permission, system table to to include all of the permissions, that we want to support, and ensuring that the permissions field specifies that the rule that we we looked at a few slides ago, is is enforced, which ensures that users can only access, can only do specified actions, either reading or writing or sharing on the items that belong to their own tenant. And in addition to our own collections, you can obviously do this also to system collections. We also do it with files and folders because they, say it should be tenant specific as well. And the the logic is fairly similar. You just have to change the the target of of that permission.\u003C/p>\u003Cp>And so with this basic data structure and with these, automated, permissions, we can have a simple multitenancy to to start with. And as useful as we found this setup to be, we, this this approach kind of does come with some downsides, and I would highlight 2. So the first one would be complexity. So setting up a multi tenant system is inherently more difficult, especially if you have more than just a CMS. And in the multi tenancies system as is our our own case, we also have to add additional features like our clients, also wanted a multi tenant kind of work for a multi tenancy approach because they wanted customization.\u003C/p>\u003Cp>They wanted their tenants to be able to customize the UI. They want the to customize the way that the study flows. So it adds it's more complexity to to wrap your head around. It's just overall a are the solution to it to implement. And secondly, because the data is is co located, at least in this approach, it's we pay need to pay even more attention to security, especially if you're handling, very sensitive data like medical data.\u003C/p>\u003Cp>Like, we're placing a lot of trust in this in this multi tenancy system. So this comes at a cost. We need to implement more systems, more checks to make sure that the data release, segregated and, that we we can ensure our clients that, you know, no tenants can see sensitive information from other tenants. As with everything, basically, multi tenant is yes as trade offs. And there really isn't one clear cut rule that can tell you whether you should or should not implement a multitenancy for us.\u003C/p>\u003Cp>At the time it makes sense and it still continues to make sense. We're still working on it. We're still integrating on it, and it may or may not make sense for your project. And but, hopefully, this this brief intro will kind of at least, settle some, give you some stronger ground to to to thread when you start in, when you start exploring this topic. And we're almost done.\u003C/p>\u003Cp>But before before you go, I'd like to circle back on on what I said a few slides ago. So this this brief guide, let's put it that way, is meant as a starting point to multitenancy. So there are a lot of topics which I definitely did not cover today. Some things we have come across in our own product and we have solved them. Others which, we have encountered and the decided that we don't really have the resources or it doesn't really make sense to to tackle them right now.\u003C/p>\u003Cp>And surely, like many other many other topics we are not even aware of. So I just I gather a few here, like, a few topics of discussions for for examples. So how do you handle uniqueness across tenants, for example? So let's say you have a books collection and in the scheme of that collection you have an ISBN. So the, unique code that is attributed to 2 books, field that is set to unique.\u003C/p>\u003Cp>And then 2 of your tenants have the same book, and the first tenant tries to add a book to a collection and it's offline. And then the second the second tenant second user in another tenant tries to add a book and throw an arrow stone because the field is supposed to be unique. So how do you handle the situation? So you can maybe set up a composite index, so that the unique constraint applies only to the ISBN tenant pair and not just the ISBN. But as far as I know, this is not a natively supported indirect.\u003C/p>\u003Cp>So you would have to do some workarounds. You'd have to implement some custom interface to show that. But it is a possibility. Or you can even remove the unique constraint if if you think that it doesn't really compromise the integrity of your data schema, it can be it can be easier to just remove the constraints if you can ensure that the system is still compliant with with your with your architecture. And what about tenancy outside of directors?\u003C/p>\u003Cp>I did mention before that we have several other systems in our platform. So how how do you sync up the tenants collection with with external services? So we can you can set up scripts that run periodically and sync the necessary information, which is what we do, or you can also make use of direct to Saks, which is also something that we are considering, and something that possibly we will start adopting. And what about permissions? Like, how do you keep permissions up to date?\u003C/p>\u003Cp>If a new collection is added, it's just as come or correctly. So in our use case, we, the automation for this, for this, that it wasn't really worth the effort, but you can also adopt a similar approach to the tenancy that I mentioned in the point above. And, finally, like I said previously, we are following a user based tenancy as opposed to a world based one. But as I said, both options are are viable. I've linked some discussions, in the appendices of of the, of this presentation that do go further into into this topic if you like, if you're interested.\u003C/p>\u003Cp>But, yeah, I'm sure there are many, many more topics that we haven't really had the chance to to cover, but hopefully this is a good for the, for the discussion. And I do hope that this presentation kind of provided you with a solid, solid introduction to, to multitenancy and that it can make its implementation a little bit less, less painful. And, yeah, I think I think that's it. Thank you all for listening. I left my email there if you're interested in just asking whatever about the presentation, about the product or whatever you you can think of.\u003C/p>\u003Cp>And, yeah, if you have any questions, then let me know. If you don't, then that's fine. I'm not, I won't get mad, but yeah. Thank you.\u003C/p>","Okay then. So welcome everyone. So I'm Mariana. And today, I'm going to be talking a little bit about, we handle multi tenancy in one of our projects. So basically, like a startup guide for if you need to set up multitenancy in your project, just from the director's point of view, but hopefully it'll help you, like, make the process a little less, painful. Let's let's put it that way. So, yeah, I'm Mariana. I'm a software developer at Ivory Heroes. I've been at the company for, okay, a year 8 months, I think. And this is Joliel who is not here. Unfortunately, he was going to be co presenting with me, but something came up. So it's easier in spirit. So, and without without any further delays, let's just get right get right into it. So basically, the structure of the talk will be like, defining multi tenancy. So what it is, then the advantages, how why you might need it, why it may make sense for your own projects. Then basically, we'll do a small case study of 1 of our own projects where we had to implement multi tenancy. How we approached it, how we got started, and also the downsides of our approach and some other, like, general topics that also came up while we were doing this implementation. So, yeah, let's let's get right into it. So, basically, multi tenancy is an architecture where you have essentially one single instance to serve multiple clients. So let's say you want to set up a CMS to, for schools to set up their own block content. With multitenancy, you can have you can also only one instance of, of directors and serve all of all of the schools you want, while having the data collocated but separated from each other. So each school would only see the information that pertains to their own school. But, like, why would you want to do that? Why not just set up individual instances for for each school that would like to to use your services? So maybe maybe you want to lower infrastructure costs. So in some situations, and now we'll stress the some parts of the sentence because it's it's very dependent on the context. It may be cheaper to just have one single instance, if you don't, like, expect any crazy loads. So, the problem here is that sometimes scaling up just one instance may be more cumbersome than just having several single instances separated and deployed individually. So, yeah, as I said, this is very much it very much depends on on the context. For our case, it makes sense, but it may not make sense for for yours. So another possible benefit is that it can lower the the, entry barrier for your your potential clients. So and this is actually one of the reasons why we also choose this. So let's say we have a client that wants to use your product, but they don't really want to worry about the infrastructure. So they don't want to want to deploy anything. They don't want to run any infrastructure. They just want you to take care take care of all of it. And let's say you also don't really have the resources. We have multiple instances. Multi tenancy can help it can help with this. Like, a good compromise could be to just bear the costs of one single instance that can support multiple, tenants. And so you can also support multiple clients and a lower cost. And finally, this isn't really a reason that we, that resonated with us for our context, but it may resonate with you. It can make it easier to kind of aggregate data. So let's say you want to see which features of your, CMS are being used the most often by the most clients. It's easier when you just have, your data collocated. And, again, we don't really have a lot of experience with it, but it may be something that you are interested in. So let's let's say these these benefits, did convince you to to try out multi tenancy. I thought it would be the best to kinda look at a real life, example, And that's why we're going to use, our project that my team is currently working on as as an inspiration. So direct, which is kind of similar to directors and sometimes gets confusing when we talk about the project, in a company, is a platform that we're developing for Freunde visited Berlin. And it's basically focused on the management of, psychological studies. So it's basically a one stop shop for, coordinating a study, creating content for a study, distributing that content to potential study participants. Like one example of of, possible psychological study could be, like, to analyze the impact of immigration of an immigration process in an asylum seeker, for example. So where does multitenancy come into play in in in our product? So the main goal of our clients of AIUN VISITED was to be able to offer the platform to other partners. So think other universities, without having to ask them to set up their own infrastructure. So I feel would bear the cost of of the infrastructure and would offer the platform to other, to to other clients. But, Fine Infrastructure Debt also didn't really want to, push their own infrastructure cost too much. So the goal was to lower their own infrastructure costs and make it easier for other clients to adopt the platform. And so if, the these these requirements kinda match up nicely with with the advantages that I listed, above. So we kinda went ahead and implemented multi tenancy for this. So before we get started actually looking at the implementation, a quick side note. So today we'll be focusing on multitenancy just from the CMS point of view. However, your project and as our own did, probably has more moving parts. So there are more places where you have to implement multitenancy and there are more places where you have to set up systems that guarantee that multitenancy is insured on all of, on your entire platform. So direct direct itself is composed of several different systems. So we have a CMS to create the content. We have an app that is used by the study, participants. We have an admin panel that's used by the coordinators and then an API to kind of tie it all together. So we had to do a lot of changes in all of these, on all of these parts of the app. So today, we're gonna look at a small subset of, of multitenancy, obviously, focused on directors. And, hopefully, it'll be at least, like, a starting point for you to to kinda go through with with a pullbacking multi tenancy on at least one part of your of your product. So, yeah, with that said, like, let's jump right into it. So when you Google direct us multi tenancy, there are not a lot of results. Like there's not like one major guy that pops up to to, as as being, like, super relevant for your use case. We have a couple of, like, GitHub, issues, a glossary entry in the Directus website. We also have, like, more discussions, more GitHub discussions, the down further. So let's maybe look at the glossary entry for for multi tenancy. So, this entry provides a very similar definition to, the one that we looked at previously, but it adds some director specific details. So, basically, that's the two main ways that you can achieve multi tenancy, indirect. So either through project scoping or through wall scoping. So we, for our product opted for wall scoping because project scoping was just not a viable option for us. We self host, and we weren't really, it wasn't really viable to deploy multiple instances of directors as a project scoping approach does. But maybe if if you happen to use Directed Cloud, then, yeah, this definitely could be an option. It's just a disclaimer that we opted for rollscoping because it's all flows and at the moment, at the time, it's was the most reasonable option. So in this presentation, we're going to I'm going to showcase like a slightly modified approach of the roll scoping. So basically, instead of using, one word per tenant, we're gonna assign tenants to users. We found this approach to be a bit simpler, and it is also one that is, kind of promoted by direct. This is one of in one of their more or less recent videos, that talks about multitenancy. But both options are obviously, good, and it's just the context dependent. There's not much to one over the other. So regardless of which approach you choose, either assigning tenants to roles or to users, the main concept to keep in mind is permissions. So, in in our approach, the tenant based permissions are the core of the logic. So, essentially, it's these permissions that allow us to filter which items a user has access to based on the, on the tenant of that item and that user. So let's maybe to to kind of make it easier to visualize this. Let's take a look at all the data structure. So in in this approach, we have a tenant's collection, as a matter of guess, which allows you to to find the tenant. So in a real life scenario scenario, which is what we do, this creation, the credit permissions for the tenants are limited to the super admin role, and which is something that you also might consider because the tenants are a very, very privileged is a very privileged privileged collection. So after we create the tenants collection, we also need a way to actually assign the tenants to to things, to tenants and to users and other collections. So we create one to many, relations between the whichever collections you want to be, multi tenant and to the users, collection as well. So now we can assign tenants to things and to users, but we don't have data segregation at this point. So a a user from one tenant can see data from another tenant. So, but first, let's maybe look at at permissions. So, users belongs to roles and roles can have many permissions. And these permissions basically dictate how the roles can interact with the collections. So let's say we have a customer role and we, we have an admin role. We may want to prevent the customer role from creating in tenants while a site while allowing the admin role for correct permissions to to the tenant collection. So you may have noticed that in these two diagrams, the permissions, collection doesn't really have, a connection with the tenants. So how do we actually create the tenant based permissions that our system depends on? So to put it all together, we kind of need the last piece of the puzzle, which are rules, permission rules. Rules allow you to make this permission the permissions more specific. So in this case, we're adding a rule that states that the user can only access, an item in a collection if their tenant matches a tenant of that item. So let's say, this is a permission for the customer role to to read from the product collection. So this is basically the gist of how the multi tenancy solution with, with user permissions, goes. So you may be aware that also, besides the data structure, there are there's also the question of actually creating sorry. I have a question about that. Yes. Isn't it pretty tedious Exactly. We're gonna we're gonna we're gonna cover this right in the right in the next slide. So as I like like you said, it's it's very tedious to set up roles and permissions automatically, especially if you have like multiple deployments of, of the application. So and it's Stephenson is also error prone. So, if you forget to add a permission to a credit collection, then you're gonna be using our app and then you're gonna be, like, scratching your head, trying to understand why isn't is this not returning the items correctly? Or when I when I quit because I know that I created a collection. Why are they not showing up? So, you know, it's a very, very prominent. It's very tedious. So because we have a lot of collections and because we have several deployments, like in review apps, in staging and production environments, we kinda set up, automated permissions through, scripts. So we don't use it for this. We use external scripts, but the concept concept is is the same. So using the direct SDK, we fetch all of the collections that should support multi tenancy. So, in this case, we check the collect the collections that have a tenant field. And then we update the director's permission, system table to to include all of the permissions, that we want to support, and ensuring that the permissions field specifies that the rule that we we looked at a few slides ago, is is enforced, which ensures that users can only access, can only do specified actions, either reading or writing or sharing on the items that belong to their own tenant. And in addition to our own collections, you can obviously do this also to system collections. We also do it with files and folders because they, say it should be tenant specific as well. And the the logic is fairly similar. You just have to change the the target of of that permission. And so with this basic data structure and with these, automated, permissions, we can have a simple multitenancy to to start with. And as useful as we found this setup to be, we, this this approach kind of does come with some downsides, and I would highlight 2. So the first one would be complexity. So setting up a multi tenant system is inherently more difficult, especially if you have more than just a CMS. And in the multi tenancies system as is our our own case, we also have to add additional features like our clients, also wanted a multi tenant kind of work for a multi tenancy approach because they wanted customization. They wanted their tenants to be able to customize the UI. They want the to customize the way that the study flows. So it adds it's more complexity to to wrap your head around. It's just overall a are the solution to it to implement. And secondly, because the data is is co located, at least in this approach, it's we pay need to pay even more attention to security, especially if you're handling, very sensitive data like medical data. Like, we're placing a lot of trust in this in this multi tenancy system. So this comes at a cost. We need to implement more systems, more checks to make sure that the data release, segregated and, that we we can ensure our clients that, you know, no tenants can see sensitive information from other tenants. As with everything, basically, multi tenant is yes as trade offs. And there really isn't one clear cut rule that can tell you whether you should or should not implement a multitenancy for us. At the time it makes sense and it still continues to make sense. We're still working on it. We're still integrating on it, and it may or may not make sense for your project. And but, hopefully, this this brief intro will kind of at least, settle some, give you some stronger ground to to to thread when you start in, when you start exploring this topic. And we're almost done. But before before you go, I'd like to circle back on on what I said a few slides ago. So this this brief guide, let's put it that way, is meant as a starting point to multitenancy. So there are a lot of topics which I definitely did not cover today. Some things we have come across in our own product and we have solved them. Others which, we have encountered and the decided that we don't really have the resources or it doesn't really make sense to to tackle them right now. And surely, like many other many other topics we are not even aware of. So I just I gather a few here, like, a few topics of discussions for for examples. So how do you handle uniqueness across tenants, for example? So let's say you have a books collection and in the scheme of that collection you have an ISBN. So the, unique code that is attributed to 2 books, field that is set to unique. And then 2 of your tenants have the same book, and the first tenant tries to add a book to a collection and it's offline. And then the second the second tenant second user in another tenant tries to add a book and throw an arrow stone because the field is supposed to be unique. So how do you handle the situation? So you can maybe set up a composite index, so that the unique constraint applies only to the ISBN tenant pair and not just the ISBN. But as far as I know, this is not a natively supported indirect. So you would have to do some workarounds. You'd have to implement some custom interface to show that. But it is a possibility. Or you can even remove the unique constraint if if you think that it doesn't really compromise the integrity of your data schema, it can be it can be easier to just remove the constraints if you can ensure that the system is still compliant with with your with your architecture. And what about tenancy outside of directors? I did mention before that we have several other systems in our platform. So how how do you sync up the tenants collection with with external services? So we can you can set up scripts that run periodically and sync the necessary information, which is what we do, or you can also make use of direct to Saks, which is also something that we are considering, and something that possibly we will start adopting. And what about permissions? Like, how do you keep permissions up to date? If a new collection is added, it's just as come or correctly. So in our use case, we, the automation for this, for this, that it wasn't really worth the effort, but you can also adopt a similar approach to the tenancy that I mentioned in the point above. And, finally, like I said previously, we are following a user based tenancy as opposed to a world based one. But as I said, both options are are viable. I've linked some discussions, in the appendices of of the, of this presentation that do go further into into this topic if you like, if you're interested. But, yeah, I'm sure there are many, many more topics that we haven't really had the chance to to cover, but hopefully this is a good for the, for the discussion. And I do hope that this presentation kind of provided you with a solid, solid introduction to, to multitenancy and that it can make its implementation a little bit less, less painful. And, yeah, I think I think that's it. Thank you all for listening. I left my email there if you're interested in just asking whatever about the presentation, about the product or whatever you you can think of. And, yeah, if you have any questions, then let me know. If you don't, then that's fine. I'm not, I won't get mad, but yeah. Thank you.",[174],"36bad2c5-6a4d-4f20-99ed-674d6e86821e",[],{"reps":177},[178,234],{"name":179,"sdr":8,"link":180,"countries":181,"states":183},"John Daniels","https://meet.directus.io/meetings/john2144/john-contact-form-meeting",[182],"United States",[184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233],"Michigan","Indiana","Ohio","West Virginia","Kentucky","Virginia","Tennessee","North Carolina","South Carolina","Georgia","Florida","Alabama","Mississippi","New York","MI","IN","OH","WV","KY","VA","TN","NC","SC","GA","FL","AL","MS","NY","Connecticut","CT","Delaware","DE","Maine","ME","Maryland","MD","Massachusetts","MA","New Hampshire","NH","New Jersey","NJ","Pennsylvania","PA","Rhode Island","RI","Vermont","VT","Washington DC","DC",{"name":235,"link":236,"countries":237},"Michelle Riber","https://meetings.hubspot.com/mriber",[238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,215,426,427],"Albania","ALB","Algeria","DZA","Andorra","AND","Angola","AGO","Austria","AUT","Belgium","BEL","Benin","BEN","Bosnia and Herzegovina","BIH","Botswana","BWA","Bulgaria","BGR","Burkina Faso","BFA","Burundi","BDI","Cameroon","CMR","Cape Verde","CPV","Central African Republic","CAF","Chad","TCD","Comoros","COM","Côte d'Ivoire","CIV","Croatia","HRV","Czech Republic","CZE","Democratic Republic of Congo","COD","Denmark","DNK","Djibouti","DJI","Egypt","EGY","Equatorial Guinea","GNQ","Eritrea","ERI","Estonia","EST","Eswatini","SWZ","Ethiopia","ETH","Finland","FIN","France","FRA","Gabon","GAB","Gambia","GMB","Ghana","GHA","Greece","GRC","Guinea","GIN","Guinea-Bissau","GNB","Hungary","HUN","Iceland","ISL","Ireland","IRL","Italy","ITA","Kenya","KEN","Latvia","LVA","Lesotho","LSO","Liberia","LBR","Libya","LBY","Liechtenstein","LIE","Lithuania","LTU","Luxembourg","LUX","Madagascar","MDG","Malawi","MWI","Mali","MLI","Malta","MLT","Mauritania","MRT","Mauritius","MUS","Moldova","MDA","Monaco","MCO","Montenegro","MNE","Morocco","MAR","Mozambique","MOZ","Namibia","NAM","Niger","NER","Nigeria","NGA","North Macedonia","MKD","Norway","NOR","Poland","POL","Portugal","PRT","Republic of Congo","COG","Romania","ROU","Rwanda","RWA","San Marino","SMR","São Tomé and Príncipe","STP","Senegal","SEN","Serbia","SRB","Seychelles","SYC","Sierra Leone","SLE","Slovakia","SVK","Slovenia","SVN","Somalia","SOM","South Africa","ZAF","South Sudan","SSD","Spain","ESP","Sudan","SDN","Sweden","SWE","Tanzania","TZA","Togo","TGO","Tunisia","TUN","Uganda","UGA","United Kingdom","GBR","Vatican City","VAT","Zambia","ZMB","Zimbabwe","ZWE","UK","Germany","Netherlands","Switzerland","CH","NL",1773850424878]