WEBVTT 00:04.100 --> 00:09.950 Let's suppose that there is topic A with multiple partitions and all partitions are spread among different 00:09.950 --> 00:13.430 brokers and every politician has already some messages. 00:13.940 --> 00:20.810 When a specific producer connects to coffeecake and wants to produce messages, it can write the messages 00:20.810 --> 00:22.210 to different politicians. 00:22.430 --> 00:28.040 And on this diagram, you see that producer Rieth message of said no to to partition zero. 00:28.370 --> 00:31.940 Then it Riot's message with offset number one to partition one. 00:32.060 --> 00:36.670 And it writes one more message with offset number two to partition two. 00:36.860 --> 00:38.540 And that's pretty acceptable. 00:38.720 --> 00:44.810 Every producer may produce messages to different partitions of specific topic. 00:45.320 --> 00:51.890 Also, you can setup it in such a way that it will write only to specific partition in case if you will 00:51.890 --> 00:57.770 use key with all the messages and usually all messages with the same key will be read on to the same 00:57.770 --> 00:58.450 partition. 00:58.760 --> 01:05.000 But if you don't supply this key, then messages will be spread in a round robin fashion across all 01:05.000 --> 01:06.860 partitions in specific topic. 01:07.280 --> 01:14.990 But main idea here is that new messages will be added only after existing messages. 01:15.140 --> 01:20.690 And for example, if producer will produce one more message to partition one, then this message will 01:20.690 --> 01:23.390 get offset number two and so on. 01:24.080 --> 01:30.950 Existing messages with the numbers are zero and one are immutable, and producer and producer is not 01:30.950 --> 01:34.000 able somehow to change those messages. 01:34.010 --> 01:35.360 They are again immutable. 01:35.690 --> 01:42.440 Does the main idea behind creation of messages inside of every partition and again notice that every 01:42.470 --> 01:49.530 partition must have a unique offset numbers of all messages and first of that number is zero. 01:49.700 --> 01:53.840 So in partition zero three message has of set number zero and so on. 01:54.650 --> 01:58.490 This idea behind the writing messages to different partitions. 01:58.820 --> 02:04.820 And of course, you may have multiple producers that will write messages to the same topic, to the 02:04.820 --> 02:06.830 same partitions in parallel. 02:07.070 --> 02:08.000 OK, let's not proceed. 02:08.000 --> 02:14.690 And next, let's review how consumers may consume messages from a specific topic of context by.