1 00:00:02,190 --> 00:00:04,890 So what influences performance? 2 00:00:04,890 --> 00:00:11,370 On one hand, there are things which you directly or indirectly control as a developer. You should write 3 00:00:11,370 --> 00:00:18,120 efficient queries or operations in general, so inserting, finding and so on, all of that should be done 4 00:00:18,120 --> 00:00:20,540 in a careful way that you only retrieve data 5 00:00:20,550 --> 00:00:27,260 you need, that you insert data in the right format with the right write concerns and so on. 6 00:00:27,270 --> 00:00:33,330 You should use indexes and either you have access to the database and you can create them on your own 7 00:00:33,690 --> 00:00:40,530 or you need to communicate with your database admin, so that you can ensure that for the queries your 8 00:00:40,530 --> 00:00:42,310 application does, 9 00:00:42,450 --> 00:00:47,160 you got the right indexes to support these queries to run efficiently. 10 00:00:47,160 --> 00:00:53,760 Of course a fitting data schema also is important. If you will always need to transform your data, either on 11 00:00:53,760 --> 00:00:59,280 the client side or when fetching it through the aggregation framework for example, 12 00:00:59,370 --> 00:01:05,520 if you need to do a lot of transformation for common queries there, then your data format as it is stored 13 00:01:05,520 --> 00:01:10,860 in your collections might not be optimal and you should of course try to reach a data schema in your 14 00:01:10,860 --> 00:01:15,570 database that fits your application or your use case needs. 15 00:01:15,570 --> 00:01:24,100 So this is a block of factors which you can influence as a developer and as a database admin. 16 00:01:24,120 --> 00:01:28,950 Now this course is for developers of course but still you should be aware of these things and talk to 17 00:01:28,950 --> 00:01:35,340 your admin for things like the indexes or for the data schema to make sure that you and your admin, you 18 00:01:35,340 --> 00:01:40,170 well work together to deliver the best possible application. 19 00:01:40,170 --> 00:01:44,920 Now there also is another part of performance and that is mainly the part 20 00:01:44,940 --> 00:01:50,940 I'll talk about in this module, the hardware and network on which you deploy your mongodb server 21 00:01:50,970 --> 00:01:52,390 and database matters. 22 00:01:52,480 --> 00:01:56,890 Sharding is an important concept and so are replica sets. 23 00:01:56,910 --> 00:02:01,250 Now I will explain what sharding and replica sets are in this module, 24 00:02:01,410 --> 00:02:06,950 they're basically about distributing data and the workload or the incoming requests 25 00:02:06,960 --> 00:02:09,340 but again, I will explain them in detail 26 00:02:09,900 --> 00:02:11,770 and these tasks here on the right, 27 00:02:11,780 --> 00:02:18,150 the orange tasks are not really tasks you as a developer need to be involved in too much. 28 00:02:18,150 --> 00:02:25,860 They are typical admin and system admin tasks, so we'll not dive too deep into that because these are 29 00:02:25,950 --> 00:02:33,320 very complex matters and complex matters for separate courses on administrating servers and databases 30 00:02:33,330 --> 00:02:34,550 if you want to 31 00:02:34,890 --> 00:02:37,040 and not really something you as a developer have to do. 32 00:02:37,080 --> 00:02:41,970 Still something you have to understand to understand the big picture of mongodb and what it's 33 00:02:41,970 --> 00:02:42,940 all about. 34 00:02:43,290 --> 00:02:49,830 So with that, let's dive into capped collections first which is a little bit more on the purple side 35 00:02:49,830 --> 00:02:56,220 of the slide but thereafter, I'll explain what sharding is, what replica sets are and how you can efficiently 36 00:02:56,220 --> 00:02:59,240 deploy your mongodb solution into the web.