Increase speed and durability with MySQL replication (2 easy ways)

  Рет қаралды 9,299

PlanetScale

PlanetScale

Күн бұрын

To learn more about PlanetScale, head to planetscale.co...!
💬 Follow PlanetScale on social media
• Twitter: / planetscale
• Discord: / discord
• TikTok: / planetscale
• Twitch: / planetscale
• LinkedIn: / planetscale

Пікірлер: 31
@ahmad-murery
@ahmad-murery 7 ай бұрын
Although PlanetScale makes it easy to create replicas, but I liked the way you explained the steps of creating replicas the hard way. Thanks!
@PlanetScale
@PlanetScale 7 ай бұрын
Adding value to your day!
@ahmad-murery
@ahmad-murery 7 ай бұрын
@@PlanetScaleI learned something new👍
@YandiBanyu
@YandiBanyu 7 ай бұрын
Hey, just a heads up when editing a file as sudo, you should prefer to use sudoedit rather than directly sudo-ing the editor.
@SebastianMares
@SebastianMares 7 ай бұрын
Why?
@YandiBanyu
@YandiBanyu 7 ай бұрын
@@SebastianMares Well, basically it differs in behaviour. `sudo vim` means you are opening vim the editor program with elevated privilege. It's usually fine, but if the editor did something it shouldn't do then it would be a problem (say, you mistype a command in VIM) since it has elevated privilege now. But sudoedit (its actually alias for sudo -e) tells sudo that you want to edit a file. sudo then will do the procedure to safely do that for you like making a temporary copy of the file, opening the editor that the user specified (IIRC from EDITOR env var), moving those temporary file after finished editing, and this is the most important part, making sure that the editor is not running using elevated privilege. If you want to do that, then sure, do `sudo vim`, but if you just wanted to edit a file, sudo -e (or sudoedit) is usually a good practice.
@SebastianMares
@SebastianMares 7 ай бұрын
@@YandiBanyu I wasn't aware of that, I thought sudoedit would simply open the default editor with super-user rights and I always found it inconvenient when the default editor is nano for example and I wanted to use vim. But true, I just tried to do an apt update from within an editor opened via sudoedit, and it complained that it doesn't have the rights to lock the files. Thanks for the suggestion and the explanation!
@PlanetScale
@PlanetScale 7 ай бұрын
@@YandiBanyu Good safety tip! 💪
@annahri
@annahri 7 ай бұрын
Plus it will use your file editor configurations not the root configuration s. E.g. you've configured vim, and it will use it.
@gempir
@gempir 7 ай бұрын
Really, good video. Would love some more details and nuances of replication. Like GTID based replication, how to handle delay, how to reset a replication etc. I assume Planetscale has extensive knowledge on those topics ;)
@PlanetScale
@PlanetScale 7 ай бұрын
We have a few blog posts on replication, links below! planetscale.com/blog/what-is-mysql-replication-and-when-should-you-use-it planetscale.com/blog/mysql-replication-best-practices-and-considerations planetscale.com/blog/mysql-semi-sync-replication-durability-consistency-and-split-brains Of course, you should also check out the MySQL docs.
@TheGreenOrc
@TheGreenOrc 7 ай бұрын
You don't need to enable binary logs in the replica, will use storage space for nothing. Also the most important part it's to take one consistent master/primary snapshot/dump with the binary log position.
@samifouad
@samifouad 7 ай бұрын
great video. would love to see a video like this about running multiple masters!
@PlanetScale
@PlanetScale 7 ай бұрын
We're going to be releasing a course on scaling databases on our website, which will include concepts like vertical and horizontal sharding (which implies multiple primaries). If that sounds interesting to you, sign up here! planetscale.com/scale
@spamviking8591
@spamviking8591 7 ай бұрын
You don't have to tediously set up the log file and position like that. When you take a mysqldump of the master, just pass the --master-data=1 flag and that information will be saved to the .sql file and when you run source [dump.sql] on the slave, those parameters will already be set.
@PlanetScale
@PlanetScale 7 ай бұрын
Good tip! In this video we didn't show taking a dump, but if you're setting up replication for an existing database this is a great idea.
@spamviking8591
@spamviking8591 7 ай бұрын
@@PlanetScale “Taking a Dump” heh… I’m a child.
@PlanetScale
@PlanetScale 7 ай бұрын
@@spamviking8591 🤣
@otmanm4095
@otmanm4095 7 ай бұрын
Great video !
@ahmedhdeawy
@ahmedhdeawy 2 ай бұрын
Thanks a lot. very useful.
@PlanetScale
@PlanetScale 2 ай бұрын
Glad to help 🤜
@badpussycat
@badpussycat 7 ай бұрын
if you use the GRANT commands you don't need to FLUSH PRIVILEGES. You need this only if you update the privileges tables directly!
@novo77777
@novo77777 Ай бұрын
How to monitor the replication and ensure the data be consistent, thank you.
@robertstarz
@robertstarz Ай бұрын
THANK YOU SO MUCH for this easy to understand explanation. You helped me make my first replication of my server. I have been manually backup up my database each day. This makes life so much easier. Now that I have done this and have 2 raspberry pi at my business sync I am thinking I should have a remote one at home just in case of fire or other catastrophies as I am in floriday. I know the static IP address of my business but how do I set the Master Host ip address for this? I am assuming a port number? I appreciate any incite. Thanks again for the video.
@PlanetScale
@PlanetScale Ай бұрын
Glad you found it valuable. For the scenario you described, it depends on how things are configured. Does your primary server have a static + public IP address? If so that would make it simpler. If not, you might need to set up some kind of DNS-based solution.
@marcobaldi138
@marcobaldi138 7 ай бұрын
Hey great video, great channel! But I am sad that the hobby plan was removed from my country. It was going to be used for a test run on my company, thanks to my recommendation, but now the cheapest plan is kind of expensive for this purpose. Can't you guys just make like a hobby plan just with the price to cover the costs for the countries you removed it?
@PlanetScale
@PlanetScale 7 ай бұрын
If you're interested in trialing PlanetScale for business purposes, I recommend you reach out to our sales team! planetscale.com/contact
@kchaitanya39
@kchaitanya39 7 ай бұрын
Where is aaron
@gnatinator
@gnatinator 6 ай бұрын
died
@SuperRockmate
@SuperRockmate 7 ай бұрын
The fact that you sell it and show how we can do it ourself first massive respect we salute you 🫡🫡
Faster than a regular database index
13:39
PlanetScale
Рет қаралды 20 М.
Easy database indexing strategies
36:03
PlanetScale
Рет қаралды 25 М.
Самое неинтересное видео
00:32
Miracle
Рет қаралды 2,8 МЛН
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 6 МЛН
Как мы играем в игры 😂
00:20
МЯТНАЯ ФАНТА
Рет қаралды 3 МЛН
Is Computer Science still worth it?
20:08
NeetCodeIO
Рет қаралды 261 М.
Microservices with Databases can be challenging...
20:52
Software Developer Diaries
Рет қаралды 41 М.
I loaded 100,000,000 rows into MySQL (fast)
18:27
PlanetScale
Рет қаралды 178 М.
Working with time series data in MySQL
20:35
PlanetScale
Рет қаралды 21 М.
Are You Accidentally Crippling Your EF Core Queries?
17:18
Milan Jovanović
Рет қаралды 24 М.
Postgres just got even faster
26:42
Hussein Nasser
Рет қаралды 28 М.
UUID vs INT: What’s Better For Your Primary Key?
9:40
Database Star
Рет қаралды 38 М.
Don't hide your database indexes!
11:35
PlanetScale
Рет қаралды 12 М.