1 00:00:00,060 --> 00:00:05,860 ‫So the first thing we're going to discuss is master back up replication, sometimes called master stand 2 00:00:05,910 --> 00:00:06,920 ‫by replication. 3 00:00:07,140 --> 00:00:15,240 ‫And the idea here is you have one leader digging a base node that accepts rights and except grill operations 4 00:00:15,240 --> 00:00:21,360 ‫such as create table or alternative database stuff that you change in the database, create a new database 5 00:00:21,360 --> 00:00:28,350 ‫right versus right, where you're inserting Neuros in a table or updating in your arrow or deleting 6 00:00:28,350 --> 00:00:28,650 ‫rows. 7 00:00:28,680 --> 00:00:29,910 ‫These are called DM's. 8 00:00:30,720 --> 00:00:40,590 ‫So you do all your rights in one master node and there will be a lot of read only stand by Oracle back 9 00:00:40,590 --> 00:00:45,330 ‫up nodes which will receive those rights from the master node. 10 00:00:46,500 --> 00:00:47,220 ‫So that's the idea. 11 00:00:47,250 --> 00:00:50,420 ‫You don't write to those notes yourself as a client. 12 00:00:50,430 --> 00:00:58,400 ‫You always write to the master and the master replicates the data to the standby notes the beautiful. 13 00:00:58,410 --> 00:01:04,380 ‫This is like it's very simple to implement because you don't have conflicts is as one node that takes 14 00:01:04,380 --> 00:01:10,890 ‫rights and that's at nobody else is going to to have rights as well. 15 00:01:10,890 --> 00:01:11,740 ‫Right in the same time. 16 00:01:12,870 --> 00:01:13,800 ‫So here's how it looks like. 17 00:01:13,810 --> 00:01:22,740 ‫So this is the red one is the master node and the green ones are the stand-by replica nodes. 18 00:01:23,070 --> 00:01:29,310 ‫And if I want to insert or update or even create a new table or even to create a database or do anything, 19 00:01:29,700 --> 00:01:40,230 ‫I always do it to the master of the red database instance and that the act of doing that will propagate 20 00:01:40,410 --> 00:01:48,300 ‫those right to the back and nodes because there is a TCP connection between the replica node and the 21 00:01:48,300 --> 00:01:54,140 ‫master node that is like full bidirectional ready with a specific database user as well. 22 00:01:54,450 --> 00:01:55,690 ‫And this is the same thing here. 23 00:01:55,770 --> 00:02:04,800 ‫So anything you do here, this master node will push it to the child nodes or they call stand by nodes. 24 00:02:04,860 --> 00:02:07,770 ‫And and so that's that's beautiful. 25 00:02:08,100 --> 00:02:11,040 ‫So you want to have questions like Hosain does. 26 00:02:11,070 --> 00:02:18,480 ‫Does the client have to wait for these changes to be pushed to the back end or does it immediately if 27 00:02:18,480 --> 00:02:19,770 ‫it's written to the master? 28 00:02:19,780 --> 00:02:22,410 ‫Can I just immediately get back at once? 29 00:02:22,410 --> 00:02:30,400 ‫It's written to the writer said, look, this is another kind of debate and discussion and people are 30 00:02:30,440 --> 00:02:32,430 ‫already doing PhDs. 31 00:02:32,430 --> 00:02:36,750 ‫And what is best this is called synchronous versus asynchronous one I'm going to talk about in the other 32 00:02:36,750 --> 00:02:36,990 ‫room. 33 00:02:37,530 --> 00:02:42,360 ‫So in master backup or application, the beauty of this, if you're doing a read, you can either do 34 00:02:42,360 --> 00:02:44,760 ‫a read against the master. 35 00:02:45,360 --> 00:02:50,730 ‫You're going to get the fresh Aldo's up to date data, but you can always read against the replicas 36 00:02:50,730 --> 00:02:51,920 ‫again, the standby data. 37 00:02:52,050 --> 00:02:53,940 ‫That's absolutely fine. 38 00:02:53,940 --> 00:02:56,490 ‫You can read against those, but you cannot try to those. 39 00:02:56,940 --> 00:03:01,560 ‫The beauty of this is like if this is in a region, a specific region in Asia and this is in a specific 40 00:03:01,560 --> 00:03:05,070 ‫region in Europe and this is in America, you can still do that. 41 00:03:05,640 --> 00:03:07,080 ‫Yeah, the propagation will take time. 42 00:03:07,080 --> 00:03:16,830 ‫But if you if you can take the hit on this consistency, the eventual consistency, and that's what 43 00:03:16,890 --> 00:03:17,790 ‫the model is. 44 00:03:18,420 --> 00:03:23,690 ‫Yes, relational database is half eventual consistency, not just no sequel. 45 00:03:23,940 --> 00:03:27,360 ‫This is a relational database model, yet it has eventual distances. 46 00:03:27,480 --> 00:03:33,330 ‫So those clients will see that that might see the updates a little bit later. 47 00:03:33,600 --> 00:03:35,580 ‫If you can live with that, that's fine. 48 00:03:35,730 --> 00:03:38,970 ‫If you don't, there are ways to solve those, obviously. 49 00:03:39,840 --> 00:03:41,670 ‫But that's the idea here. 50 00:03:41,670 --> 00:03:43,620 ‫So you can you can scale horizontally. 51 00:03:43,620 --> 00:03:44,850 ‫And that's a beautiful this.