- 9
- 27 016
Sabatino Talks Dev
Belgium
เข้าร่วมเมื่อ 26 พ.ค. 2010
DNS management in a multi-tenant setup
#laravel #webdevelopment #webdev
DNS management on a larger scale, for example in a multitenant application, can be a a massive pain. In this video we’ll be taking a look at how you can manage hundreds, if not thousands of custom domains for your multi-tenant application, without a headache!
00:00 - Introduction
00:16 - Multitenant DNS management
01:50 - Configuring custom domains
03:08 - Dynamic reverse proxies
06:13 - Final words
DNS management on a larger scale, for example in a multitenant application, can be a a massive pain. In this video we’ll be taking a look at how you can manage hundreds, if not thousands of custom domains for your multi-tenant application, without a headache!
00:00 - Introduction
00:16 - Multitenant DNS management
01:50 - Configuring custom domains
03:08 - Dynamic reverse proxies
06:13 - Final words
มุมมอง: 3 148
วีดีโอ
Learnings from our multi-tenant Laravel application
มุมมอง 12Kหลายเดือนก่อน
In this video we'll be taking an in-depth look at our multi-tenant food ordering app, that's built in Laravel. We'll talk about our single, shared database approach, and the issues that come with it. And finally we take a look at how tenant resolving works in our application. How a flash sale took down our entire system: th-cam.com/video/PmwZ9rpfouY/w-d-xo.html This project started in 2014 and ...
BFCache explained & how to make your webpage compatible with it
มุมมอง 1.2K2 หลายเดือนก่อน
#webdevelopment #javascript #frontend BFCache stands for backwards/forwards cache, and is a mechanism that allows browsers to keep a snapshot of an entirely rendered page in-memory. In this video we'll dive deeper into the mechanisms that allows browsers to render a webpage from the BFCache almost immediately, with barely any loadtimes. We also take a look at what happens to the execution of yo...
Scaling our Laravel app, after a flash sale took down our MySQL database
มุมมอง 6K2 หลายเดือนก่อน
#webdevelopment #laravel #developer #devops #mysql #redis #caching In this video I talk about how a sudden spike in traffic (ie. a Flash Sale) took down our database and Laravel app. Learn how we effectively scaled our app using an effective Redis caching strategy. Shopify pod-based architecture: shopify.engineering/a-pods-architecture-to-allow-shopify-to-scale 00:00 - Introduction 00:25 - The ...
WebUSB is my favorite browser API
มุมมอง 1.4K2 หลายเดือนก่อน
#webdevelopment #frontend #webdeveloper WebUSB is an API that allows web applications to communicate directly with USB devices, bypassing the need for native drivers or middleware. As you might imagine, this opens up a universe of new possibilities for developers, making hardware more accessible than ever through the web. The video gives a high-level overview of the possibilities of WebUSB and ...
SVG ForeignObject saved us over €2,400 yearly!
มุมมอง 1.3K3 หลายเดือนก่อน
#webdevelopment #laravel #aws #devops I develop and maintain an ecommerce solution for restaurants and snackbars. A big part of our solution is streamlining the production process for takeout and delivery orders. At the heart of the production station, we install a tablet and a thermal printer, which will print the incoming orders and really help the merchant to keep their operations running sm...
Shipping Prisma in Electron was a mistake
มุมมอง 6143 หลายเดือนก่อน
#webdevelopment #nodejs #frontend Lessons learned from converting our web-based app to Electron: th-cam.com/video/J3PQyWN5bH0/w-d-xo.html When we made the move to Electron, I had to decide which database-technology we wanted to use. I’m a big fan of Prisma so I thought to myself: Can we not simply ship Prisma with Electron? Prisma is an ORM that is able to generate a type-safe database client, ...
From web to Electron - lessons learned
มุมมอง 4473 หลายเดือนก่อน
#webdevelopment #nodejs #frontend I wanted to share a couple of lessons we learned while developing our Electron-based point-of-sales app. We started out with a web-based version that slowly evolved to an installable Windows application. The web-based version was a single-page-app that ran in the browser. From a development perspective, this made the most sense, since our entire platform was we...
NGINX worker connections caused downtime
มุมมอง 9803 หลายเดือนก่อน
#webdevelopment #laravel #nginx #devops In this video we're diving into a recent downtime incident I faced on my web app. My web app is a multi-tenant ecommerce application that provides webshops for restaurants and snackbars, kinda like Shopify on a smaller scale. It’s mainly powered by a Laravel monolithic application. We have a pretty predictable traffic pattern, with 1 spike around lunch ti...
Hi Sabatino. Thanks for the insight. If you were to do this again today, how would you approach it? Would you use a third-party package or would you build it all yourself?
i am working on an app for some time but when i needed more complex queries for filters i added prisma and everything was working fine but now i wanted to build and deploy it to let people test it to discover bugs i get an error that it cannot find the module prisma client ive been trying to fix it a whole day already
In Electron you need to include the prisma binaries in package.json under build > extraResources. This way, your app can find the necessary binaries at runtime.
@@sabatino-dev and how does that look like? i read a few thing sbut idk how to apply it in my case, do i need to change the package.json too or only the electron builder config?
@@sabatino-dev ive read about that but i couldnt apply it to my project, can you help me somehow i dont have a build section in my package.json rn i only have a script npm run build that uses electron builder
@@sabatino-dev ok ive read about that but idk how to apply it to my project but ill try again
@@sabatino-dev so where is the .prisma folder supposed to be located when the app is built, i need to specify: from .. to .. right? could you maybe take a look at my electron builder and package.json config, i could create a public repo so you can see it
Great video! Thank you for examples!
Glad it was helpful!
Nice share🎉
Thank you! Cheers!
Does WebUSB lib allow users to select on the webpage any USB device connected to desktop PC or laptop (like android Internel shared storage) and save files from webserver to smartphone without knowing device VID before its connected?
In my experience it’s designed for lower-level device interaction. For writing files, you’re better off with the File System Access API
Very helpful!. @sabatino , I was wondering. use ceryx to proxy the requests to target loadbalance. do we need to dynamic add server block on nginx? since the beginning of this videos you said no need to change ngxin config. how does target server's nginx server handle requests with custom domain. ? Updated: after try it out. get error 629 SSL_do_handshake() failed (SSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure) while SSL handshaking to upstream
The target server should handle things automatically, since Ceryx rewrites the host header. No additional Nginx config is needed on the target.
@@sabatino-dev thanks. I try Traefik Yesterday, also works did learn something.
@@sabatino-dev I did solve the redirect issue. for everybody. just make sure laravel application should trust the proxy in the middleware. This make it works. thanks buddy, This way is more easy maintanable.
@kenlin2135 nice!
Great video...looking for to a tutorial on how to achieve similar thing and hopefully that would be soon
Thanks!
Great content! Please upload part 2
Thanks! Will do!
Great Video! - I'm currently tackling this problem for laravel multi-tenancy. What do you think about "Cloudflare Custom Hostnames" and then using the "Flexible" SSL Option to eliminate having to create certificates and finally adding an Alias using the laravel forge API.
It’ll probably work, but IMO doing Nginx config work in Forge for every custom domain will bite you in the ass down the line. If you need to scale for example, you’ll be burdened with a massive amount of config changes.
This is wonderful, i learnt something new today and I'd like to see your Ceryx implementation for reverse proxy. Subscribed!
Thanks!
for sub domain of each users. did u use wildcard domain name?
Yes, wildcard subdomain DNS record!
Nice video! I'm wondering what did you use for the thermal printers? I'm having some troubles with my printers now but it's not the ideal solution I was looking for, I mean it works right now. But no, I know it can be improved even more.
node-escpos and receiptline were life savers!
Very interesting content, thank you! Could you share your practices on handling tenant/user ids?
If I’m not mistaken he has a video with this content.
This video covers it: Learnings from our multi-tenant Laravel application th-cam.com/video/Lmope5CdM10/w-d-xo.html
Great video! Do you know if there is a way to print the order without the dialog box that most of the electron examples shows? i mean, i'm trying to print the paper directly in the kitchen right after the customer asks to help small restaurants to avoid the need to stay in front of the screen clicking all the time. im trying to do something just like you, but instead of clicking to accept the printing it would print automatically. i dont know if its possible due to any security restriction...
Should be possible, we send raw ESC/POS commands to the printer without dialogs, and it works. Maybe take a look at a Node library that can achieve this?
this channel looks very promising !!! good luck and keep it coming
Thank you! Will do!
Good insights, thank you. Love the multi-tenancy/SaaS topics. For my SaaS, I have the clients set up a CNAME to my domain instead of an A record, so I have the IP under control. I add the custom client domain as Alias in Laravel Forge, then re-issue the cert. Let's Encrypt is limited to 100 aliases though, but I'm just starting out, so that's not a problem. Keep up the good work!
Sure, but CNAME doesn’t work for root domains unfortunately, only for subdomains.
@@sabatino-dev Whilst that is true, CNAME flattening has been a thing nowadays with many modern DNS providers, which could make it a better manageable option in many cases.
Noob here. May I ask to make a video talking about the difference between using Laravel and Code Igniter ? And, when should I use which.
Not a big Codeigniter guy I’m afraid 😅 I’ve been doing Laravel for 10+ years, and did CakePHP/Slim before that
You are so amazing and I am so happy that I pressed the bell on the subscribe. You are a gem seriously, thank you. This is so valuable. Have you ever done database replication for your company?
Thanks for the kind words! 🙏 we do replication on AWS RDS, and AWS DMS has been a massive help to migrate our database to RDS.
Very helpful information ❤ Looking forward to your videos 🎉🎉
Glad you like them!
Very helpful! Thank you! Your content is amazing! You bring us topics that are not often discussed in the Laravel/PHP ecosystem!
Glad it was helpful!
Thank you
You're welcome, hope it was helpful!
Your applicatiom demo plz@@sabatino-dev
Great videos, but the background sounds is loud especially at the end of the video.
Yeah, still learning to use the mic 😅
Got this video recommended by TH-cam - loved it and watched all of your other videos + subscribed. I just wanted to tell you that your content is really good! Keep it up, I love the Laravel related topics on your product. I am also building a SaaS with Laravel at the moment, so I love to get some insights from other devs. Looking forward to your next videos
Thanks for the kind words! 🙏
What is the name/website of your product?
It’s called Unipage
Nice video and audio quality. 👍
Thanks!
Hello, I was looking at your video channel. We may be helping a company that uses secure images to increase supply chain security and help cloud native development. Would you be willing to help try their software, make a video, and help show devs how to use their tools? This is not an offer, but just to start a conversation about your willingness to take on sponsorship. Please provide me with your email if you are interested. You'd have a chance to look at their technology and decide if it's the type of software that you'd be interested in covering in your channel.
You can reach out to dives.retake_07@icloud.com
You can do a more detailed video on managing SSL on subdomains if you don't mind. On my SAAS app I had used wildcard subdomains. Also how to setup automatic DNS configuration in a case where a tenant adds a full domain.
Next video will cover this!
@@sabatino-dev Ok thanks
Thanks.
You're welcome!
Amazing video, I would like to hear more information about the Ceryx proxy and how it's used in production
Next video will cover this!
Easy to understand 😊
Glad to hear that!
what app is this?
It’s called Unipage, it’s a European food ordering system, with customers in Belgium, the Netherlands, France, …
I just did a multitenant Laravel app, except each tenant has a separate database, which has some 3rd party software db. Tenant is set in the url and middleware selects the correct database connections. Multiple databases, some common databases and some selected by the tenant in middleware. Models extend common/tenant, and so the queries go to the db that middleware activated.
Very nice! How many tenants do you have? How do you deal with migrations?
Queries to know!
@@sabatino-dev There are no migrations on a 3rd party app db. Only 4 tenants 🙂SOAP classes and db models are auto generated , from ~100 tables.
@@sabatino-dev Btw, for complex queries like reports and such, it is better to use SQL Views and not Eloquent, except read-only eloquent model for the view. Views can be put in another DB and for those you can use migratios also (when you can't edit 3rd party db)
I am going to have a multitenant with multi domain and multidatabase but the problem is whethere i should go with readymade theme available on codecayon or go with in house development. I am targeting nearly 20k tenants in a year So afraid of collapse of code available on cadecayon .
I bought my fair share of Codecanyon projects - and always regretted it. I wouldn't touch anything on Codecanyon as the code quality is usually garbage.
Great video! I am in the process of migrating an existing application into a multi-tenant site and your point 1 what I was debating on. Thank you for the insight. Any particular reason for playwright over dusk? Also feature flags are great!
Glad it was helpful! Playwright has an easy integration on AWS Lambda, that’s the only reason basically.
please tell us how you are handling jobs for tenants?
Every job receives a ‘tenant’ in the constructor, but in Laravel 11 you can use ‘context’
With Laravel 11, you can use the new Context class to pass the tenant into the jobs without having to manually pass it to each job/event.
Yes, that’s a life saver indeed!
Your lessons are well-explained and are deeply insightful! I also have a multi-tenant application that I have been developing since 2018, and your video couldn't have come at a better time. I especially love how you use middleware to resolve tenants. This is something I will surely borrow. Thank you, Sabatino!
Glad it was helpful!
Please make a tutorial for multi tenancy website please ❤
Will add it to my idea list, thanks for the suggestion!
Thank you so much for this
Thanks for watching!
How are you different from shopify?
We’re focused on restaurants & snackbars (fast food). Our system is built specifically for these use-cases. I’ll give you an example: in Belgium it’s required to have a registered POS. We have such a license (and had to jump to a massive amount of hoops to get it), Shopify does not. If we were to expand into retail, we will get into Shopify territory. Currently we’re in a different niche.
@@sabatino-dev Okay cool!
Really helpful video! I've also created a multi-tenant application and ran into many of these problems. One of the problems we still have issues with is tenant-specific email configuration. Can you cover this topic in your next video?
Great tip! It’s something we do as well, some customers want us to use their SMTP server, while others only want to customise the ‘from’ address. IIRC: we do this by having a ‘BaseMail’ class that takes in our tenant, and overrides the default (fallback) mail configuration. Every mail we create inherits from this BaseMail class.
Hi, great video. How can I contact you?
I started a discord community server at discord.gg/nTpQanKduF - feel free to join me there!
@@sabatino-dev I dropped a message
@joewlfrd I agree with you 100%. Sabatino, you brought us a fantastically simple and clear approach! I can't wait for more videos like this. Congratulations and success! 😃🚀
Thanks for the kind words!
This is the best explanation for Laravel Multi-tenant I’ve come across so far. Please consider making a simple tutorial covering this topic in depth. New subscriber and thanks again
Thanks for the kind words! Great suggestion! 🙏
Thank you very much, very insightful
Glad it was helpful!
I've been doing web development for years, and I had no idea about this. Thanks!
Happy to help!
I'm also doing the same way for my multi tenant rental app
🙌
how to handle offline databae to online database? Do u mean when pos is start, it need a little internet to fetch new data from server and put into local? and every orders, u make a success order in offline? i mean when click order and payment it success in local, then in the background it is sending to server, right? and if it is no internet, it keep in the local, and when internet back it process again right? and if it is no internet for long time, when the pos start first time, u check it has internet or not, right? if it has, u sent data to server and fetch lastest back to local ? and this cycle is loop like so... right?
We do have a procedure that’s called ‘close day’ - it’s essentially a button that closes the POS for the day. This feature is our last resort, if there are orders that are not synced - we do it in this procedure. This procedure only succeeds when 100% of the orders are synced to the cloud. Other than that, the entire POS can function offline (after an initial sync with the server), and keeps filling a local database.
@@sabatino-dev so this pos is need internet for the first time and when pos is close, right? is it not? how can we stop user using POS because it can use in local? one more, when data init to server, is it do one by one row or sent them all? after sent, do u clear local database or keep it normal? and how we know it a new data or old data which u dont need to init to server?
We batch the rows we send to the server by 10 or 20, it can be configured per POS. When the POS is offline for longer than 72 hours it stops working, we require at least 1 ping ‘home’ every 3 days.
@@sabatino-dev nice concept, I learn a lot of stuff from you. I consider build muti tenency DB too for POS as Saas in my country. Thank you so much.
I am building a multi tenant app too. These were very helpful. Thank you very much
Glad it was helpful!
Really nice, useful videos. Thanks!
Glad you like them!