 Hi, I am here. It is the last talk of the day and like I was telling you guys and everyone else in the room There's more people here than I was expecting. I was expecting four Because I was in I think it was Tampa Workamp Tampa, and I was on a panel and there were more people on the panel than in the room So that didn't happen. We wound up just talking a lot. So Multi-tendency versus multi-site We're gonna couple cover me multi-site multi-tendency and then hopefully multiple questions because I'm gonna be summarizing a lot of things and not really getting into the weeds on some of the technologies because I think it will lose you guys because it loses me too because I Have guys that have built the multi-tendency for me. I'm more like I have ideas. They came up with a implementation. I Am father of four. I've got a couple here. Yay kids. I Own yeah, my little ones. I don't know. They'd be pretty distracting People on my team know because they hear Them in the background were on team calls and stuff. They're very loud but I own a company called sideways eight co-own it with a friend of mine been around for eight years and I've got Two of my employees here the other ones See what's happening next week. Just kidding. I lead I lead tours to Israel in In a couple weeks. I'll be over there assuming Russia's, you know, still nice and all that stuff. I'm a WordPress user WordPress developer Organizer of this WordCamp. There's probably some Lots of WordPress stuff vegetarian, which is weird Stay hungry all the time and I'm Atlanta native even though some people would debate if I'm a Atlanta native or a Decatur native Nonetheless, I Was born and raised within 10 miles from here. So Are you in the right room I Hope you are if you manage similar sites if you manage franchises Or single sites are killing you and I had these are like word-for-word here for Multiple reasons because these slides are going to go on WordPress TV too But if you're thinking about doing verticals So like let's say you do a lot of dentist websites or doctor websites It's you know the same over and over and over again. You probably should be using one of these Concepts or maybe not Like I said, I'm generalizing a lot because I can't get into the the weeds As much as I could you know one by one if I had five hours But I'm generalizing and so these are false statements Kind of but it'll give you the general idea With both of these multi-site and multi-tenancy. It's about being locking being locked down. Okay So in in theory No one would be able to install plugins except for on you know, if you're the administrator of the multi-tenancy You know, you would be able to upload stuff, but you're trying to lock it down. So when you set up a sub-site They won't be able to mess stuff up. No one will be able to install themes. No one should have SFDP access and then I guess that's it boom All right, I'm gonna cover these five things Maybe it'll be quick Maybe not we'll see. All right. What is multi-site? We have a great definition on The create a network on on the codex here, but basically it's one WordPress installation used for either sub-domains, so site one dot Aaron rhyman.com site two or whatever or you know Atlanta dot company name.com and then there's one indicator dot, you know, whatever for for franchises Stuff like that. You can also put it in a Sub-directory, so your your site can it doesn't necessarily have to be the sub-domain. It doesn't have to be a something dot domain It can be slash City name or something like that How is it hosted? It is hosted the same way as any normal WordPress installation So you don't have to be a rocket science to you know Configure it and set it up. You have to add a couple lines into the wp-config file and I forget how to do it actually then you log in you go over here and you enable a couple things and boom It should take like 10 minutes or less If you're wanting to do something like Atlanta dot company name comm you'll have to do a wild card DNS So the DNS will will work and how many am I losing you guys who? Good so far. Everyone's good All right, cool Then you're in the right room How does the database work? Simplifying a little here WordPress by default Has 12 tables things like WP options WP users WP users metadata stuff like that and the way multi-site works is when you add a new Sub-site or multi-site I guess we'll use word sub-site it will create 10 of those tables You don't need the user names or the user table and the data for that because Your user information will be tied in For for each site and so you could lock it down where? One user has access to three of the five subsites Causes a problem later though if you want to move that into its own domain its own WordPress install somewhere Maybe maybe I'll go into that. I don't know is there a use case for it for sure and we did a Website for a child care What do you call it daycare and they had their main site Let's call it kids calm and Because I was subcontracted. I can't mention the name of the company But then they had like John's Creek dot Kids calm Atlanta dot, you know, whatever the cities were they had 60 Locations plus and what we did we had I think 11 plugins written to do certain Aspects of it. It's all in one database. Okay Versus multi-tenancy will have separate databases. This uses the same database and so one of the plugins We had it'll push menus into all the subsites. Okay, so you have the corporate site We want every they wanted every child care to have, you know about us You know, what are the rules, you know, all the common stuff and we didn't they didn't want the subsite people to remove those You know for possibly legal purposes or whatever and so we had Certain pages you would check them and you'd hit submit or I can't even think and wordpress publish I Do a lot of content. Can you tell? That'll be that was set up to push on to all 60 sites. So Comes in pretty handy, but none of that stuff is built in for multi-site. So if you're looking for Pushing that type of stuff in so for example, we wanted they wanted the ability to have a slider a slider On the home page and they wanted it because it was I don't know a Halloween You know event that was happening at every Location we wrote a plug-in to push that slide into all 60 sites Okay, making sense That stuff isn't isn't built in but if you have things that are really really Related to each other that comes in Pretty handy. All right. Why not use it? Users might need more control so you might want it where a Agents not an agency a company needs to be able to install plugins or they might need to do More administrative things multi sites gonna lock you down multi-tenancy will do the same thing though This is the big one for me, I know it's possible but if let's say You're doing a multi-site that is not related. Let's say you do a lot of banned websites, okay? and This person is like, okay. I like your service. It's been great. I'm tired of hosting it I want to use Aaron rocks calm for my band Getting that information out is gonna be hard because you're the user data is not tied in And so you have 10 tables that are hard to get them to talk to each other So exporting is kind of hard. Obviously you can export as an XML feed. You can make it work But it's not you know, you don't hit the download button Zip it up and you're good to go Some plugins don't work on multi-site. I think that's probably kind of rare, but it's it is Common with 47,000. Oh, is that number changed? Is it up to 48 now? Okay, you know 47,000 plugins out there some of them aren't gonna work with multi-site Okay, I have at the end of this. I have a little bit.ly link for these slides, but if you Google Server pilot why you should not use WordPress multi-site? It gives you a pretty good rundown of why not to use it, okay? I think they hit all the things that I thought were were important So I'll give you guys just a second if you guys are writing that down, but I will have a bit.ly at the end and Go all right Multitenancy what is multi-tenancy? It is This is Wikipedia. So this is truth the term software multi-tenancies refers to a software or architecture, I can't read, is In which a single instance of software runs on a server and serves multiple tenants, okay? In my case we have like we have a Repository of all the plugins and all the themes and everything and all the sites pull from that and I'll have some Really bad-looking diagrams in a minute to kind of explain it So it begins so What we have Like I said, this is simplifying, but we have a website. Sorry. We have a server Okay, running Linux IngenX Mariah Maria DB and PHP And we have this site. We spin up a site in multi-tenancy and it will Have the WP content slash uploads And the WP config file and then the database Really that is unique to each site those two things all of the plugins and Themes and whatever else we have in here wordpress itself. So the admin and the includes Those are Exactly the same for every site. So we have obviously site number two This is unique the stuff that they upload is unique the Config file is unique because it's connecting to a different database than this guy would And then obviously the database is unique following me Even camera guy. He's following. So we're good. He's I hear this all the time. So all right So We have all of these sites so site one site two site three site What is in common? Are these these things wordpress itself plugins itself and themes itself and when we update one of the plugins or we update one of the themes or something to that effect Run a little script that Marty would probably do because I don't really know how to do it Pull down all these git repositories and then it's push or actually it's pulled Down in each server will get all of those things. So maintaining it really is kind of easy security wise The files don't need to be the permissions can be a little more locked down because a user is not going to go and hit the update button They shouldn't have access to it. We kind of disabled some of those things within our our platform Okay If you guys had to create 48 websites With all the plugins all of the themes plugins everything to admin how long would it take you guys to spin up 48 right It would take a little while So what we can do We can spin them up in Probably 10 5 to 10 minutes. Okay, what? What we're able to do we have an interface I'll kind of get into that slightly, but we also have a little script where you can have a spreadsheet To pull in what the domain should be what the user is going to be Etc. Etc. It generates the site the database gets all of the plugins and themes it needs to from the git repositories Is there a use case? Well, yes, there is so so we're a You guys probably saw our sideways 8th booth over there and one of the things said you build was it we've built 250 websites for nonprofits and We use that with 48 and 48 so the first year we were at We did 48 and 48. We're trying to figure out. How are we going to do this? We wanted it where we could have anybody shows up with You know like let's say there are Rails developer I don't know Django developer WordPress they could come in and do whatever they want to do use whatever tools that they want to use And they could build a site and then hand it over to a nonprofit. Okay, but we're going to wind up getting this obscure Django Installation that the nonprofits not going to be able to find a developer to be able to maintain it or update it Or anything or it might also not be might not be written. Well, so a very wise person named cliff seal Said why don't you guys do a? platform like multi-tenancy We used his platform and it worked great the first year and but it's kind of hard to support a ton of WordPress installs for nonprofits nonprofits are Needy and I don't mean that I mean it makes sense that they need a lot of stuff supporting. It's kind of difficult So we decided to build our own platform so we can tweak it the way it needs to be tweaked for us So to work on it anyway So the way 48 and 48 works is I wasn't going to go into this but I'm going to anyway because I got time Sit here for a little while no We Gina who is in here? She's on staff at 48 and 48. They and I this is my Interpretation of what you guys do so hopefully I'm doing it right. We'll see They will so so this year were we or 48 and 48. I'm not technically there I just help out with the technical side In two weeks. It's going to be in Raleigh in Blooming Oh Boston and then some some in Bloomington and then in the fall London, Atlanta, New York and possibly Probably in that order. So 48 times six. There's a lot of websites But what Gina and her team will do there Adam and his team and Carol and all those people They will talk to the nonprofits in the city. They'll sign up and then we've built this GUI to Spin up a site. So it's really easy within a couple seconds or a couple minutes You have to log in you can create a WordPress installation with all the stuff that you need or they need to build it We have I don't know under a hundred plugins on there, but it gives you know, we've got gravity forms We've got woo commerce Things that nonprofits will need to accept payments because donations are really cool That's the use case and like I said, we've done over 250 sites with that and by the end of the year will have doubled that So it's a lot of sites. We also just so you know, we don't walk people into this platform So after the events we have a plug-in Marty wrote that goes in it can zip up the active plugins The active theme and the database all the images and everything they have a zip file and they can go wherever they want with it So it's beneficial for them because they could go somewhere cheaper for hosting like go daddy bluehost a To who else were the public? You know all the sponsors that were here, you know, so they can go to a regular hosting platform And makes them happy they've got a website etc etc. Oh So Justin Garrett, thanks guys They they built the most most of the platform and did the larval app So Gina can go in and spin up a site without having to you know go into a command line and do stuff that most people don't know how to do What you don't know how to do it. Yeah, exactly. I told you to go into terminal and you'll say what terminals such a bad term So how is it hosted? It's however way you want it to work You know if you're happy with a bare metal server and you want to have a bunch of servers at your house Don't do that but at a data center you can do that if you wanted to build it on AWS digital ocean feel free How does the database work? I think I have another diagram coming up in just a minute But they're individual databases so 12 tables like a normal WordPress installation So it makes it easy when you zip it up someone can go somewhere else there's a lot of places out there that are doing multi site You know let's use the doctor thing as an as an example They build doctor websites and so they're on multi site when it's time for them to go it's kind of difficult There's not I don't know is there a plugin to convert something from multi site cliff seal and Micah are nodding their head yes So okay does it work? Have you tried it? Yeah it doesn't work? Okay so it's possible it just might not be the easiest So here's kind of how the multi tendency works we have the series of tubes also known as the internet And some people laugh that was good then we have digital ocean and what digital ocean does it gives us little little servers Virtual servers base that might be a bad term Anyway servers and we have this portal running larval so Gina can log in she can create a site Once she puts that information in important stuff like the nonprofits email address of the person that's going to be there Because what it's going to do is it's going to send an email WordPress email saying here's your username and password So once she creates that and also puts cloudflare credentials in there it goes to the provisioning server The provisioning server does stuff that's smart that's awesome it talks to the database server so it creates a site for that nonprofit And then depending on whichever server because we have a not a slew but we have a decent amount of servers on there It'll one of the sites will wind up on one of these one of the servers make sense kind of So yeah we have think we have Marty how many do we have Eight ten okay so ten so one server for the portal one for the provisioner one simplifying a little for the database And then the actual the php the actual processing of the website you know will hold I don't know twenty to fifty websites on that server But it all comes all of the plugins all the themes and everything come from this central repository or multiple repositories How am I doing it's going to be shorter than I thought sweet it's the end of the weekend So into the event we all just want to go home so oh need to fix my slide so why not use it because it's hard WordPress is kind of easy to install you know you can do it in five or so minutes if you get really good at it To build a multi-tenancy it requires a lot of knowledge why is that my I can't do it you know hire people that can do it But I understand the concept right so you need to know Linux you need to know get larval digital ocean API Rabbit see where I'm going that's a lot of a lot of stuff that probably is not talked about here at word camp Probably get there's normally get talk I don't think there was this year though Ansible for like playbooks to run the scripts And these two are kind of cool so the let's encrypt in the cloud flare so when when a nonprofit says I need a website Gina goes in creates it we we get them to put cloud flare credentials in there And so that way when we hit the go live button it talk to the API the let's encrypt API give them an SSL certificate Then it will also talk to cloud flare and say hey this domain switch it from my site dot 48 and 48 sites dot org to the real domain And so it makes it easy add an event when you only have 48 hours at the end of the event should be able to push the buttons to make things go live We'll know in a couple weeks how well that works we did it all manually the first I don't know five or six things that's a lot of It's a lot of tweaking trying to make 48 sites go live in one evening once everybody is really tired to so so I said it's a lot of work But for certain use cases it's great I don't know if there's many use cases for multi tendency I know evermore has a multi tendency platform And it works great for them for their use case but it's a lot of it's a lot of work to set it all up multi sites I'm sorry yeah multi site it's a lot more simple but the use cases are pretty different so right here is the bitly link So you can get these slides and 27 minutes that's not bad so anybody have any questions