diff --git a/Week7_Case_Studies/Spanish_es/03-Interview_with_Ryan_Bubunksi_codecademy-Lecture.srt b/Week7_Case_Studies/Spanish_es/03-Interview_with_Ryan_Bubunksi_codecademy-Lecture.srt index 3ec1eb6..b237159 100644 --- a/Week7_Case_Studies/Spanish_es/03-Interview_with_Ryan_Bubunksi_codecademy-Lecture.srt +++ b/Week7_Case_Studies/Spanish_es/03-Interview_with_Ryan_Bubunksi_codecademy-Lecture.srt @@ -3,12 +3,12 @@ 2 00:00:00,630 --> 00:00:02,230 -Welcome back to M101. +Bienvenido de regreso a M101. 3 00:00:02,230 --> 00:00:05,170 -I'm here with Ryan Bubinski, -the Technical Co-Founder of +Estoy acá con Ryan Bubinski +cofundador técnico de 4 00:00:05,170 --> 00:00:06,330 @@ -16,1557 +16,1548 @@ Codecademy. 5 00:00:06,330 --> 00:00:08,710 -And he's going to talk -to us today about +Está con nosotros hoy +para hablar sobre su 6 00:00:08,710 --> 00:00:10,220 -their use of MongoDB. +uso de MongoDB. 7 00:00:10,220 --> 00:00:12,260 -So thanks for coming -here, Ryan. +Gracias por venir, Ryan. 8 00:00:12,260 --> 00:00:12,750 -Thank you, Andrew. +Gracias, Andrew. 9 00:00:12,750 --> 00:00:14,192 -It's my pleasure. +Es un placer. 10 00:00:14,192 --> 00:00:14,860 -All right. +Muy bien. 11 00:00:14,860 --> 00:00:16,950 -So tell me first, describe -what Codecademy +Primero cuéntanos un poco +sobre lo que Codecademy 12 00:00:16,950 --> 00:00:18,890 -does for the audience. +hace. 13 00:00:18,890 --> 00:00:20,840 -A lot of them are from -Eastern Europe, so +Muchos de nuestros oyentes +son de Europa Oriental así 14 00:00:20,840 --> 00:00:23,040 -maybe some don't know. +que quizás algunos +no lo conocen. 15 00:00:23,040 --> 00:00:23,780 -Certainly. +Por supuesto. 16 00:00:23,780 --> 00:00:27,660 -So Codecademy is the easiest way -to learn to code online, a +Codecademy es la manera más fácil +de aprender a desarrollar en línea. 17 00:00:27,660 --> 00:00:30,240 -series of interactive courses, -tutorials, that take a +Contiene un serie de cursos +interactivos, tutoriales, tanto 18 00:00:30,240 --> 00:00:33,020 -complete beginner to someone -who's competent and literate +para principiantes como para +alguien competente y conocedor 19 00:00:33,020 --> 00:00:35,880 -in technologies of programming -and coding. +de tecnologías de +programación y desarrollo. 20 00:00:35,880 --> 00:00:36,650 -All right. +Muy bien. 21 00:00:36,650 --> 00:00:38,180 -And it's a little bit different -than the way we're +Y es algo diferente a +la manera en que hemos 22 00:00:38,180 --> 00:00:41,040 -structuring this course, because -rather than video +estructurado este curso, +porque en lugar de segmentos 23 00:00:41,040 --> 00:00:43,476 -segments followed by these -little quizzes, it's more of +de vídeo seguidos por pequeños +cuestionarios, es más un 24 00:00:43,476 --> 00:00:46,650 -an interactive system where -you'll read a little bit and +sistema interactivo +donde lees un poco 25 00:00:46,650 --> 00:00:51,090 -then you'll do a hand-on task -which lets you show mastery +y luego haces una tarea que te +permita mostrar inmediatamente 26 00:00:51,090 --> 00:00:53,620 -immediately of what you're -trying to accomplish, right? +que tienes la habilidad de +hacer lo que aprendiste. ¿No? 27 00:00:53,620 --> 00:00:53,860 -Yeah. +Sí. 28 00:00:53,860 --> 00:00:54,360 -That's right. +Es correcto. 29 00:00:54,360 --> 00:00:57,230 -So we favor a learn-by-doing -approach. +Nosotros optamos por el método +de aprender haciendo. 30 00:00:57,230 --> 00:01:00,830 -So we try to get our students -coding as early as possible, +Así que tratamos que nuestros +estudiantes empiecen a escribir 31 00:01:00,830 --> 00:01:04,170 -and start to teach them as there -actually performing or +código lo más rápido posible y +les explicamos qué está ocurriendo 32 00:01:04,170 --> 00:01:06,950 -coding what's going on what and -they're doing, and showing +mientras que desarrollan, +mostrándoles cómo pueden 33 00:01:06,950 --> 00:01:10,310 -them how they can apply -programming to build projects, +aplicar la programación para +crear proyectos, páginas 34 00:01:10,310 --> 00:01:14,140 -to build websites and -applications, and to really do +web y aplicaciones y en +verdad para hacer lo que 35 00:01:14,140 --> 00:01:16,420 -whatever it is they want -to do with programming. +sea que quieran hacer +con la programación. 36 00:01:16,420 --> 00:01:19,830 -And some of the first tracks you -did was in JavaScript, is +Y algunas de los primeros cursos que +ofrecieron fueron en JavaScript, 37 00:01:19,830 --> 00:01:20,460 -that right? +¿no? 38 00:01:20,460 --> 00:01:22,200 -Our first track was -in JavaScript. +Nuestro primer curso +fue en JavaScript. 39 00:01:22,200 --> 00:01:23,190 -So it's completely web-based. +Así que es basado +completamente en la web. 40 00:01:23,190 --> 00:01:24,790 -It's within the browser. +Todo dentro del navegador. 41 00:01:24,790 --> 00:01:28,460 -And so JavaScript is pretty much -the language of the web, +Y como JavaScript es el +lenguaje de la web, también 42 00:01:28,460 --> 00:01:31,250 -and it's also the language -of browsers. +es el lenguaje de +los navegadores. 43 00:01:31,250 --> 00:01:35,760 -And we wanted to start with -something that was immediately +Queríamos comenzar con algo +que era inmediatamente 44 00:01:35,760 --> 00:01:38,300 -accessible to as many people as -possible, and would allow +accesible para la mayoría de +la gente y que les permita 45 00:01:38,300 --> 00:01:41,360 -them to immediately start -creating interesting web +comenzar inmediatamente a +crear aplicaciones web 46 00:01:41,360 --> 00:01:42,000 -applications. +interesantes. 47 00:01:42,000 --> 00:01:44,160 -And for us, that -was JavaScript. +Para nosotros, tenía +que ser JavaScript. 48 00:01:44,160 --> 00:01:46,020 -And it's been pretty -popular, right? +Y ha sido bien popular, ¿no? 49 00:01:46,020 --> 00:01:48,865 -You've had millions of people -who have done the stuff and +¿Y han tenido millones de personas +que han hecho las lecciones y 50 00:01:48,865 --> 00:01:51,410 -gone through and taken -some of these tracks? +seguido adelente y +tomado los cursos? 51 00:01:51,410 --> 00:01:51,680 -Yeah. +Sí. 52 00:01:51,680 --> 00:01:54,240 -I think our approach has -resonated with a very large +Creo que nuestro método ha +sido bien recibido por un 53 00:01:54,240 --> 00:01:57,670 -number of people all over the -world with a wide variety of +gran número de personas alrededor +del mundo, con una gran variedad de 54 00:01:57,670 --> 00:02:02,320 -interests, and I think we've, -fortunately, introduced to a +intereses y creo que hemos, +afortunadamente, introducido 55 00:02:02,320 --> 00:02:04,130 -large number of people, who -wouldn't otherwise be +a la programación a mucha +gente que de lo contrario 56 00:02:04,130 --> 00:02:07,000 -interested in programming or -who otherwise wouldn't have +nunca hubiesen estado interesados +en la programación o no se hubiesen 57 00:02:07,000 --> 00:02:08,789 -gotten involved with -programming, we've gotten them +involucrado con la programación. +Hemos logrado que estén interesados 58 00:02:08,789 --> 00:02:12,440 -interested in the craft, and -we're starting to make code +en esta arte y hemos +logrado que código 59 00:02:12,440 --> 00:02:15,090 -normal, which is what -we want to do. +sea algo normal, lo cual +es lo que queremos hacer. 60 00:02:15,090 --> 00:02:16,360 -It's very cool. +Es bastante interesante. 61 00:02:16,360 --> 00:02:19,650 -So you started with MongoDB. +Así que comenzaron con MongoDB. 62 00:02:19,650 --> 00:02:21,380 -So how'd you decide -you use MongoDB? +¿Cómo así decidieron usar MongoDB? 63 00:02:21,380 --> 00:02:23,490 -What were some of the thing that -were interesting about it +¿Qué cosas de MongoDB +les pareció interesantes 64 00:02:23,490 --> 00:02:24,870 -to you guys? +a ustedes? 65 00:02:24,870 --> 00:02:25,370 -Sure. +Claro. 66 00:02:25,370 --> 00:02:28,050 -So there's a long story. +Ésa es una larga historia. 67 00:02:28,050 --> 00:02:30,030 -I think we'll get into -some of the details. +Entraremos en algunos +de los detalles, pero 68 00:02:30,030 --> 00:02:35,390 -But the short version of it is -when we were first setting +la versión corta es que +cuando recién estábamos 69 00:02:35,390 --> 00:02:38,280 -out, Zach and I, my co-founder, -we were +comenzando, Zach y yo, +mi cofundador, estábamos 70 00:02:38,280 --> 00:02:40,430 -prototyping different versions -of the site. +haciendo prototipos de +diferentes versiones del sitio. 71 00:02:40,430 --> 00:02:44,150 -We were working through -different ways of creating an +Estábamos analizando las +diferentes maneras en las que 72 00:02:44,150 --> 00:02:47,450 -interactive online platform, and -we were quickly changing +podíamos crear una plataforma +interactiva en línea y frecuentemente 73 00:02:47,450 --> 00:02:49,870 -our model definitions, quickly -changing our schema, +cambiábamos las definiciones de +nuestro modelo, de nuestro esquema, 74 00:02:49,870 --> 00:02:51,830 -definitions and the relations, -and models. +las definiciones y las +relaciones y los modelos. 75 00:02:51,830 --> 00:02:55,610 -And we wanted a data store that -was very flexible and +Y queríamos un almacén de datos +que sea muy flexible y que no 76 00:02:55,610 --> 00:02:59,080 -that wouldn't slow us down -as we were making these +nos detenga cuando +hagamos estos cambios de 77 00:02:59,080 --> 00:03:00,520 -definition changes. +de definiciones. 78 00:03:00,520 --> 00:03:03,460 -And I actually wasn't -familiar with Mongo. +Yo en verdad no conocía +mucho sobre Mongo. 79 00:03:03,460 --> 00:03:07,850 -I was a relational database -guy for many years before. +Por muchos años antes fui un +hombre de base de datos relacional 80 00:03:07,850 --> 00:03:12,930 -And I saw Mongo as this -fantastic technology that +Y consideré Mongo como esta +tecnología fantástica que nos 81 00:03:12,930 --> 00:03:16,800 -would allow us to not worry -about the schema up front-- +permitiría no preocuparnos +sobre esquema a priori-- 82 00:03:16,800 --> 00:03:18,860 -or at least until we needed -to start thinking +o por lo menos hasta +que en verdad pensemos 83 00:03:18,860 --> 00:03:20,860 -seriously at scale. +seriamente sobre escalar. 84 00:03:20,860 --> 00:03:24,000 -And so for us, MongoDB was the -easiest way to rapidly +Entonces para nosotros, MongoDB +era la manera más rápida de 85 00:03:24,000 --> 00:03:27,430 -prototype different -models and their +hacer prototipos de +diferentes modelos y sus 86 00:03:27,430 --> 00:03:29,280 -relations one way or another. +relaciones de una manera u otra. 87 00:03:29,280 --> 00:03:33,140 -And I felt like that very -significantly sped up +Y sentí que eso aceleraba +significativamente el 88 00:03:33,140 --> 00:03:34,750 -development for us. +desarrollo para nosotros. 89 00:03:34,750 --> 00:03:38,310 -So did you have any concerns -going into it? +¿Tuviste algunas preocupaciones +cuando empezaste a usar Mongo? 90 00:03:38,310 --> 00:03:39,555 -If you come from the world of -relational, what would you be +Si vienes del mundo +relacional, ¿qué sería 91 00:03:39,555 --> 00:03:41,180 -most worried about? +lo que más te preocuparía? 92 00:03:41,180 --> 00:03:44,710 -Naturally doing joins across -different models and different +Naturalmente, hacer joins +a través de diferentes modelos 93 00:03:44,710 --> 00:03:48,390 -tables, or in the case of -MongoDB, collections. +y diferentes tablas, o en el +caso de MongoDB, colecciones. 94 00:03:48,390 --> 00:03:54,350 -I think in the world of -relational databases, your +Yo creo que en el mundo de +bases de datos relacionales, 95 00:03:54,350 --> 00:03:57,280 -intuition or your gut is -always telling you to +tu intuición o tu instinto +siempre te dice que 96 00:03:57,280 --> 00:04:01,440 -normalize, normalize, normalize, -and in a document +normalices, normalices, normalices, +y en almacenes de documentos o 97 00:04:01,440 --> 00:04:05,760 -or key values store, you need to -denormalize sometimes, and +de clave/valor, tienes que +de-normalizar a veces y 98 00:04:05,760 --> 00:04:07,030 -sometimes that doesn't -feel right. +a veces eso no te +parece que está bien. 99 00:04:07,030 --> 00:04:11,530 -But in many cases, you can find -a very happy balance or +Pero en muchos casos, puedes encontrar +un balance óptimo donde obtienes lo 100 00:04:11,530 --> 00:04:15,280 -best of both worlds that is so -much easier to deal with. +lo mejor de los dos mundos, lo cual +lo hace mucho más fácil de manejar. 101 00:04:15,280 --> 00:04:18,079 -Yeah. +Sí. 102 00:04:18,079 --> 00:04:21,820 -What is your implementation -language for Codecademy? +¿Cuál es su lenguaje de +implementación para Codecademy? 103 00:04:21,820 --> 00:04:22,120 -Sure. +Claro. 104 00:04:22,120 --> 00:04:25,770 -So Codecademy is primarily -built on top of Ruby for +Codecademy está construido +principalmente sobre Ruby 105 00:04:25,770 --> 00:04:29,250 -anything server side and -JavaScript for some of the +para cualquier cosa del lado +del servidor y JavaScript para 106 00:04:29,250 --> 00:04:31,330 -server-side logic -and all of the +algo de lógica del lado +del servidor y toda la 107 00:04:31,330 --> 00:04:32,780 -client-side logic, of course. +lógica del lado de +cliente, por supuesto. 108 00:04:32,780 --> 00:04:37,720 -And we have multiple layers -outside of MongoDB. +Y tenemos múltiples capas +afuera de MongoDB. 109 00:04:37,720 --> 00:04:40,090 -Our API layer is implemented -in Ruby. +Nuestra capa de API está +implementada en Ruby. 110 00:04:40,090 --> 00:04:42,290 -Our application layer is -implemented in Ruby and +Nuestra capa de aplicación +está implementada en Ruby y 111 00:04:42,290 --> 00:04:43,140 -JavaScript. +en JavaScript. 112 00:04:43,140 --> 00:04:46,920 -And we have a series of -independent JavaScript +Y tenemos una serie de +aplicaciones JavaScript 113 00:04:46,920 --> 00:04:51,210 -applications that power the web -client or the actual web +independientes que corren el +cliente web o la aplicación 114 00:04:51,210 --> 00:04:54,080 -application that most people -know of as Codecademy. +web en sí que mucha gente +conoce como Codecademy. 115 00:04:54,080 --> 00:04:55,120 -I see. +Comprendo. 116 00:04:55,120 --> 00:04:58,150 -And do you use our drivers -directly or something +¿Y usan nuestros drivers +directamente o algo 117 00:04:58,150 --> 00:04:59,420 -intermediary, like some mapping +intermediario, como alguna 118 00:04:59,420 --> 00:05:01,450 -layer to talk to MongoDB? +capa de relación que +se comunica con MongoDB? 119 00:05:01,450 --> 00:05:09,800 -So for our API that wraps our -data layer, we use a object +Para nuestra API que envuelve +nuestro capa de datos, usamos 120 00:05:09,800 --> 00:05:14,290 -document mapper called Mongoid, -which uses their own +un cartógrafo de documento a +objecto (ODM) llamado Mongoid, 121 00:05:14,290 --> 00:05:18,270 -version of a MongoDB driver -that directly communicates +usa su propia versión de un driver que +de MongoDB que se comunica directamente 122 00:05:18,270 --> 00:05:19,140 -with our database. +con nuestra base de datos. 123 00:05:19,140 --> 00:05:22,440 -And we've experimented with -using the driver directly. +Y hemos experimentado con +usar el driver directamente. 124 00:05:22,440 --> 00:05:25,830 -In some cases, we do-- if we -want a very particular type of +En algunos casos lo usamos, +si queremos que un "insert" o 125 00:05:25,830 --> 00:05:29,890 -insert or update and we want -to go directly to the data +"update" muy particular +vaya directo al almacen 126 00:05:29,890 --> 00:05:31,680 -store and move on. +de datos y siga adelante. 127 00:05:31,680 --> 00:05:37,630 -But for most development using -an ODM is a nice way of +Pero para la mayoría de desarrollo +usar un ODM es una buena manera de 128 00:05:37,630 --> 00:05:41,470 -encapsulating that logic and of -focusing at a higher level +encapsular la lógica y enfocarse +desde un nivel más alto en cómo 129 00:05:41,470 --> 00:05:45,560 -on how the model's structured, -how it relates to other +está estructurado el modelo, +cómo se relaciona a los otros 130 00:05:45,560 --> 00:05:48,390 -models, and that allows us -to kind of more easily +modelos, y eso nos permite +conceptualizar más fácilmente 131 00:05:48,390 --> 00:05:52,740 -conceptualize how we're laying -out the data layer. +cómo estamos diseñando +la capa de datos. 132 00:05:52,740 --> 00:05:56,910 -So except in the rare cases -where we need to optimize +Así que excepto en lo casos +excepcionales donde tenemos que 133 00:05:56,910 --> 00:06:00,700 -performance or a particular -use case, we use an ODM. +optimizar el rendimiento o en un caso +de uso en particular, usamos un ODM. 134 00:06:00,700 --> 00:06:00,920 -Yeah. +Claro. 135 00:06:00,920 --> 00:06:02,010 -So that's my question. +Esa es mi pregunta. 136 00:06:02,010 --> 00:06:05,610 -With these mapping layers, -sometimes it puts a developer +Estas capas de relación, a veces +lo que hacen es hacer que el 137 00:06:05,610 --> 00:06:08,750 -a little bit further away -from the schema. +desarrollador esté un poco +más lejos del esquema. 138 00:06:08,750 --> 00:06:11,990 -And getting the performance on -any database backed system is +Y para obtener buen rendimiento en +cualquier sistema con base de datos 139 00:06:11,990 --> 00:06:13,430 -about making sure you -hit the indexes. +hay que asegurarse que +estés usando los índices. 140 00:06:13,430 --> 00:06:14,100 -Yep. +Sí. 141 00:06:14,100 --> 00:06:16,590 -So is it a problem-- +¿Es un problema? 142 00:06:16,590 --> 00:06:18,450 -and maybe if you have a small -team, it's a big issue-- but +Tal vez si tienes un equipo +pequeño es un gran problema, 143 00:06:18,450 --> 00:06:21,750 -to have everyone be cognizant -of how to write code that's +pero hacer que todos sepan +cómo escribir código que va 144 00:06:21,750 --> 00:06:23,190 -going to hit the indexes -if you're using this +a utilizar los índices +si estás usando esta capa 145 00:06:23,190 --> 00:06:24,780 -mapping layer or-- +de relación o, 146 00:06:24,780 --> 00:06:26,970 -what are the benefits, what are -the pros and cons of that? +¿cuáles son los beneficios? ¿Cuáles +son los pros y los contras de eso? 147 00:06:26,970 --> 00:06:27,390 -Yeah. +Sí. 148 00:06:27,390 --> 00:06:30,240 -I think when you're choosing -whether or not to use the +Creo que cuando estás escogiendo +si es que vas a usar el driver o 149 00:06:30,240 --> 00:06:35,070 -driver or an ODM, so you need -to be cognizant of how many +un ODM, entonces tienes que +considerar cuántos desarrolladores 150 00:06:35,070 --> 00:06:36,730 -developers there are, -like you mentioned. +hay, como mencionaste. 151 00:06:36,730 --> 00:06:39,235 -How familiar the developers -are with your data store. +Qué tan familiarizados están +con tu almacén de datos. 152 00:06:39,235 --> 00:06:42,170 153 00:06:42,170 --> 00:06:45,510 -Some of the pros of an ODM, -of course, are logical +Algunos de los pros de un ODM +son, por supuesto, encapsulación 154 00:06:45,510 --> 00:06:47,700 -encapsulation. +de la lógica. 155 00:06:47,700 --> 00:06:50,890 -Specific to the Rails -framework-- which we don't use +En particular para la infraestructura +Rails--la cual no usamos para la API 156 00:06:50,890 --> 00:06:53,890 -for an API, but we use for -an application layer-- +pero si para la capa +de la aplicación-- 157 00:06:53,890 --> 00:06:57,740 -our API is essentially -a Rack application. +nuestra API es esencialmente +una aplicación Rack. 158 00:06:57,740 --> 00:07:00,210 -And so there's very little -convention on top of what +Entonces hay muy poca +convención sobre lo que 159 00:07:00,210 --> 00:07:00,720 -you're building. +estás construyendo. 160 00:07:00,720 --> 00:07:00,930 -Rack? +¿Rack? 161 00:07:00,930 --> 00:07:05,870 -Rack is a HTTP API, -essentially. +Rack es esencialmente una API HTTP. 162 00:07:05,870 --> 00:07:10,740 -It's a bare bones framework on -top of Ruby that gives you a +Es una infraestructura básica +sobre Ruby que te da una buena 163 00:07:10,740 --> 00:07:16,630 -nice interface for handling HTTP -requests and responses. +interfaz para manejar peticiones +y respuestas HTTP. 164 00:07:16,630 --> 00:07:22,090 -So it's basically what -powers the web server +Es básicamente lo que +maneja la interfaz del 165 00:07:22,090 --> 00:07:23,410 -interface for Rails. +servidor web de Rails. 166 00:07:23,410 --> 00:07:27,200 -Rails sit's on top of -Rack as a framework. +Rails va sobre Rack +como infraestructura. 167 00:07:27,200 --> 00:07:30,480 -So Rails is a framework -on a framework. +Así que Rails es una +infraestructura sobre otra. 168 00:07:30,480 --> 00:07:33,690 -And Rails has a lot of stuff -that you don't necessarily +Y Rails tiene muchas cosas +que no necesariamente quieres 169 00:07:33,690 --> 00:07:37,300 -want in an API, but you do you -want in a web application. +en una API, pero sí en +una aplicación web. 170 00:07:37,300 --> 00:07:40,950 -And so in an API where you're -optimizing on response time +Entonces en una API, donde quiere +optimizar tiempo de respuesta y 171 00:07:40,950 --> 00:07:46,010 -and availability, you want to -go as far down to the web +disponibilidad, vas a querer +llegar al nivel del servidor 172 00:07:46,010 --> 00:07:50,790 -server level-- meaning, like -in our case, we use Nginx-- +web--es decir, en nuestro +caso usamos Nginx-- 173 00:07:50,790 --> 00:07:52,720 -you want to go as far -down to the request +quieres llegar al +ciclo de petición 174 00:07:52,720 --> 00:07:54,460 -response cycle as possible. +respuesta lo más rápido posible. 175 00:07:54,460 --> 00:07:55,810 -Just like you're talking about -sometimes when you're +Así como tú mencionas que +a veces cuando estás 176 00:07:55,810 --> 00:07:57,540 -optimizing for your data layer, -you want to get as +optimizando para tu capa +de datos, quiere estar 177 00:07:57,540 --> 00:08:00,710 -close to the data store -as possible. +lo más cerca posible +del almacén de datos. 178 00:08:00,710 --> 00:08:06,100 -So to go back, in something like -a Rails framework or a +Así que para reiterar, algo como +la infraestructura Rails o una 179 00:08:06,100 --> 00:08:08,243 -web development framework, you -do want to encapsulate a lot +infraestructura de desarrollo web, +vas a querer encapsular mucho de 180 00:08:08,243 --> 00:08:08,660 -of that logic. +esa lógica. 181 00:08:08,660 --> 00:08:11,370 -And you're optimizing for a -higher level structure. +Y quieres optimizar a un nivel +de estructura más alto. 182 00:08:11,370 --> 00:08:13,330 -You want to make sure that your -documents have the fields +Quieres asegurarte que los +documentos tengan lo campos 183 00:08:13,330 --> 00:08:15,890 -that they need, that the -relations are properly set up. +que necesitan y que las +relaciones están bien hechas. 184 00:08:15,890 --> 00:08:20,030 -And sometimes if you're dealings -exclusively with a +Y a veces, si estás lidiando +exclusivamente con un driver, 185 00:08:20,030 --> 00:08:23,690 -driver, handling properties of -models, handlings relations +el manejar propiedades de +modelos, el manejar modelos 186 00:08:23,690 --> 00:08:27,140 -models can get cumbersome. +de relaciones puede ser tedioso. 187 00:08:27,140 --> 00:08:29,790 -When you're rapidly developing -and things are quickly +Cuando estás desarrollando rápido +y las cosas evolucionan rápido, 188 00:08:29,790 --> 00:08:34,289 -evolving, when your structure -starts to converge and you +cuando tu estructura comienza +a convergir y quieres comenzar 189 00:08:34,289 --> 00:08:37,710 -want to start optimizing and you -start to have to consider +a optimizar y comienzas a +considerar los tiempos de 190 00:08:37,710 --> 00:08:40,630 -query times, write times, and -you start to get significant +consultas, escrituras y +comienzas a tener una carga 191 00:08:40,630 --> 00:08:45,000 -load that really tests your data -layer, that's when you +significativa que en verdad presiona +tu capa de datos, ahí es cuando 192 00:08:45,000 --> 00:08:49,230 -need to start, as a team, of -course, focusing on what +tienes que comenzar, como equipo +por supuesto, a enfocarte en el 193 00:08:49,230 --> 00:08:50,645 -percent of the time are you -hitting your indexes? +porcentaje del uso de los índices. 194 00:08:50,645 --> 00:08:50,990 -Right. +Claro. 195 00:08:50,990 --> 00:08:52,910 -If you're not hitting your -indexes, how large is the +Si no estás dándole a los +índices, ¿qué tan grande 196 00:08:52,910 --> 00:08:53,770 -collection? +es la colección? 197 00:08:53,770 --> 00:08:55,500 -Is there a serious performance -issue? +¿Hay un problema +serio de rendimiento? 198 00:08:55,500 --> 00:08:57,130 -And then you just start -benchmarking. +Y luego comenzar a +evaluar por comparación 199 00:08:57,130 --> 00:09:01,540 -So we have opted to make sure -that everyone on the team is +Así que hemos optado por asegurarnos que +todos en el equipo estén familiarizados, 200 00:09:01,540 --> 00:09:04,690 -familiar, of course, with the -entire stack, that people are +por supuesto, con la pila completa. +Que la gente esté familiarizada con 201 00:09:04,690 --> 00:09:06,575 -familiar with the drivers -that we use. +los drivers que usamos. 202 00:09:06,575 --> 00:09:09,770 -Not everyone directly uses the -driver, especially if you're a +No todos trabajan directamente +con el driver, especialmente si 203 00:09:09,770 --> 00:09:11,760 -front-end engineer who's moving -into the back end. +eres un ingeniero del "front end" y +estás incursionando en el "back end". 204 00:09:11,760 --> 00:09:14,875 -You're probably going to be -interacting with our ODM or +Probablemente vas a interactuar +más con nuestro ODM o nuestro 205 00:09:14,875 --> 00:09:17,870 -our mapper, and less -so the driver. +cartógrafo y menos con el driver. 206 00:09:17,870 --> 00:09:21,650 -However, we have set up -a series of tools-- +Aún así, hemos configurado +una serie de herramientas-- 207 00:09:21,650 --> 00:09:24,050 -both ones that we've -built and ones that +tanto algunas que hemos +construido como otras que 208 00:09:24,050 --> 00:09:26,340 -are available publicly-- +están disponibles públicamente-- 209 00:09:26,340 --> 00:09:31,050 -that alert developers if they -have missed an index on a +para alertar a los desarrolladores +si es que han obviado un índice en 210 00:09:31,050 --> 00:09:34,570 -large collection, if they've -written a query that isn't +una colección grande o si han +escrito una consulta que no va 211 00:09:34,570 --> 00:09:40,050 -going to be performant in -production, or just +a tener buen rendimiento +en producción o si simplemente 212 00:09:40,050 --> 00:09:40,610 -if they wrote a-- +escribieron una-- 213 00:09:40,610 --> 00:09:42,890 -I don't know if you've guys have -covered n+1 queries, or +No sé si han abarcado +consultas de n+1 o 214 00:09:42,890 --> 00:09:44,930 -queries that result in, -essentially, a very large +consultas que resultan en +esencialmente un gran número 215 00:09:44,930 --> 00:09:46,530 -number of requests to -the database in a +peticiones a la base +de datos en una sola 216 00:09:46,530 --> 00:09:48,990 -single web page request. +petición de página web. 217 00:09:48,990 --> 00:09:49,280 -Yeah. +Claro. 218 00:09:49,280 --> 00:09:52,220 -And all these things are very -dangerous when pushed to +Todas esas cosas son muy +peligrosas cuando se pasan 219 00:09:52,220 --> 00:09:53,860 -production, so we try -to catch those in +a producción, así que +tratamos de atraparlas 220 00:09:53,860 --> 00:09:55,435 -development, of course. +en desarrollo, por supuesto. 221 00:09:55,435 --> 00:09:59,270 -So we've covered looking -at the query +Hemos abarcado el mirar +a los planes de consulta 222 00:09:59,270 --> 00:10:02,135 -plans, and the profiler. +y el perfilador. 223 00:10:02,135 --> 00:10:03,190 -Do you guys use that? +¿Ustedes usan eso? 224 00:10:03,190 --> 00:10:04,980 -Do you try to log -long queries? +¿Tratan de tomar nota +de consultas largas? 225 00:10:04,980 --> 00:10:07,150 -Do you regularly monitor that? +¿Monitorean eso frecuentemente? 226 00:10:07,150 --> 00:10:14,220 -We use the 10gen MMS service for -essentially if something +Usamos el servicio MMS de 10gen +por si esencialmente algo 227 00:10:14,220 --> 00:10:15,720 -goes wrong. +no funciona bien. 228 00:10:15,720 --> 00:10:17,930 -Kind of doing a what-happened -analysis and just +Es como hacer un análisis +de "qué pasó" y simplemente 229 00:10:17,930 --> 00:10:18,840 -looking at the logs. +ver los logs. 230 00:10:18,840 --> 00:10:21,270 -We run the profiler a percentage -of the time or on +Ejecutamos el perfilador una +fracción del tiempo o en 231 00:10:21,270 --> 00:10:22,440 -certain deployments. +ciertos despliegues. 232 00:10:22,440 --> 00:10:23,650 -Not all the time, because -of the performance +No siempre, debido al +problema de rendimiento 233 00:10:23,650 --> 00:10:24,620 -hit that you take. +que sufres. 234 00:10:24,620 --> 00:10:26,450 -Right. +Claro. 235 00:10:26,450 --> 00:10:31,150 -But we try to watch just the -raw application logs during +Pero tratamos de mirar los logs +de la aplicación durante el 236 00:10:31,150 --> 00:10:32,430 -development. +desarrollo. 237 00:10:32,430 --> 00:10:33,850 -We enable, of course, -logging and +Habilitamos, por supuesto, +los logs en desarrollo 238 00:10:33,850 --> 00:10:35,990 -development for our driver. +para nuestro driver. 239 00:10:35,990 --> 00:10:37,820 -Just count the raw number -of queries that +Simplemente cuenta el número +de consultas que estás haciendo 240 00:10:37,820 --> 00:10:39,560 -you're doing on a request. +en una petición. 241 00:10:39,560 --> 00:10:42,040 -There's a lot of holistic kind -of goals that you should +Hay muchos tipos de metas +holísticas que deberías 242 00:10:42,040 --> 00:10:44,210 -strive for when you're building -a web applications. +intentar lograr cuando +creas aplicaciones web. 243 00:10:44,210 --> 00:10:45,380 -Just touch the database -as little as possible. +Toca la base de datos +lo menos posible. 244 00:10:45,380 --> 00:10:45,660 -Right. +Claro. 245 00:10:45,660 --> 00:10:48,650 -You don't want to be doing 200 -queries to your database on a +No quieres tener que hacer 200 +consultas a tu base de datos en 246 00:10:48,650 --> 00:10:49,220 -single web request. +una simple petición web. 247 00:10:49,220 --> 00:10:50,825 -It doesn't matter even if -they're a single millisecond. +No importa si es que duran +una sola milésima de segundo. 248 00:10:50,825 --> 00:10:53,630 -The latency of the request -is still going to +La latencia de la +petición aun te va 249 00:10:53,630 --> 00:10:54,670 -hit you really hard. +a afectar fuertemente. 250 00:10:54,670 --> 00:10:58,030 -So, just making sure that simple -things like that, which +Así que simplemente para asegurarnos +que cosas simples como esa, que 251 00:10:58,030 --> 00:11:00,800 -a mapper can, sometimes, -naively implement-- +un cartógrafo puede, a veces, +implementar ingenuamente-- 252 00:11:00,800 --> 00:11:02,830 -Yes. +Sí. 253 00:11:02,830 --> 00:11:06,375 ---just enough to be dangerous or -you're not exactly sure how +--lo suficiente para ser peligroso +o no saber exactamente cómo está 254 00:11:06,375 --> 00:11:10,550 -it's executing the query plan, -you can get into some of those +ejecutando el plan de consulta, +puedes encontrarte en unas de 255 00:11:10,550 --> 00:11:13,640 -really dangerous situations in -a production environment. +esas situaciones muy peligrosas +para ambientes en producción. 256 00:11:13,640 --> 00:11:15,760 -Do you use any caching layer -in front of Mongo? +¿Usan alguna capa de cache +en frente de Mongo? 257 00:11:15,760 --> 00:11:17,200 -Like memcached or anything -like that? +¿Como Memcached o +algo por el estilo? 258 00:11:17,200 --> 00:11:18,340 -We've thought about it. +Hemos pensado en ello. 259 00:11:18,340 --> 00:11:19,350 -We haven't had to. +No hemos necesitado hacerlo. 260 00:11:19,350 --> 00:11:20,040 -That's great. +Eso es excelente. 261 00:11:20,040 --> 00:11:23,190 -I think one of the core tenets -of Mongo is that your active +Creo que uno de los principios +de Mongo es que tus datos activos 262 00:11:23,190 --> 00:11:25,020 -data set sits in memory. +están en memoria. 263 00:11:25,020 --> 00:11:30,050 -So we've kind of had, I guess, -a basic philosophy that if +Así que hemos tenido la filosofía +básica de que si no está rindiendo 264 00:11:30,050 --> 00:11:32,720 -it's not performant at the Mongo -layer, then we're not +en la capa de Mongo, entonces 265 00:11:32,720 --> 00:11:34,510 -doing it right. +no lo estamos haciendo bien. 266 00:11:34,510 --> 00:11:37,080 -That's gotten us very far. +Eso nos ha llevado muy lejos. 267 00:11:37,080 --> 00:11:39,290 -We have not set up an -intermediary caching layer in +No hemos configurado una capa +de cache intermediario en 268 00:11:39,290 --> 00:11:40,530 -production. +producción. 269 00:11:40,530 --> 00:11:44,460 -And in terms of session -management for the users, are +Y en términos de manejo de +sesiones de los usuarios, los 270 00:11:44,460 --> 00:11:46,510 -the web servers themselves, the -application servers, are +servidores web en sí, los +servidores de aplicación, 271 00:11:46,510 --> 00:11:48,680 -they stateless? +¿no tiene estado? 272 00:11:48,680 --> 00:11:50,830 -From interaction to interaction, -as the user +Entre interacciones, +mientras el usuario 273 00:11:50,830 --> 00:11:53,760 -interacts with the website, do -you pull the state from Mongo +interactúa con la página web, +¿recuperas el estado de Mongo 274 00:11:53,760 --> 00:11:57,400 -to figure out where you left off -or is there some binding +para averiguar dónde le dejaste +o hay algún tipo de asociación 275 00:11:57,400 --> 00:11:59,170 -of the user to the application -layer? +entre el usuario y la +capa de la aplicación? 276 00:11:59,170 --> 00:11:59,670 -Certainly. +Por supuesto. 277 00:11:59,670 --> 00:12:00,610 -Tell me about that. +Cuéntame sobre eso. 278 00:12:00,610 --> 00:12:04,640 -So we have a horizontally- -scaled web application, +Así que tenemos una aplicación +web escalada horizontalmente, 279 00:12:04,640 --> 00:12:07,150 -meaning that we have numerous -web servers. +es decir que tenemos varios +servidores web. 280 00:12:07,150 --> 00:12:10,070 -And when a person hits the -website, they can get any one +Y cuando una persona va a la +página web, pueden obtener 281 00:12:10,070 --> 00:12:10,630 -of the servers. +cualquiera de estos servidores. 282 00:12:10,630 --> 00:12:11,060 -Exactly. +Exactamente. 283 00:12:11,060 --> 00:12:13,910 -Which requires that at least -those servers themselves have +Lo que requiere que por lo menos +estos mismos servidores no tengan 284 00:12:13,910 --> 00:12:18,820 -to be stateless, or not have -any internalized knowledge +estado, o no tengan ningún +conocimiento interno sobre 285 00:12:18,820 --> 00:12:19,770 -about user. +el usuario. 286 00:12:19,770 --> 00:12:21,220 -Right. +Claro. 287 00:12:21,220 --> 00:12:25,350 -Every user has a session, and -we use cookie-based session +Cada usuario tiene una sesión +y usamos un almacén de datos 288 00:12:25,350 --> 00:12:26,310 -storage for users. +basado en cookies para los usuarios. 289 00:12:26,310 --> 00:12:29,710 -So when a user hits the site, -they're given a unique ID. +Así que cuando un usuario va +al sitio, les damos un ID único. 290 00:12:29,710 --> 00:12:32,780 -That unique ID relates to -a document in our users +Ese ID único se relaciona a un +documento en nuestra colección 291 00:12:32,780 --> 00:12:36,370 -collection, and that also is -stored locally on the user's +de usuarios y también es +almacenado localmente en el 292 00:12:36,370 --> 00:12:39,680 -browser in a cookie that -stores their user ID. +navegador del usuario en una cookie +que almacena su ID de usuario. 293 00:12:39,680 --> 00:12:43,090 -So that cookie is essentially -sent to whichever +Esa cookie es esencialmente +enviada a cualquiera que sea 294 00:12:43,090 --> 00:12:44,340 -web server they get. +el servidor web que reciben. 295 00:12:44,340 --> 00:12:45,870 -The web server says, OK. +El servidor web dice, "OK". 296 00:12:45,870 --> 00:12:48,780 -Based upon that user ID -from the cookie that +Basado en el ID de usuario de +la cookie que este usuario 297 00:12:48,780 --> 00:12:49,720 -the user sent me-- +me ha enviado-- 298 00:12:49,720 --> 00:12:52,310 -and there's various encryption -and security measures to make +y hay varias medidas de +seguridad y codificación para 299 00:12:52,310 --> 00:12:56,400 -sure that someone isn't -spoofing a user ID. +asegurar que alguien no está +fingiendo un ID de usuario. 300 00:12:56,400 --> 00:12:59,120 -The web server will -then go to-- +El servidor web entonces irá a-- 301 00:12:59,120 --> 00:13:02,730 -we originally used Mongo -for our session store. +originalmente usábamos Mongo +para guardar nuestras sesiones. 302 00:13:02,730 --> 00:13:05,380 -We used Mongo for our session -store because it was simple, +Usábamos Mongo para almacenar +sesiones porque era simple, 303 00:13:05,380 --> 00:13:06,560 -especially for Rails. +especialmente para Rails. 304 00:13:06,560 --> 00:13:08,840 -There were nice packages -that would allow for +Había buenos paquetes que +permitían sesiones 305 00:13:08,840 --> 00:13:10,365 -Mongo-backed sessions. +almacenadas en Mongo. 306 00:13:10,365 --> 00:13:14,370 307 00:13:14,370 --> 00:13:19,230 -Just because we wanted to -reduce the raw number of +Simplemente porque queríamos +reducir el número de consultas 308 00:13:19,230 --> 00:13:20,955 -database queries and the number -of times we were going +a la base de datos y el número +de veces que estábamos yendo a 309 00:13:20,955 --> 00:13:24,170 -to the database for a request, -we switched to a Redis-backed +la base de datos para una petición, +cambiamos por un almacén de sesiones 310 00:13:24,170 --> 00:13:26,190 -session store. +Redis. 311 00:13:26,190 --> 00:13:27,850 -Which is in memory. +El cual está dentro de memoria. 312 00:13:27,850 --> 00:13:29,360 -Yeah, it's a share in memory. +Sí, es un porción en memoria. 313 00:13:29,360 --> 00:13:29,940 -And not persistent. +Y no persiste. 314 00:13:29,940 --> 00:13:31,630 -So if you turn off the machines, -you'd learn session +Así que si apagas las +máquinas, aprenderías 315 00:13:31,630 --> 00:13:32,600 -state in that case, right? +el estado de sesión +en ese caso, ¿no? 316 00:13:32,600 --> 00:13:35,550 -The difference is that Mongo -would persist the session. +La diferencia es que Mongo +persistiría la sesión. 317 00:13:35,550 --> 00:13:44,830 318 00:13:44,830 --> 00:13:48,190 -Redis is meant to be a shared -volatile data store. +Redis es un almacén de +datos compartido y volátil. 319 00:13:48,190 --> 00:13:57,520 -They do you have weak or not -eventual persistence to disc-- +Tienen persistencia débil +o no-eventual en disco-- 320 00:13:57,520 --> 00:13:59,760 -not anywhere at the level -of guarantee that +nada al nivel de garantía 321 00:13:59,760 --> 00:14:00,950 -MongoDB would provide. +que provee MongoDB. 322 00:14:00,950 --> 00:14:01,280 -Right. +Claro. 323 00:14:01,280 --> 00:14:04,230 -So you use Redis for -the session state. +Así que usas Redis +para el estado de sesión. 324 00:14:04,230 --> 00:14:06,950 -So what happens is that a user -hit the site, they're in the +Lo que ocurre es que un usuario +está en el sitio, está en el 325 00:14:06,950 --> 00:14:08,710 -middle of the track. +medio de un curso. 326 00:14:08,710 --> 00:14:10,590 -You obviously have to know, -when they're submitting an +Obviamente tienes que saber +cuándo están presentando una 327 00:14:10,590 --> 00:14:12,140 -answer, what they're submitting -it to and where +respuesta, a dónde están +presentándola y dónde 328 00:14:12,140 --> 00:14:13,160 -they are in the track. +están en el curso. 329 00:14:13,160 --> 00:14:15,330 -They're submitting, -basically, the +Están enviando, básicamente 330 00:14:15,330 --> 00:14:18,090 -information plus the cookie. +la información, más la cookie. 331 00:14:18,090 --> 00:14:20,290 -And then that cookie is used -to retrieve a session state +¿Y luego esa cookie es usada para +recuperar el estado de sesión 332 00:14:20,290 --> 00:14:21,960 -from Redis and then you -process the request? +de Redis y procesan la petición? 333 00:14:21,960 --> 00:14:24,390 -Is that the way it works -in the server? +¿Así funciona en el servidor? 334 00:14:24,390 --> 00:14:26,410 -The session state's not kept in -the client, as well, it's +El estado de sesión no se +mantiene también en el cliente, 335 00:14:26,410 --> 00:14:28,320 -kept in Redis on your -servers, right? +se mantiene en Redis +en tus servidores, ¿no? 336 00:14:28,320 --> 00:14:29,080 -Yes. +Sí. 337 00:14:29,080 --> 00:14:30,020 @@ -1574,137 +1565,135 @@ OK. 338 00:14:30,020 --> 00:14:33,980 -And then the rest the -information, once they +Y el resto de la +información, una vez que 339 00:14:33,980 --> 00:14:37,000 -successfully complete a step in -the lesson, that goes into +completan exitosamente una +parte de la lección, eso entra 340 00:14:37,000 --> 00:14:39,370 -Mongo, into the documents. +a Mongo, en los documentos. 341 00:14:39,370 --> 00:14:39,630 -Sure. +Claro. 342 00:14:39,630 --> 00:14:44,950 -So as you're pointing out, Redis -doesn't have the same +Entonces, como has resaltado, +Redis no tiene el mismo tipo 343 00:14:44,950 --> 00:14:49,430 -kind of persistence guarantee -that Mongo has. +de garantía de persistencia +que tiene Mongo. 344 00:14:49,430 --> 00:14:54,150 -And so we do use Redis as this -quick session storage layer. +Así que usamos Redis como esta +capa de almacén rápido de sesiones 345 00:14:54,150 --> 00:14:55,725 -That gives you the -user context, as +Te da el contexto del usuario, 346 00:14:55,725 --> 00:14:56,770 -you're talking about. +como mencionaste. 347 00:14:56,770 --> 00:15:00,380 -And if the page requires loading -the user document, all +Y si la página requiere cargar +el documento del usuario, toda 348 00:15:00,380 --> 00:15:03,910 -of the stateful representation -of the application +la representación basada en +estado de la aplicación es 349 00:15:03,910 --> 00:15:05,840 -is stored in Mongo. +almacenada en Mongo. 350 00:15:05,840 --> 00:15:06,510 -Gotcha. +Te entiendo. 351 00:15:06,510 --> 00:15:13,835 -So the session does not store, -for us, meaningful or, I'll +Así que la sesión no almacena +para nosotros, información 352 00:15:13,835 --> 00:15:16,630 -say, primary stateful -information. +importante, o mejor dicho, +información primaria con estado. 353 00:15:16,630 --> 00:15:19,990 -It'll store metadata around -the state, it'll store +Guardará los meta datos sobre +el estado, almacenará 354 00:15:19,990 --> 00:15:23,440 -contextual information that -if it was lost, would not, +información contextual que +si se perdería, probablemente 355 00:15:23,440 --> 00:15:26,030 -probably, even be noticed -by the user. +el usuario ni se daría cuenta. 356 00:15:26,030 --> 00:15:29,790 -But it helps us know where -we need to go to load the +Pero nos ayuda para saber +a dónde tenemos que ir para 357 00:15:29,790 --> 00:15:33,000 -stateful representation, and -primarily that's in Mongo. +cargar la representación con estado +y esto está principalmente en Mongo. 358 00:15:33,000 --> 00:15:37,410 -So the web application or the -web server will go first with +Así que la aplicación web o +el servidor web primero irá 359 00:15:37,410 --> 00:15:40,240 -the cookie, will go to Redis, -load the session context, and +con la cookie, irá a Redis para +cargar el contexto de sesión y 360 00:15:40,240 --> 00:15:43,910 -then that will dictate what the -query plan is to load the +luego eso va a dictaminar lo +que el plan de consulta será 361 00:15:43,910 --> 00:15:49,230 -state for whatever web page or -portion of the web application +para cargar el estado para cual sea +la página o porción de la aplicación 362 00:15:49,230 --> 00:15:52,910 -needs to be served back -to the client. +web que tiene que ser +servida al cliente. 363 00:15:52,910 --> 00:15:55,870 -And then the web server -will go to Mongo +Y luego el servidor +web irá a Mongo 364 00:15:55,870 --> 00:15:59,520 -whatever that state is. +dependiendo del estado. 365 00:15:59,520 --> 00:16:02,220 -Almost all of our state -is persisted in Mongo. +Casi todo nuestro estado +es persistido en Mongo. 366 00:16:02,220 --> 00:16:03,740 @@ -1712,344 +1701,338 @@ OK. 367 00:16:03,740 --> 00:16:07,620 -So I think what I want to do -next is have you take me +Creo que en seguida sería +bueno que nos expliques 368 00:16:07,620 --> 00:16:12,080 -through some of the evolution of -your scaling in front of a +un poco sobre la evolución de +tu escalamiento con un pizarra 369 00:16:12,080 --> 00:16:14,720 -whiteboard and just explain -maybe a little bit of your +y que nos expliques tal vez +un poco sobre tu esquema y 370 00:16:14,720 --> 00:16:19,430 -schema and what's been important -to index, and some +qué ha sido importante indexar 371 00:16:19,430 --> 00:16:21,160 -things around performance. +y algo sobre rendimiento. 372 00:16:21,160 --> 00:16:24,282 -So we're going to switch -to a whiteboard. +Así que vamos a +cambiar a una pizarra. 373 00:16:24,282 --> 00:16:24,650 -All right. +Está bien. 374 00:16:24,650 --> 00:16:25,090 -Sounds good. +Me parece muy bien. 375 00:16:25,090 --> 00:16:25,360 -All right. +Muy bien. 376 00:16:25,360 --> 00:16:26,350 -Let's go do that. +Hagamos eso. 377 00:16:26,350 --> 00:16:26,530 -All right. +Muy bien. 378 00:16:26,530 --> 00:16:30,090 -So take me through, at a high -level, what the system looks +A ver, explícame un poco +en un nivel alto, cómo 379 00:16:30,090 --> 00:16:32,620 -like and where MongoDB -fits in. +es el sistema y dónde encaja MongoDB. 380 00:16:32,620 --> 00:16:32,900 -Sure. +Claro. 381 00:16:32,900 --> 00:16:33,650 -Certainly. +Por supuesto. 382 00:16:33,650 --> 00:16:37,660 -So there's three major -components to Codecademy as a +Hay tres componentes principales +en Codecademy como un sistema 383 00:16:37,660 --> 00:16:38,670 -complete system. +completo. 384 00:16:38,670 --> 00:16:41,630 -There's the client, the -application layer, and the +Tenemos el cliente, la capa +de aplicación y la capa de 385 00:16:41,630 --> 00:16:42,920 -data layer. +datos. 386 00:16:42,920 --> 00:16:43,710 -And I'll describe all three. +Y voy a describir los tres. 387 00:16:43,710 --> 00:16:45,440 -And obviously, Mongo sits -on the data layer. +Obviamente, Mongo está +en la capa de datos. 388 00:16:45,440 --> 00:16:45,900 -Right. +Claro. 389 00:16:45,900 --> 00:16:50,635 -So we have you, your computer, -is the client. +Te tenemos a ti, tu +computadora es el cliente. 390 00:16:50,635 --> 00:16:53,140 391 00:16:53,140 --> 00:16:58,670 -And then you have, I'll call -this Rails, and this is the +Y luego tenemos, llamaré a esto +Rails, y esta es la capa de la 392 00:16:58,670 --> 00:17:02,030 -application layer. +aplicación. 393 00:17:02,030 --> 00:17:04,960 -This is the client layer, -so this is your browser. +Esta es la capa del cliente, +así que esto es tu navegador. 394 00:17:04,960 --> 00:17:07,530 395 00:17:07,530 --> 00:17:11,760 -And then you have -the data layer. +Y luego tienes la capa de datos. 396 00:17:11,760 --> 00:17:15,170 -And I'll represent -this as API. +Y lo representaré como API. 397 00:17:15,170 --> 00:17:18,640 -This is Rack, as I mentioned. +Esto es Rack, como mencioné. 398 00:17:18,640 --> 00:17:22,800 -And this communicates -directly with-- +Y se comunica directamente con-- 399 00:17:22,800 --> 00:17:27,410 -I guess we'll draw it as the -traditional representation. +Creo que lo dibujaremos como +la representación tradicional. 400 00:17:27,410 --> 00:17:29,690 -This is Mongo. +Esto es Mongo. 401 00:17:29,690 --> 00:17:32,080 -So there's three major -components. +Hay tres componentes principales. 402 00:17:32,080 --> 00:17:34,012 -There's there client layer, the -application layer, and the +Tenemos la capa del cliente, la +capa de la aplicación y la capa 403 00:17:34,012 --> 00:17:36,360 -data layer. +de los datos. 404 00:17:36,360 --> 00:17:41,980 -We want to encapsulate the data -layer to make sure that +Queremos encapsular la capa +de los datos para asegurarnos 405 00:17:41,980 --> 00:17:45,450 -there's a very well defined -interface for how we're +que haya un interfaz bien +definida para la manera en 406 00:17:45,450 --> 00:17:47,010 -accessing Mongo. +que accedemos a Mongo. 407 00:17:47,010 --> 00:17:50,170 -Because as we talked about -before, improper accesses to +Porque como dijimos anteriormente, +accesos inapropiados a Mongo 408 00:17:50,170 --> 00:17:52,620 -Mongo can lead to a lot of -problems in production. +pueden causar muchos +problemas en producción. 409 00:17:52,620 --> 00:17:52,910 -Right. +Bien. 410 00:17:52,910 --> 00:17:55,310 -And so by abstracting out -these three different +Entonces abstrayendo estos +tres diferentes componentes 411 00:17:55,310 --> 00:17:59,130 -components, we're essentially -ensuring that we can focus on +estamos esencialmente asegurando +que podemos enfocarnos en cada 412 00:17:59,130 --> 00:18:01,530 -each individually and optimize -each individually, because +uno individualmente y optimizar +cada uno individualmente, porque 413 00:18:01,530 --> 00:18:03,380 -they have very different -use cases. +tiene casos de uso +muy diferentes. 414 00:18:03,380 --> 00:18:05,210 -Client, you obviously care -about things like +Para el cliente obviamente +nos importan cosas como el 415 00:18:05,210 --> 00:18:05,920 -browser load times. +tiempo de carga del navegador. 416 00:18:05,920 --> 00:18:06,060 -Right. +Claro. 417 00:18:06,060 --> 00:18:07,375 -You care about-- +Nos importa-- 418 00:18:07,375 --> 00:18:10,280 -it's a primarily JavaScript -application, of course, you +es principalmente una aplicación +JavaScript, por supuesto, nos 419 00:18:10,280 --> 00:18:14,250 -care about the complexity of -that and even the size of the +importa la complejidad de ello +y también el tamaño de las 420 00:18:14,250 --> 00:18:17,130 -requests and the size of the -assets that you're serving-- +peticiones y el tamaño de los +recursos que estás sirviendo-- 421 00:18:17,130 --> 00:18:20,520 -images, your CSS, your -JavaScript, your HTML. +imágenes, tu CSS, +tu JavaScript, tu HTML. 422 00:18:20,520 --> 00:18:23,150 -For the application layer, you -have a lot of coupling. +Para la capa de la aplicación, +tienes mucho acoplamiento. 423 00:18:23,150 --> 00:18:27,170 -You have a lot of different -components to it. +Tienes muchos componentes +diferentes. 424 00:18:27,170 --> 00:18:30,150 -That's where you're defining -your requests and how they map +Ahí defines tus peticiones +y cómo se relacionan a las 425 00:18:30,150 --> 00:18:35,050 -to actions and controllers, and -then how those controllers +acciones y los controladores +y luego cómo esos controladores 426 00:18:35,050 --> 00:18:40,050 -do various ways of aggregating -your data to format them into +agregan los datos para +formatearlos dentro de 427 00:18:40,050 --> 00:18:41,450 -a proper response. +una buena respuesta. 428 00:18:41,450 --> 00:18:48,270 -So the API is what connects the -application to Mongo by +La API es lo que conecta +la aplicación a Mongo 429 00:18:48,270 --> 00:18:51,380 -essentially encapsulating -those access patterns. +esencialmente encapsulando +los patrones de acceso. 430 00:18:51,380 --> 00:18:55,880 -So if the application wants -to, say, return your user +Así que si la aplicación +quiere, digamos, devolver el 431 00:18:55,880 --> 00:18:58,220 -profile, it's going to -query across multiple +perfil de tu usuario, va a +hacer consultas a varias 432 00:18:58,220 --> 00:18:59,490 -collections in Mongo. +colecciones en Mongo. 433 00:18:59,490 --> 00:19:03,660 -So it's going to issue multiple -calls to the API that +Así que va a hacer varias +llamadas a la API que hacen 434 00:19:03,660 --> 00:19:06,230 -do joins across multiple -collections, or different +joins a través de varias +colecciones o diferentes 435 00:19:06,230 --> 00:19:07,690 -parts of the database. +partes de la base de datos. 436 00:19:07,690 --> 00:19:13,460 -And you want to be able to -optimize how you're accessing +Y vas a querer optimizar +cómo estás accediendo Mongo 437 00:19:13,460 --> 00:19:15,660 -Mongo for those different -types of queries. +para este diferente +tipo de consultas. 438 00:19:15,660 --> 00:19:21,180 -So I think we'll dive in a bit -to the data layer and how +Así que nos zambulliremos un +poco en la capa de datos y cómo 439 00:19:21,180 --> 00:19:25,190 -through a request cycle we -go from the client to +a través de un ciclo de +peticiones vamos del cliente 440 00:19:25,190 --> 00:19:26,490 -Mongo and then back. +hasta Mongo y de regreso. 441 00:19:26,490 --> 00:19:27,020 @@ -2057,132 +2040,132 @@ OK. 442 00:19:27,020 --> 00:19:29,070 -Sounds good. +Me parece bien. 443 00:19:29,070 --> 00:19:32,720 -So a student is sitting at the -computer and they're in the +Entonce hay un estudiante sentado +en su computadora y están en el 444 00:19:32,720 --> 00:19:34,240 -middle of one of these -tracks, and they have +medio de uno de estos +cursos y tiene que 445 00:19:34,240 --> 00:19:35,010 -to submit an answer. +enviar una respuesta. 446 00:19:35,010 --> 00:19:37,340 -So what happens after that, -when they're submitting an +Entonces, ¿qué pasa después de eso? +¿Qué pasa después de que envían 447 00:19:37,340 --> 00:19:38,790 -answer and it needs -to get evaluated? +la respuesta y tiene +que ser evaluada? 448 00:19:38,790 --> 00:19:39,230 -Sure. +Claro. 449 00:19:39,230 --> 00:19:42,010 -So you're sitting at -your computer. +Estás sentado frente +a tu computadora. 450 00:19:42,010 --> 00:19:45,880 -You are on an exercise and -you make a submission. +Estás haciendo un ejercicio +y envías la respuesta. 451 00:19:45,880 --> 00:19:51,550 -So as soon as you hit Run, -you have this request. +Así que ni bien presionas "Run", +haz hecho esta petición. 452 00:19:51,550 --> 00:19:55,800 -This request it's going to have -code and other associated +Esta petición va a tener +código y otros meta datos 453 00:19:55,800 --> 00:20:00,420 -metadata, like your-- +asociada como tu-- 454 00:20:00,420 --> 00:20:02,240 -as we talked about, we -store our session +como hablamos antes, +guardamos información 455 00:20:02,240 --> 00:20:04,640 -information in Redis-- +de sesiones en Redis-- 456 00:20:04,640 --> 00:20:07,110 -so it'll have your cookie. +así que tendrá su cookie. 457 00:20:07,110 --> 00:20:08,780 -Your cookie will have a -lot of this metadata, +Tu cookie tendrá mucha de +estos meta datos, incluyendo 458 00:20:08,780 --> 00:20:12,230 -including your user ID. +tu ID de usuario. 459 00:20:12,230 --> 00:20:15,290 -We actually, at the moment of -the request, use an external +Al momento de la petición, en +realidad usamos un servicio 460 00:20:15,290 --> 00:20:18,075 -code evaluation service that we -created that's outside of +externo que evalúa el código +que nosotros creamos y que está 461 00:20:18,075 --> 00:20:19,325 -the system. +afuera del sistema. 462 00:20:19,325 --> 00:20:21,190 463 00:20:21,190 --> 00:20:22,870 -We call it codex. +Lo llamamos "codex". 464 00:20:22,870 --> 00:20:25,190 -What's important is that this -happens outside of this entire +Lo importante es que esto +ocurre afuera de este flujo 465 00:20:25,190 --> 00:20:28,600 -flow, and that's for -security reasons. +y es así por razones +de seguridad. 466 00:20:28,600 --> 00:20:30,880 -Code, when it's submitted, will -actually go to codex and +El código, cuando se envía, +va a ir a codex y va a 467 00:20:30,880 --> 00:20:33,380 -will come back with an -evaluated response. +regresar con una +respuesta evaluada. 468 00:20:33,380 --> 00:20:36,370 -At the end of that evaluated -response, you get the output, +Al final de esa respuesta +evaluada, obtienes el resultado 469 00:20:36,370 --> 00:20:39,480 -and then we propagate -it and store it. +y luego lo propagamos +y almacenamos. 470 00:20:39,480 --> 00:20:39,800 @@ -2190,19 +2173,19 @@ OK. 471 00:20:39,800 --> 00:20:41,800 -I'll sandboxed to that-- +Todo esto está "sandboxed". 472 00:20:41,800 --> 00:20:42,075 -Yep. +Sí. 473 00:20:42,075 --> 00:20:42,460 -All code is sandboxed. +Todo el código está "sandboxed". 474 00:20:42,460 --> 00:20:43,830 -This happens outside of this. +Esto ocurre afuera de esto. 475 00:20:43,830 --> 00:20:44,120 @@ -2210,203 +2193,202 @@ OK. 476 00:20:44,120 --> 00:20:46,300 -So once you have your request, -then have your evaluator +Así que una vez que tienes +tu petición, tienes la respuesta 477 00:20:46,300 --> 00:20:48,710 -response, goes to Rails. +del evaluador, esto va a Rails. 478 00:20:48,710 --> 00:20:53,760 -In Rails, it's making a post -request to a submissions +En Rails, hace una petición +post a un controlador de 479 00:20:53,760 --> 00:20:54,730 -controller. +presentaciones. 480 00:20:54,730 --> 00:20:56,510 -And this is a route. +Y esta es una ruta. 481 00:20:56,510 --> 00:20:57,760 -We'll call it submissions. +La llamaremos presentaciones. 482 00:20:57,760 --> 00:21:01,190 483 00:21:01,190 --> 00:21:03,760 -And this is where the -application is receiving, at +Aquí es donde la aplicación +está recibiendo, en la capa 484 00:21:03,760 --> 00:21:08,130 -the HTTP layer, your request and -then it's processing it. +HTTP, tu petición y +la está procesando. 485 00:21:08,130 --> 00:21:12,470 -So it's taking your request, -it's pulling from the API the +Así que está tomando tu petición +está jalando de la API los meta 486 00:21:12,470 --> 00:21:14,420 -appropriate metadata so -that it knows where +datos apropiados para +saber dónde escribir 487 00:21:14,420 --> 00:21:15,470 -to write the context. +el contexto. 488 00:21:15,470 --> 00:21:18,620 -So this is going -to require a-- +Entonces esto va a requerir un-- 489 00:21:18,620 --> 00:21:21,080 -we'll split it up into reads and -then we'll split up into +lo dividiremos en lecturas +y luego lo dividiremos en 490 00:21:21,080 --> 00:21:22,410 -writes that happen. +escrituras que ocurren. 491 00:21:22,410 --> 00:21:26,500 -So this will read your user. +Entonces esto es lo que +tu usuario va a leer. 492 00:21:26,500 --> 00:21:29,640 -This will be an API call, so -these are both API calls, as +Esto será una llamada a la API, +ambos de éstos son llamadas a la 493 00:21:29,640 --> 00:21:31,380 -we've talked about across -this layer. +API, como hablamos +sobre esta capa. 494 00:21:31,380 --> 00:21:34,490 -It needs to read your context -for the user and it +Tiene que leer el contexto +del usuario y tiene que 495 00:21:34,490 --> 00:21:36,280 -needs to pull the-- +jalar el--lo llamaremos 496 00:21:36,280 --> 00:21:39,680 -we'll call it the -context context. +el contexto de contenido. 497 00:21:39,680 --> 00:21:47,380 -So for a submission, it's -associated with an exercise. +Entonces para una presentación, +está asociado con un ejercicio. 498 00:21:47,380 --> 00:21:49,890 -An exercise belongs -to a course. +Un ejercicio pertenece +a un curso. 499 00:21:49,890 --> 00:21:52,360 -It has a content context, -is what I'm calling it. +Tiene contexto de contenido, +es lo que lo estoy llamando. 500 00:21:52,360 --> 00:21:56,020 -So it's going to pull, -essentially, the associated +Así que va a jalar, +esencialmente, los 501 00:21:56,020 --> 00:21:57,270 -exercise data. +datos asociados al ejercicio. 502 00:21:57,270 --> 00:22:00,080 503 00:22:00,080 --> 00:22:04,500 -On top of that, these are the -only two things that we need +Admás, éstas son las únicas +dos cosas que tenemos que 504 00:22:04,500 --> 00:22:08,230 -to actually pull for a write -to get the appropriate +jalar para hacer una escritura, +para obtener los datos 505 00:22:08,230 --> 00:22:12,120 -associated data to write -your submission. +correspondientes para +escribir tu presentación. 506 00:22:12,120 --> 00:22:14,570 -What are the major collections -inside MongoDB +¿Cuáles son la colecciones +principales dentro de 507 00:22:14,570 --> 00:22:16,170 -that represent this? +MongoDB que representan esto? 508 00:22:16,170 --> 00:22:18,360 -So if we're going to jump-- +Si vamos a saltar-- 509 00:22:18,360 --> 00:22:21,840 -the application layer has -no knowledge of this. +la capa de la aplicación no tiene +ningún conocimiento de esto. 510 00:22:21,840 --> 00:22:26,042 -For the API layer, it -has knowledge of-- +Para la capa de la API, no +tiene ningún conocimiento de-- 511 00:22:26,042 --> 00:22:29,490 512 00:22:29,490 --> 00:22:35,530 -there's a user's collection, -there is a-- +hay una colección de +usuarios, hay una-- 513 00:22:35,530 --> 00:22:40,430 -we'll call it a section -collection. +lo llamaermos una +colección de secciones. 514 00:22:40,430 --> 00:22:45,870 -Section have embedded -exercises. +Una sección tiene +ejercicios embebidos. 515 00:22:45,870 --> 00:22:50,600 -The sections of a track to learn -a skill, in this case. +Las secciones de un curso para +aprender una habilidad, en este caso. 516 00:22:50,600 --> 00:22:50,860 -Right. +Claro. 517 00:22:50,860 --> 00:22:53,480 -So sections, you can just -think of them as +Entonces puedes pensar +de las secciones como 518 00:22:53,480 --> 00:22:54,820 -groupings of exercises. +conjuntos de ejercicios. 519 00:22:54,820 --> 00:22:55,220 -Yeah. +Sí. 520 00:22:55,220 --> 00:22:55,515 @@ -2414,279 +2396,277 @@ OK. 521 00:22:55,515 --> 00:22:57,110 -There can be a variety of-- +Pueden haber una variedad de-- 522 00:22:57,110 --> 00:22:57,450 -Chapters, if you will. +capítulos, podrían ser-- 523 00:22:57,450 --> 00:23:01,050 ---of chapters or different -ways of showing those +de capítulos o diferentes +maneras de mostrar estos 524 00:23:01,050 --> 00:23:03,970 -groupings to users, but we -essentially just say it's a +conjuntos a los usuarios, +pero esencialmente decimos 525 00:23:03,970 --> 00:23:05,320 -grouping of exercises. +que son conjuntos de ejercicios. 526 00:23:05,320 --> 00:23:06,960 -It's a single document -and it has +Es un solo documento y contiene 527 00:23:06,960 --> 00:23:08,870 -embedded exercise documents. +documentos de ejercicios embebidos. 528 00:23:08,870 --> 00:23:11,540 -And then there's another -collection called submissions. +Luego tienes otra colección +llamada presentaciones. 529 00:23:11,540 --> 00:23:13,660 -So we are reading from users -and sections and we are +Así que estamos leyendo usuarios +y de secciones y estamos 530 00:23:13,660 --> 00:23:16,680 -writing to submissions. +escribiendo a presentaciones. 531 00:23:16,680 --> 00:23:21,640 -Right and so the learning track -is represented by the +Claro, ¿entonces el curso de +aprendizaje está representado 532 00:23:21,640 --> 00:23:22,430 -sections collection? +por la colección de secciones? 533 00:23:22,430 --> 00:23:23,100 -Yep. +Sí. 534 00:23:23,100 --> 00:23:28,160 -And it doesn't change when a -user goes through the track. +Y no cambia cuando el usuario +va a través del curso. 535 00:23:28,160 --> 00:23:31,380 -This represents the course, -if you will, and then the +Esto representa el curso, +y entonces la colección 536 00:23:31,380 --> 00:23:35,140 -submissions collection -is taking the user-- +de presentaciones está +tomando el usuario-- 537 00:23:35,140 --> 00:23:37,300 -you're keeping track of -user progress here. +registras el progreso +del usuario aquí. 538 00:23:37,300 --> 00:23:41,130 -And just everyone kind of knows -how this thing works-- +Y todo el mundo sabe cómo +funciona esto, pero estás 539 00:23:41,130 --> 00:23:42,870 -but you're writing code and it's -getting evaluated, and +escribiendo código y +está siendo evaluado 540 00:23:42,870 --> 00:23:43,990 -you're telling them whether -they got the +y les estás diciendo +si es que obtuvieron el 541 00:23:43,990 --> 00:23:45,210 -right answer or not. +resultado correcto o no. 542 00:23:45,210 --> 00:23:47,960 -So that happens over in this -corner right here. +Así que esto ocurre en +está esquina aquí. 543 00:23:47,960 --> 00:23:49,570 -This happens completely -outside of this site. +Esto ocurre completamente +afuera de este sitio. 544 00:23:49,570 --> 00:23:49,840 -Right. +OK. 545 00:23:49,840 --> 00:23:52,980 -Just because you never can -quite trust code that's +Sólo porque no puedes +confiar en código que 546 00:23:52,980 --> 00:23:54,800 -written by the user. +ha sido escrito por el usuario. 547 00:23:54,800 --> 00:23:58,120 -Yeah, we definitely don't want -this service having any +Sí, no queremos que este +servicio tenga conocimiento 548 00:23:58,120 --> 00:24:01,480 -knowledge of any other -part of the service. +de cualquier otra parte +de este servicio. 549 00:24:01,480 --> 00:24:02,080 -Right. +Claro. 550 00:24:02,080 --> 00:24:05,260 -And so by the time it all gets -to here, you actually already +Entonces cuando todo esto +llega aquí, ya sabrás 551 00:24:05,260 --> 00:24:08,120 -know whether the student -got the right answer? +si es que el estudiante +obtuvo la respuesta correcta. 552 00:24:08,120 --> 00:24:08,370 -Mm hm. +Así es. 553 00:24:08,370 --> 00:24:13,810 -We both the code that you're -submitting and the evaluated, +Tanto el código que +presentaste y el resultado 554 00:24:13,810 --> 00:24:19,210 -I guess, response or result of -your code, as well as any +o repuesta, supongo, de tu +código, además de cualquier 555 00:24:19,210 --> 00:24:24,080 -errors that were thrown, any -other kind of the information +error que obtuviste y cualquier +otro tipo de información que 556 00:24:24,080 --> 00:24:28,210 -that resulted from running the -code or evaluating it in an +obtuvimos al ejecutar o +evaluar el codígo en un 557 00:24:28,210 --> 00:24:29,660 -environment. +ambiente. 558 00:24:29,660 --> 00:24:30,910 -Can you talk a little -bit about-- +¿Puedes hablar un poco sobre-- 559 00:24:30,910 --> 00:24:34,040 560 00:24:34,040 --> 00:24:35,830 -the size the collection, -the submissions +el tamaño de la colección? 561 00:24:35,830 --> 00:24:37,360 -collection is the big one. +La colección de presentaciones +es la más grande. 562 00:24:37,360 --> 00:24:40,420 -The users is more modestly -sized, and the sections is +La de usuarios es más pequeña +y la de secciones es probablemente 563 00:24:40,420 --> 00:24:43,850 -probably quite small, because -that's just the courses +muy pequeña, porque +es sólo los cursos 564 00:24:43,850 --> 00:24:44,600 -themselves. +mismos. 565 00:24:44,600 --> 00:24:45,230 -Yeah. +Claro. 566 00:24:45,230 --> 00:24:48,510 -I'll talk a little bit -about what orders of +Hablaré un poco sobre +qué orden de magnitud 567 00:24:48,510 --> 00:24:49,700 -magnitude are here. +tenemos aquí. 568 00:24:49,700 --> 00:24:52,270 -I think just to kind of finish -the API calls here. +Creo que para termina con lo +de las llamadas a la API acá. 569 00:24:52,270 --> 00:24:52,500 -Sure. +Claro. 570 00:24:52,500 --> 00:24:54,355 -So when you have your request, -this goes to +Entonces cuando tienes +tu petición, esto va a 571 00:24:54,355 --> 00:24:55,225 -the application layer. +la capa de la aplicación. 572 00:24:55,225 --> 00:24:58,555 -It goes to this route -as a post request. +Esto va a esta ruta +como una petición post. 573 00:24:58,555 --> 00:25:01,740 574 00:25:01,740 --> 00:25:05,600 -That then has to reads for the -user into that collection +Luego esto la tiene lecturas +para el usuario en esta colección 575 00:25:05,600 --> 00:25:09,450 -across the API, and it has -reads to sections. +a través de la API y luego +lecturas a secciones. 576 00:25:09,450 --> 00:25:13,750 -So I think now that we know -about the exact collections +Así que ahora que sabemos +exactamente que colecciones 577 00:25:13,750 --> 00:25:17,030 -that we're querying, I'll -call this a section. +estamos consultando, +llamaré a esto una sección. 578 00:25:17,030 --> 00:25:19,150 -This is the associated -section exercise. +Este es el ejercicio +de la sección en cuestión. 579 00:25:19,150 --> 00:25:21,260 -And then the writes -are to submission. +Y luego las escrituras +son a presentaciones. 580 00:25:21,260 --> 00:25:22,060 -Gotcha. +Te entiendo. 581 00:25:22,060 --> 00:25:24,770 @@ -2694,102 +2674,99 @@ OK. 582 00:25:24,770 --> 00:25:26,560 -And this then goes to the API. +Y esto luego va a la API. 583 00:25:26,560 --> 00:25:31,130 -The API is what contains the -driver that is doing the reads +La API es lo que contiene +el driver que está haciendo 584 00:25:31,130 --> 00:25:35,578 -and writes directly from Mongo, -and that does, we'll +las lecturas y escrituras +directamente desde Mongo, y 585 00:25:35,578 --> 00:25:37,800 -call it, just aggregation. +que hace, lo llamaremos agregación. 586 00:25:37,800 --> 00:25:39,570 -This isn't the aggregation -framework. +No es el Aggregation Framework. 587 00:25:39,570 --> 00:25:41,290 -I'm just using this -generically. +Estoy usando el término +genéricamente. 588 00:25:41,290 --> 00:25:43,860 -From when it does its reads, -and then upon aggregation, +Desde cuando hace sus lecturas +y luego al hacer la agregación, 589 00:25:43,860 --> 00:25:44,840 -does its writes. +hace sus escrituras. 590 00:25:44,840 --> 00:25:46,180 -And then we send the response. +Y luego enviamos la respuesta. 591 00:25:46,180 --> 00:25:49,102 -And the client knows that -there's been a successful +Y el cliente sabe que ha +habido una escritura exitosa 592 00:25:49,102 --> 00:25:54,780 -write and it won't reattempt -another request. +y no reenviará la petición. 593 00:25:54,780 --> 00:25:56,930 -If, of course, there's for some -reason a failure, there's +Si, por supuesto, hay +alguna falla, entonces 594 00:25:56,930 --> 00:26:00,390 -just an exponential backoff of -retries to ensure that the +hay un número exponencial +de intentos para asegurarse 595 00:26:00,390 --> 00:26:02,150 -request went through. +de que la petición pasó. 596 00:26:02,150 --> 00:26:07,450 -So a lot of the interesting -details here are around how we +Muchos de los detalles +interesantes acá están en 597 00:26:07,450 --> 00:26:09,860 -deal with these different -collections and the different +como lidiamos con estas +diferentes colecciones y 598 00:26:09,860 --> 00:26:12,860 -orders of magnitude -that we have. +las diferentes órdenes de +magnitud que tenemos. 599 00:26:12,860 --> 00:26:16,420 -We've stored user submissions -from the very beginning. +Hemos guardado la presentaciones +de los usuarios desde el comienzo. 600 00:26:16,420 --> 00:26:20,040 -And over the year and few months -now that the site's +Y en el año y algunos meses que +el sitio ha estado en producción 601 00:26:20,040 --> 00:26:21,970 -been live, we've collected -hundreds of millions of +hemos recolectado millones de 602 00:26:21,970 --> 00:26:22,650 -submissions. +presentaciones. 603 00:26:22,650 --> 00:26:23,070 @@ -2797,675 +2774,678 @@ Wow. 604 00:26:23,070 --> 00:26:27,150 -And that, of course, has a lot -of challenges, especially both +Y por supuesto, esto resulta +en mucho retos, especialmente 605 00:26:27,150 --> 00:26:30,940 -with the volume but also the -fact that code that people are +por el volumen, pero también +por el hecho que el código que 606 00:26:30,940 --> 00:26:33,940 -submitting varies -widely in size. +la gente está presentando +varía mucho en tamaño. 607 00:26:33,940 --> 00:26:37,990 -And so a submission document, if -we were to include the code +Entonces un documento de presentación +si optaríamos por incluir el código 608 00:26:37,990 --> 00:26:40,620 -that was being submitted, each -submission document could +que está siendo presentado, +cada documento de presentación 609 00:26:40,620 --> 00:26:45,340 -range from a few tens of bytes -to hundreds of kilobytes or +podría tener desde algunas decenas +de bytes hasta cientos de kilobytes 610 00:26:45,340 --> 00:26:46,850 -even potentially a megabyte. +o hasta un megabyte. 611 00:26:46,850 --> 00:26:49,150 -And I don't know how much in -detail you guys have gotten +No sé en cuánto detalle han +entrado respecto a la compactación 612 00:26:49,150 --> 00:26:51,770 -about compaction in MongoDB, -but that can lead to a very +en MongoDB, pero eso puede llevar 613 00:26:51,770 --> 00:26:55,290 -inefficient storage -within MongoDB. +a un almacenaje ineficiente +dentro de MongoDB. 614 00:26:55,290 --> 00:26:56,100 -Right. +Claro. 615 00:26:56,100 --> 00:26:59,960 -So we can talk a bit more about -the evolution of the +Así que podemos hablar un +poco más sobre la evolución 616 00:26:59,960 --> 00:27:02,200 -submissions collection, which -has posed some interesting +de la colección de presentaciones, +la cual nos ha planteado varios 617 00:27:02,200 --> 00:27:04,400 -challenges for us as -we've scaled-- +retos a nosotros mientras +hemos escalado-- 618 00:27:04,400 --> 00:27:07,380 -both from where we started -and where we are today. +tanto cuando comenzamos +como donde estamos hoy. 619 00:27:07,380 --> 00:27:07,530 -Yeah. +Claro. 620 00:27:07,530 --> 00:27:08,520 -Let's talk about that. +Hablemos sobre ello. 621 00:27:08,520 --> 00:27:13,050 -So you were telling me earlier -you're in a replicated but +Me estabas contando antes +que están en un ambiente 622 00:27:13,050 --> 00:27:14,740 -non-sharded environment, -but in the past, +replicado, pero sin "shards", +pero que en el pasado, 623 00:27:14,740 --> 00:27:16,430 -you've actually sharded. +han tenido "shards". 624 00:27:16,430 --> 00:27:20,710 -So maybe you can take the -students through the evolution +De repente puedes llevar +a los estudiantes a través 625 00:27:20,710 --> 00:27:23,880 -of that decision and how you -managed to go from sharded to +de la evolución de esa decisión +y como lograron ir de con "shards" 626 00:27:23,880 --> 00:27:28,660 -unsharded, which is obviously -easier to administer because +a sin "shards", lo cual es +obviamente más fácil de administrar 627 00:27:28,660 --> 00:27:30,030 -your [? added ?] performance -is great. +debido a su incremento en rendimiento. 628 00:27:30,030 --> 00:27:32,075 -So if you could talk -about that. +Así que si pudieras +hablar sobre eso. 629 00:27:32,075 --> 00:27:32,630 -Yeah. +Claro. 630 00:27:32,630 --> 00:27:37,100 -So there's three different -eras or versions of the +Hay tres diferentes épocas +o versiones de la colección 631 00:27:37,100 --> 00:27:38,010 -submissions collection. +de presentaciones. 632 00:27:38,010 --> 00:27:39,900 -I think I'll erase this, -and then we can-- +Creo que puedo borrar +esto y luego podemos-- 633 00:27:39,900 --> 00:27:40,500 -Sure, yeah. +Sí, por supuesto. 634 00:27:40,500 --> 00:27:42,130 ---go into more detail -about that. +--entrar en más +detalle sobre eso. 635 00:27:42,130 --> 00:27:46,470 -So as I mentioned, there are -three different versions or +Así que como mencioné, hay +tres diferentes versiones o 636 00:27:46,470 --> 00:27:49,620 -generations of our submission -collection. +generaciones de nuestra +colección de presentaciones. 637 00:27:49,620 --> 00:27:51,885 -At first, it was just a raw -submission collection. +Primero, era simplemente una +colección pura de presentaciones. 638 00:27:51,885 --> 00:27:56,480 639 00:27:56,480 --> 00:28:00,460 -It had things like -exercise ID-- +Tenía cosas como ID de ejercicio-- 640 00:28:00,460 --> 00:28:03,500 -this is the content context. +este es el contexto +del contenido. 641 00:28:03,500 --> 00:28:06,400 -User ID. +ID del usuario. 642 00:28:06,400 --> 00:28:11,170 -And this was a unique key -index compound on +Y éste era una clave única +compuesta de los IDs 643 00:28:11,170 --> 00:28:12,280 -exercise and user IDs. +de ejercicio y usuario. 644 00:28:12,280 --> 00:28:16,900 -So we can get more into how we -introduced indexes on this in +Así que podemos entrar en +más detalle respecto a cómo 645 00:28:16,900 --> 00:28:18,650 -the second generation. +introducimos índices en +esta segunda generación. 646 00:28:18,650 --> 00:28:20,360 -It was on exercises ID comma -user ID you said? +¿Dijiste que era en ID de +ejercicios coma ID de usuario? 647 00:28:20,360 --> 00:28:22,180 -Or user ID comma exercise ID? +¿O ID de usuario coma +ID de ejercicio? 648 00:28:22,180 --> 00:28:23,600 -Which was the index? +¿Cuál era el índice? 649 00:28:23,600 --> 00:28:24,910 -User ID, exercise ID. +ID de usuario, ID de ejercicio. 650 00:28:24,910 --> 00:28:26,160 -User ID, exercise ID. +ID de usuario, ID de ejercicio. 651 00:28:26,160 --> 00:28:30,390 -And then we had this the -array for answers. +Y luego teníamos este +array para las respuestas. 652 00:28:30,390 --> 00:28:34,540 -Answers are what actually stored -the submitted content. +Las repuestas son lo que +guardaban el contenido enviado. 653 00:28:34,540 --> 00:28:38,650 -So this would be an array of -embedded answer documents, and +Entonces esto sería un array de +documentos de respuesta embebidos 654 00:28:38,650 --> 00:28:41,970 -these would have things -like, we'll call +y tenían cosas como, digamos 655 00:28:41,970 --> 00:28:45,600 -it the actual entry. +la entrada actual. 656 00:28:45,600 --> 00:28:51,290 -This would be the code -the user wrote. +Esto sería el código +que escribió el usuario. 657 00:28:51,290 --> 00:28:52,920 -And then there'd be additional +Y luego habría información 658 00:28:52,920 --> 00:28:57,040 -information, like a time stamp. +adicional, como un "timestamp". 659 00:28:57,040 --> 00:29:01,110 -We actually use abbreviated -property names or key names +Usamos abreviaciones para los +nombres de propiedades o claves 660 00:29:01,110 --> 00:29:03,240 -because they're included in the -document size, but I'll +porque se incluyen en el +tamaño del documento, pero 661 00:29:03,240 --> 00:29:04,490 -write them out here fully. +voy a escribirlas acá +completamente. 662 00:29:04,490 --> 00:29:07,040 663 00:29:07,040 --> 00:29:12,810 -And so you use abbreviated key -names because it reduces the +Así que usas claves abreviadas +porque reduce el tamaño de tu 664 00:29:12,810 --> 00:29:17,360 -size of your overall data -footprint in Mongo. +huella de datos en Mongo. 665 00:29:17,360 --> 00:29:20,630 -Yeah, because your serializing -your document into a binary +Sí, porque estás serializando +tu documento a una representación 666 00:29:20,630 --> 00:29:22,180 -representation. +binaria. 667 00:29:22,180 --> 00:29:25,960 -The property names of your -adjacent document are included +Los nombres de las propiedades +en tu documento adjunto +están incluidas en el 668 00:29:25,960 --> 00:29:27,610 -in the document size. +tamaño del documento. 669 00:29:27,610 --> 00:29:28,540 -Right. +Claro. 670 00:29:28,540 --> 00:29:31,270 -And as a result, it's something -you can easily +Como resultado, es algo +que fácilmente puedes 671 00:29:31,270 --> 00:29:33,950 -optimize, and especially if you -split your applications up +optimizar, especialmente si estás +dividiendo tus aplicaciones 672 00:29:33,950 --> 00:29:37,005 -into these different interfaces -between your data +en estas diferentes interfaces +entre tu capa de datos y la 673 00:29:37,005 --> 00:29:37,930 -layer and your application -layer. +capa de tu aplicación. 674 00:29:37,930 --> 00:29:44,340 -It's easy to just do, in the -API code, just do a simple +Es muy fácil de hacer, simplemente +en el código de tu API, haces una 675 00:29:44,340 --> 00:29:47,910 -mapping where you're converting -between the full +relación simple, donde estás +convirtiendo el texto completo 676 00:29:47,910 --> 00:29:50,930 -text or the full length version -of the property name +o la versión completa del +nombre de la propiedad 677 00:29:50,930 --> 00:29:52,910 -and the abbreviated version -of the property names. +y la versión abreviada +del nombre de la propiedad. 678 00:29:52,910 --> 00:29:52,985 -Right. +Claro. 679 00:29:52,985 --> 00:29:54,130 -So the developers still get -the benefit of intuitive +Entonces los desarrolladores +tienen el beneficio de nombres 680 00:29:54,130 --> 00:29:56,900 -names, and you get the -efficiency of having shorter +intuitivos y tienes la +eficiencia que viene con 681 00:29:56,900 --> 00:29:59,795 -names inside the MongoDB -collections. +nombres más cortos dentro +de las colecciones de MongoDB. 682 00:29:59,795 --> 00:30:00,130 -Yeah. +Claro. 683 00:30:00,130 --> 00:30:03,800 -And if you have a very large -volume of documents that are +Y si tienes un gran volumen +de documentos que son relativamente 684 00:30:03,800 --> 00:30:07,450 -relatively small, your property -names can be even a +pequeños, los nombres de tus +propiedades pueden ser hasta 685 00:30:07,450 --> 00:30:11,650 -fourth, or even half, I guess, -in some cases, the size of +un cuarto o mitad, en algunos +casos, del tamaño de tus 686 00:30:11,650 --> 00:30:13,030 -your total document. +documentos. 687 00:30:13,030 --> 00:30:15,870 -So even just doing a simple -abbreviation can cut down the +Así que el hacer una +abreviación simple puede 688 00:30:15,870 --> 00:30:17,280 -size o collection in half. +reducir el tamaño de +una colección a la mitad. 689 00:30:17,280 --> 00:30:17,870 -Yeah. +Sí. 690 00:30:17,870 --> 00:30:21,060 -So just go to the general -structure here, this is how we +Entonces para ir a la estructura +general acá, así es como 691 00:30:21,060 --> 00:30:22,420 -originally started out. +comenzamos inicialmente. 692 00:30:22,420 --> 00:30:25,030 -It's just a simple exercise ID, -user ID, and then an array +Es un simple ID de ejercicio, +un ID de usuario y luego un 693 00:30:25,030 --> 00:30:25,660 -of answers. +array de respuestas. 694 00:30:25,660 --> 00:30:28,050 -The is sorted. +Están ordenadas. 695 00:30:28,050 --> 00:30:30,260 -We had an arbitrary limit on -the length of this array. +Teníamos un límite arbitario +para el tamaño de este array. 696 00:30:30,260 --> 00:30:33,515 -Obviously it could grow -uncontrollably. +Obviamente podría crecer +de manera descontrolada. 697 00:30:33,515 --> 00:30:34,630 -We just hard-coded a limit. +Simplemente teníamos +un límite impuesto. 698 00:30:34,630 --> 00:30:38,160 -It was pretty easy through -atomic pushes and pops off of +Era muy fácil mantener +el tamaño haciendo "pushes" 699 00:30:38,160 --> 00:30:40,360 -it to maintain that size. +y "pops" atómicos. 700 00:30:40,360 --> 00:30:41,830 -And that was it. +Y eso era todo. 701 00:30:41,830 --> 00:30:46,150 -So what was really interesting -here is as this collection +Así que lo que en verdad era +interesante aquí mientras esta 702 00:30:46,150 --> 00:30:50,370 -grew, it, of course, very -quickly got into the millions. +colección crecía, por supuesto +que creció rápidamente a los 703 00:30:50,370 --> 00:30:53,030 -We needed to be very careful and -explicit with the indexes +millones. Teníamos que ser +muy cuidados y explícitos 704 00:30:53,030 --> 00:30:54,060 -that we were using here. +con los índices que +estábamos usando. 705 00:30:54,060 --> 00:30:58,340 -And so one problem that we -originally had was that, +Y un problema que teníamos +originalmente era que, 706 00:30:58,340 --> 00:31:02,180 -occasionally, if someone would -hit Submit twice in rapid +ocasionalmente, si alguien +hacía "Submit" dos veces 707 00:31:02,180 --> 00:31:05,930 -succession, we couldn't -do a proper atomic +en sucesión rápida, no +podíamos hacer una búsqueda 708 00:31:05,930 --> 00:31:07,490 -lookup and then write. +atómica y luego una escritura. 709 00:31:07,490 --> 00:31:10,390 -We weren't doing an -upsert on it. +No estábamos haciendo un "upsert". 710 00:31:10,390 --> 00:31:13,980 -Or if we were doing an upsert, -it wouldn't 100% of the time +Y si usábamos un "upsert", +no lo haría 100% del tiempo 711 00:31:13,980 --> 00:31:15,890 -because we were using an ODM. +porque estábamos usando un ODM. 712 00:31:15,890 --> 00:31:17,700 -We couldn't guarantee -uniqueness. +No podíamos garantizar +singularidad. 713 00:31:17,700 --> 00:31:20,310 -There's things that we could do -that would get us very far, +Había cosas que podíamos +hacer que nos llevaban lejos, 714 00:31:20,310 --> 00:31:22,430 -but we still couldn't guarantee -uniqueness. +pero igual no podíamos +garantizar singularidad. 715 00:31:22,430 --> 00:31:25,760 -And we wanted to-- just keep -our data set clean-- +Y queríamos--para mantener +nuestros datos limpios-- 716 00:31:25,760 --> 00:31:29,120 -we wanted to guarantee -uniqueness across user ID +queríamos garantizar singularidad +sobre ID de usuario primero y 717 00:31:29,120 --> 00:31:31,300 -first and then exercise -ID second. +luego ID de ejercicio. 718 00:31:31,300 --> 00:31:35,180 -And in Mongo, the proper way -of doing that is creating a +Y en Mongo, la manera apropiada +de hacer esto es creando un 719 00:31:35,180 --> 00:31:37,560 -compound unique index. +índice único compuesto. 720 00:31:37,560 --> 00:31:43,780 -So some indexes here that we -created, very simply, was user +Así que algunos índices aquí +que creamos, muy simplemente, 721 00:31:43,780 --> 00:31:47,970 -ID, exercise ID. +fueron ID de usuario, +UD de ejercicio. 722 00:31:47,970 --> 00:31:48,370 -Right. +Muy bien. 723 00:31:48,370 --> 00:31:50,540 -User ID comma exercise ID. +ID de usuario coma +ID de ejercicio. 724 00:31:50,540 --> 00:31:51,000 -Yeah. +Sí. 725 00:31:51,000 --> 00:31:51,210 -Sorry. +Perdón. 726 00:31:51,210 --> 00:31:53,930 -I use the hashes for notation. +Usé los "hashes" para +la notación. 727 00:31:53,930 --> 00:31:56,520 -Or the pounds. +O el símbolo numeral. 728 00:31:56,520 --> 00:31:59,760 -And this was just unique. +Y esto era único. 729 00:31:59,760 --> 00:32:01,060 -Right. +Claro. 730 00:32:01,060 --> 00:32:04,230 -And that then guarantees that, -of course, you're not creating +Y eso, por supuesto, te +garantiza que no estás 731 00:32:04,230 --> 00:32:06,950 -duplicate documents across -these two fields. +creado documentos duplicados +para estos dos campos. 732 00:32:06,950 --> 00:32:07,880 -Yeah. +Sí. 733 00:32:07,880 --> 00:32:10,100 -That's the information you know -when the user submits an +Ésa también es la información que +conoces cuando el usuario presenta 734 00:32:10,100 --> 00:32:11,690 -exercise answer, also. +la respuesta de un ejercicio. 735 00:32:11,690 --> 00:32:11,840 -Right. +Claro. 736 00:32:11,840 --> 00:32:14,540 -And this is how we map a user -for an exercise to their +Y esto es cómo relacionamos +un usuario para un ejercicio 737 00:32:14,540 --> 00:32:15,480 -submitted content. +al contenido presentado. 738 00:32:15,480 --> 00:32:19,780 -And we want to make sure that -there's only one document in +Queremos asegurarnos que hay +un solo documento en la base 739 00:32:19,780 --> 00:32:22,210 -the database that is associated -with those two +de datos asociado a estos dos 740 00:32:22,210 --> 00:32:27,730 -values, and that we're -guaranteeing that we're +valores y que estamos +garantizando que estamos 741 00:32:27,730 --> 00:32:29,200 -storing all of your submissions +guardando todas tus +presentaciones en el 742 00:32:29,200 --> 00:32:30,120 -in the right order. +orden correcto. 743 00:32:30,120 --> 00:32:30,340 -Right. +Muy bien. 744 00:32:30,340 --> 00:32:31,150 -And these never change. +Y estos nunca cambian. 745 00:32:31,150 --> 00:32:35,180 -So once you append something to -this answer's array, it's +Así que una vez que adjuntas +algo a este array de respuestas, 746 00:32:35,180 --> 00:32:35,920 -never going to get edited. +nunca va a ser editado. 747 00:32:35,920 --> 00:32:37,070 -Is that correct? +¿Es cierto? 748 00:32:37,070 --> 00:32:37,780 -Right. +Sí. 749 00:32:37,780 --> 00:32:39,890 -It's written once, read many -times in that sense. +Se escribe una vez, y se +lee muchas en ese sentido. 750 00:32:39,890 --> 00:32:40,520 -Right. +Claro. 751 00:32:40,520 --> 00:32:41,230 @@ -3473,34 +3453,34 @@ OK. 752 00:32:41,230 --> 00:32:50,000 -So then you're able to, when you -write this document, you +Entonces cuando escribes +este documento, ¿básicamente 753 00:32:50,000 --> 00:32:52,550 -just push something to the end -of this array, basically? +puedes simplemente hacer "push" +al final de este array? 754 00:32:52,550 --> 00:32:52,860 -Yeah. +Sí. 755 00:32:52,860 --> 00:32:54,990 -We use an atomic push -operation on it. +Usamos una operación +atómica "push" sobre él. 756 00:32:54,990 --> 00:32:56,610 -You use an atomic push. +Usan un "push" atómico. 757 00:32:56,610 --> 00:32:58,126 -A find-modify, essential. +Un "encuentra-modifica", esencialmente. 758 00:32:58,126 --> 00:32:58,840 -Yep. +Sí. 759 00:32:58,840 --> 00:32:59,595 @@ -3508,101 +3488,102 @@ OK. 760 00:32:59,595 --> 00:33:01,450 -To push something -onto the array. +Para insertar algo +en este array, 761 00:33:01,450 --> 00:33:06,055 -Do you do any padding of these -to try to make sure that as +¿hacen algún "padding" de +éstos para asegurar que 762 00:33:06,055 --> 00:33:09,370 -they grow that they don't need -to get moved in the collection +mientras crecen, no tiene +que ser movidas en la colección 763 00:33:09,370 --> 00:33:12,630 -or do you just let Mongo -deal with that? +o dejan que Mongo +se encargue de eso? 764 00:33:12,630 --> 00:33:17,350 -Originally, we just let Mongo -deal with it, because this was +Originalmente, dejábamos que +Mongo se encargue de eso, porque 765 00:33:17,350 --> 00:33:19,290 -our implementation when we had +esta era nuestra implementación +cuando teníamos exclusivamente 766 00:33:19,290 --> 00:33:21,050 -exclusively JavaScript content. +contenido JavaScript. 767 00:33:21,050 --> 00:33:26,530 -We didn't have content that -would require multiple tabs or +No teníamos contenido que +requerían múltiples pestañas 768 00:33:26,530 --> 00:33:27,970 -multiple types of files. +o múltiples tipos de archivos. 769 00:33:27,970 --> 00:33:31,310 -We didn't have content that -involves writing an entire +No teníamos contenido que +requería escribir una 770 00:33:31,310 --> 00:33:33,660 -application, it might just -simply be a simple function +aplicación entera, simplemente +era una llamada a una función 771 00:33:33,660 --> 00:33:35,120 -call or a simple method. +o un simple método. 772 00:33:35,120 --> 00:33:39,300 -And so the variation size of -these files was within one or +Entonces la variación en +el tamaño de estos archivos 773 00:33:39,300 --> 00:33:40,280 -two orders of magnitude. +era de una o dos +órdenes de magnitud. 774 00:33:40,280 --> 00:33:44,380 -And so Mongo did a relatively -decent job of determining the +Entonces Mongo hacía una labor +decente, determinando la cantidad 775 00:33:44,380 --> 00:33:46,030 -proper padding length. +de "padding" que se requería. 776 00:33:46,030 --> 00:33:49,870 -As we started to add complex -types of content and to accept +Mientras comenzamos a usar tipos +complejos de contenido y aceptar 777 00:33:49,870 --> 00:33:51,660 -more complex types -of submissions, +presentaciones más complejas, 778 00:33:51,660 --> 00:33:53,150 -that of course changed. +eso, por supuesto, cambió. 779 00:33:53,150 --> 00:33:55,740 -So I think we can talk about the -second generation and how +Creo que podemos hablar de +la segunda generación y cómo 780 00:33:55,740 --> 00:34:00,750 -we had to change this schema to -fit into that new use case. +tuvimos que cambiar este esquema +para este nuevo caso de uso. 781 00:34:00,750 --> 00:34:00,980 @@ -3610,1299 +3591,1296 @@ OK. 782 00:34:00,980 --> 00:34:07,610 -So this is, we'll say, it's -first gen and this is about, +Esto es, digamos, la primera +generación y es más o menos, 783 00:34:07,610 --> 00:34:13,360 -we'll say, order of magnitude -1 million submissions. +digamos, una orden de magnitud +de un millón de presentaciones. 784 00:34:13,360 --> 00:34:20,205 -And so going on to the second -generation, this is when we +Entonces para esta segunda +generación, esto es cuando 785 00:34:20,205 --> 00:34:23,460 -were getting to, well say, the -next order of magnitude, about +vamos a, digamos, la siguiente +orden de magnitud, más o menos 786 00:34:23,460 --> 00:34:28,290 -10 million, with a high -variability in document size. +10 millones con una alta +variedad en tamaño de documento. 787 00:34:28,290 --> 00:34:30,520 -So we carried a lot -of things over. +Así que mantuvimos varias cosas. 788 00:34:30,520 --> 00:34:32,690 -Some of the things that -we changed was-- +Algunas de las cosas +que cambiamos fueron-- 789 00:34:32,690 --> 00:34:36,159 790 00:34:36,159 --> 00:34:39,380 -we kept a lot of the same -schema, and What we really +mantuvimos gran parte del +esquema y lo que en verdad 791 00:34:39,380 --> 00:34:41,590 -changed was our implementation -of Mongo. +cambiamos fue nuestra +implementación de Mongo. 792 00:34:41,590 --> 00:34:42,620 -So we did a few things. +Hicimos algunas cosas. 793 00:34:42,620 --> 00:34:44,980 -We beefed up our boxes. +Mejoramos nuestras máquinas. 794 00:34:44,980 --> 00:34:47,870 -So Mongo, for us, is -hosted on EC2. +Así que Mongo, para nosotros +está "hosted" en EC2. 795 00:34:47,870 --> 00:34:51,469 -Before, in first gen, we were -using a third-party cloud +Antes, en la primera generación +usábamos un "cloud-hosting" 796 00:34:51,469 --> 00:34:52,980 -hosted service. +ofrecido por terceros. 797 00:34:52,980 --> 00:34:54,550 -We move over to EC2. +Nos movimos a EC2. 798 00:34:54,550 --> 00:34:58,525 -We are running currently -here on quad extra +Estamos corriendo aquí sobre +grandes instancias de memoria 799 00:34:58,525 --> 00:35:00,280 -large memory instances. +"quad extra". 800 00:35:00,280 --> 00:35:03,720 -So we significantly increased -the amount of memory that was +Así que incrementamos significativamente +la cantidad de memoria que nos era 801 00:35:03,720 --> 00:35:04,965 -available to us. +disponible. 802 00:35:04,965 --> 00:35:07,580 -As this collection was growing -larger and larger, it needed +Mientras esta colección crecía +cada vez más, necesitaba 803 00:35:07,580 --> 00:35:12,600 -to be in memory, and as a -result, it was easy for us to +estar en memoria y como +resultado, fue fácil para 804 00:35:12,600 --> 00:35:15,170 -scale vertically just -by provisioning +nosotros escalar verticalmente +simplemente proveyendo hardware 805 00:35:15,170 --> 00:35:16,380 -more significant hardware. +más significativo. 806 00:35:16,380 --> 00:35:16,850 -Right. +Claro. 807 00:35:16,850 --> 00:35:19,555 -Scale up versus scale down. +Escalar hacia arriba en +lugar de hacia abajo. 808 00:35:19,555 --> 00:35:19,850 -Yep. +Sí. 809 00:35:19,850 --> 00:35:20,170 -Versus scale down. +En lugar de escalar hacia abajo. 810 00:35:20,170 --> 00:35:23,970 -You bought bigger hardware, -and solid state disc? +¿Compraron hardware +más grande y SSD? 811 00:35:23,970 --> 00:35:24,960 -Or just regular? +¿O sólo regular? 812 00:35:24,960 --> 00:35:26,710 -I guess solid state just wasn't -available when you-- +Me parece que SSD no estaba +disponible cuando tú-- 813 00:35:26,710 --> 00:35:29,960 -It wasn't available, and I think -there's particular use +No estaba disponible y creo +que hay casos de uso particulares 814 00:35:29,960 --> 00:35:32,330 -cases where you get a -significant benefit from solid +donde te beneficias +significativamente 815 00:35:32,330 --> 00:35:35,840 -state, and for ours, we were -sufficient to stick with EBS. +usando SSDs, pero para nosotros +nos era suficiente usar EBS. 816 00:35:35,840 --> 00:35:37,260 -Right. +Claro. 817 00:35:37,260 --> 00:35:37,910 -We scaled up. +Escalamos hacia arriba. 818 00:35:37,910 --> 00:35:43,010 -We went 4x large memory -instances. +Nos fuimos a instancias +de memoria grandes 4x. 819 00:35:43,010 --> 00:35:45,780 820 00:35:45,780 --> 00:35:52,230 -We did use provisioned IOPS. +Sí usamos IOPS abastecido. 821 00:35:52,230 --> 00:35:56,050 -Provisioned IOPS, which is a -feature of Elastic Block Store +IOPS abastecido, lo cual es una +característica de "Elastic Block 822 00:35:56,050 --> 00:35:57,840 -at Amazon Web Services. +Store" en "Amazon Web Services". 823 00:35:57,840 --> 00:35:58,420 -Yep. +Sí. 824 00:35:58,420 --> 00:36:03,370 -And that guarantees a certain -bandwidth between the EBS +Eso te garantiza cierto ancho +de banda entre el almacén de 825 00:36:03,370 --> 00:36:05,300 -network storage and -your instance. +red EBS y tu instancia. 826 00:36:05,300 --> 00:36:09,060 -If you're on traditional EBS, -there's no guarantee of +Si estás en un EBS tradicional, +no hay garantía de ancho de banda 827 00:36:09,060 --> 00:36:12,700 -bandwidth and it can fluctuate -wildly, which, of course, for +y puede fluctuar sin control, +lo cual, por supuesto, para 828 00:36:12,700 --> 00:36:16,290 -a memory store which should be -memory but isn't always, you +un almacén en memoria que debe +estar en memoria, pero no siempre 829 00:36:16,290 --> 00:36:17,510 -want a guaranteed backup there. +lo está, necesitas un +backup garantiza ahí. 830 00:36:17,510 --> 00:36:18,760 -Right. +Claro. 831 00:36:18,760 --> 00:36:20,520 832 00:36:20,520 --> 00:36:25,840 -We also set up a replica set. +También pusimos un +conjunto de réplicas. 833 00:36:25,840 --> 00:36:26,340 -Right. +Claro. 834 00:36:26,340 --> 00:36:27,170 -Which is a best practice. +Lo cual es la mejor práctica. 835 00:36:27,170 --> 00:36:28,260 -You definitely want to -use a replica set. +Definitivamente necesitas +usar un conjunto de réplicas. 836 00:36:28,260 --> 00:36:28,570 -Right. +Claro. 837 00:36:28,570 --> 00:36:32,740 -So not exactly scaling -horizontally like you would +No escalas horizontalmente +como lo haces con "shards", 838 00:36:32,740 --> 00:36:36,670 -when you shard, but it did -create for us multiple +pero si creó varias +máquinas de las cuales 839 00:36:36,670 --> 00:36:38,390 -machines to read from. +podíamos hacer lecturas. 840 00:36:38,390 --> 00:36:42,965 -Yeah, you decided to read from -your secondaries, which meant +Claro, decidiste leer de +tus secundarios, lo que 841 00:36:42,965 --> 00:36:46,430 -that you're also dealing with -eventual consistency versus +significó que también estás +lidiando con consistencia 842 00:36:46,430 --> 00:36:47,600 -strong consistency. +eventual versus consistencia fuerte. 843 00:36:47,600 --> 00:36:48,600 -Right. +Claro. 844 00:36:48,600 --> 00:36:53,970 -So we had a single primary, -of course, and we had two +Teníamos un solo primario, +por supuesto y dos 845 00:36:53,970 --> 00:36:55,220 -secondaries. +secundarios. 846 00:36:55,220 --> 00:36:57,500 847 00:36:57,500 --> 00:37:01,730 -And we did writes to the -primary, and we did reads from +Y hacíamos escrituras +al primario y lecturas 848 00:37:01,730 --> 00:37:03,740 -the secondary. +de los secundarios. 849 00:37:03,740 --> 00:37:07,470 -And the reason why we did that -was just to guarantee that we +Y la razón por la cuál hicimos +eso fue para garantizar que 850 00:37:07,470 --> 00:37:13,790 -could horizontally scale the -read load, and one machine was +pudiéramos escalar horizontalmente +las lecturas y una máquina era 851 00:37:13,790 --> 00:37:15,775 -more than sufficient to handle -the write load that +suficiente para manejar la carga +de escrituras que teníamos en 852 00:37:15,775 --> 00:37:16,730 -we had at the time. +ese entonces. 853 00:37:16,730 --> 00:37:21,030 -It's primarily a read-heavy -application. +Es principalmente una aplicación +con muchas lecturas. 854 00:37:21,030 --> 00:37:25,560 -And this allowed us to both -ensure that in event of a +Y esto nos ayudaba a asegurar +que en el caso de una falla 855 00:37:25,560 --> 00:37:29,420 -failure that one of the -secondaries would be promoted, +tanto uno de los secundarios +sea promovido, como que 856 00:37:29,420 --> 00:37:31,490 -or in some way the load -would be balanced +la carga sea balanceada si es 857 00:37:31,490 --> 00:37:32,740 -if a secondary failed. +que un secundario fallaba. 858 00:37:32,740 --> 00:37:37,070 -But also, like I said, to -horizontally scale our read +Pero también, como dije, nos +dejaba escalar horizontalmente 859 00:37:37,070 --> 00:37:40,580 -such that if the read load -significantly increased, we +nuestras lecturas de manera que +si la lectura incrementaba 860 00:37:40,580 --> 00:37:43,130 -could continually add -more secondaries. +significativamente, podíamos +agregar más secundarios. 861 00:37:43,130 --> 00:37:43,560 -Yeah. +Claro. 862 00:37:43,560 --> 00:37:47,790 -And there's some debate within -10gen about whether or not +Y hay algo de debate dentro de +10gen sobre si ésta es o no 863 00:37:47,790 --> 00:37:49,870 -this is the best way to scale -reads or whether you'd be +la mejor manera de escalar +lecturas o si estarías mejor 864 00:37:49,870 --> 00:37:51,480 -better off just adding shards. +agregando "shards". 865 00:37:51,480 --> 00:37:52,100 -Yeah. +Sí. 866 00:37:52,100 --> 00:37:53,960 -Aside from the consistency -issues, which is that you have +Dejando de lado los problemas +de consistencia, que es el hecho 867 00:37:53,960 --> 00:37:56,970 -to have your application be -tolerant of reading data +que dejas que tu aplicación +tolere leer datos que pueden 868 00:37:56,970 --> 00:37:59,630 -that's potentially different -than what you wrote. +ser diferentes de +lo que escribiste. 869 00:37:59,630 --> 00:38:02,290 -In terms of slowing down the -secondaries and slowing down +En términos de desacelerar +los secundarios y desacelerar 870 00:38:02,290 --> 00:38:06,080 -replication, you have to make -sure, of course, that from the +la replicación, tienes que asegurarte, +por supuesto, que desde el punto de 871 00:38:06,080 --> 00:38:08,370 -capacity planning standpoint -that these are as large-- +vista de planeamiento de +capacidad, que éstos sea lo 872 00:38:08,370 --> 00:38:13,190 -often, people will buy cheaper -boxes for their secondaries +suficientemente grandes. Frecuentemente +la gente compra máquinas más baratas para 873 00:38:13,190 --> 00:38:17,070 -sometimes, and then they'll have -problems with keeping up +sus secundarios y tienen problemas +manteniendo la replicación si es 874 00:38:17,070 --> 00:38:20,120 -with replication if they load -this guy down with reads. +el la cargan a éste +con lecturas. 875 00:38:20,120 --> 00:38:23,750 -So not everyone recommend that, -but certainly a lot of +No todo el mundo recomienda eso, +pero definitivamente muchos 876 00:38:23,750 --> 00:38:24,740 -users do that. +usuarios lo hacen. 877 00:38:24,740 --> 00:38:29,200 -They scale reads using -replication versus sharding. +Escalan lecturas usando +replicación versus sharding. 878 00:38:29,200 --> 00:38:32,230 -And we talked a little bit about -that in the application +Y hablamos un poco sobre eso +en la parte sobre ingeniería 879 00:38:32,230 --> 00:38:33,050 -engineering part. +de aplicaciones. 880 00:38:33,050 --> 00:38:33,380 -Yeah. +Sí. 881 00:38:33,380 --> 00:38:33,710 -Definitely. +Definitivamente. 882 00:38:33,710 --> 00:38:37,080 -There were some reads that -had to go to the primary. +Había algunas lecturas que +tenían que ir al primario. 883 00:38:37,080 --> 00:38:41,350 -If we needed to guarantee -consistency, we would, instead +Si necesitábamos garantizar +consistencia, en lugar de 884 00:38:41,350 --> 00:38:44,530 -of using the secondary session -configuration, we'd use a +usar una configuración de +sesión secundaria, usábamos 885 00:38:44,530 --> 00:38:48,420 -primary session configuration, -where we'd both write and read +una configuración de sesión +primaria, donde escribíamos 886 00:38:48,420 --> 00:38:49,130 -from the primary. +y leíamos del primario. 887 00:38:49,130 --> 00:38:52,100 -And that was sufficient, but, -of course, like you were +Y eso era suficiente, +pero por supuesto, como 888 00:38:52,100 --> 00:38:54,340 -saying before, it requires that -developers understand the +decías, requiere que los +desarrolladores entiendan 889 00:38:54,340 --> 00:38:57,890 -implementation of the data layer -and understand when you +la implementación de tu capa +de datos y entiendan cuando 890 00:38:57,890 --> 00:38:59,300 -have a guarantee of consistency +tienes una garantía de consistencia 891 00:38:59,300 --> 00:39:00,510 -and when you don't. +y cuando no. 892 00:39:00,510 --> 00:39:01,220 -And, right. +Y, clar., 893 00:39:01,220 --> 00:39:04,790 -It isn't always easy or ideal. +Esto no siempre es fácil o ideal. 894 00:39:04,790 --> 00:39:07,390 -After this, we're very happy -with the implementation-- +Después de esto, estábamos muy +felices con la implementación-- 895 00:39:07,390 --> 00:39:07,880 -Right. +Claro. 896 00:39:07,880 --> 00:39:10,140 -This is generation two. +Ésta es la segunda generación. 897 00:39:10,140 --> 00:39:11,400 -Generation two. +Generación dos. 898 00:39:11,400 --> 00:39:15,720 -We, as we continued to grow, had -to actually look into an +Nosotros, mientras crecíamos, +tuvimos que buscar una manera 899 00:39:15,720 --> 00:39:17,740 -alternative way of scaling -horizontally. +alternativa de escalar +horizontalmente. 900 00:39:17,740 --> 00:39:19,900 -So I think we can spend some -time talking about that. +Creo que podríamos hablar +un poco sobre eso. 901 00:39:19,900 --> 00:39:20,135 -Yeah. +Claro. 902 00:39:20,135 --> 00:39:20,370 -Sure. +Perfecto. 903 00:39:20,370 --> 00:39:24,380 -So we're going to go to -third generation. +Así que vamos a la +tercera generación. 904 00:39:24,380 --> 00:39:27,000 -There were a few things -that we did here. +Hicimos algunas cosas acá. 905 00:39:27,000 --> 00:39:29,460 -This is order of hundreds of -millions of submissions. +Estamos en el order de cientos +de millones de presentaciones. 906 00:39:29,460 --> 00:39:34,040 -So we're starting to get into -some significant storage +Así que estamos necesitando +unos requerimientos de almacenaje 907 00:39:34,040 --> 00:39:35,110 -requirements here, -because these +serio, porque no son simples 908 00:39:35,110 --> 00:39:36,650 -aren't simply log entries. +entradas en un registro. 909 00:39:36,650 --> 00:39:40,770 -These are large documents that -are potentially have an array +Son documentos muy grandes que +potencialmente tiene un array 910 00:39:40,770 --> 00:39:44,710 -of answers that could be -a megabyte or more. +de respuestas que puede +contener un megabyte o más. 911 00:39:44,710 --> 00:39:45,490 -Right. +Claro. 912 00:39:45,490 --> 00:39:48,860 -And as know, there's a hard cap -on the document limit, and +Y como sabemos, hay un límite +fijo para un documento y nuestro 913 00:39:48,860 --> 00:39:51,910 -our content was getting more -complicated, more elaborate, +contenido se estaba volviendo +más complicado, más elaborado, 914 00:39:51,910 --> 00:39:55,410 -complex, and the types of -submissions or answers for +complejo, y los tipos de +presentaciones o respuestas 915 00:39:55,410 --> 00:39:58,150 -that content was similarly -getting more complex. +para el contenido, estaba también +volviéndose más complejo. 916 00:39:58,150 --> 00:40:00,760 -We started introducing web -courses, we started +Comenzamos a introducir +cursos web. Comenzamos 917 00:40:00,760 --> 00:40:01,910 -introducing courses -where people were +a introducir cursos donde +las personas construían 918 00:40:01,910 --> 00:40:03,140 -building actual programs. +programas de verdad. 919 00:40:03,140 --> 00:40:06,690 -And so we started to see that -submissions were increasingly +Entonces vimos que las presentaciones +estaban asemejando cada vea más 920 00:40:06,690 --> 00:40:09,400 -resembling file projects. +archivos de proyectos. 921 00:40:09,400 --> 00:40:10,170 -Right. +Claro. 922 00:40:10,170 --> 00:40:12,840 -And so we were starting to use -Mongo as a file store, which +Entonces comenzamos a usar Mongo +como un almacén de archivos, 923 00:40:12,840 --> 00:40:14,200 -is not its intended purpose. +lo cual no es su propósito. 924 00:40:14,200 --> 00:40:14,900 -Yeah. +Sí. 925 00:40:14,900 --> 00:40:17,510 -There's some GridFS stuff -in there, but yes. +Hay algo de GridFS, claro. 926 00:40:17,510 --> 00:40:19,020 -Personally, I've never -liked storing very +Personalmente, nunca +me ha gustado guardar 927 00:40:19,020 --> 00:40:20,360 -large things in databases. +cosas grandes en +bases de datos. 928 00:40:20,360 --> 00:40:21,916 -I think they're better -off in file systems. +Me parece que están mejor +en sistemas de archivos. 929 00:40:21,916 --> 00:40:22,690 -But. +Pero. 930 00:40:22,690 --> 00:40:23,950 -So, right. +Entonces, claro. 931 00:40:23,950 --> 00:40:27,010 -The first thing that we did here -for the third generation +Lo primero que hicimos aquí +para la tercera generación, 932 00:40:27,010 --> 00:40:32,240 -was take our array of answers -and take the entry field from +fue tomar nuestro array de preguntas +y tomar un campo de entrada de cada 933 00:40:32,240 --> 00:40:35,570 -each of those documents -and store that in S3. +uno de estos documentos +y almacenarlos en S3. 934 00:40:35,570 --> 00:40:42,495 -So we did S3-backed -answer storage. +Así que usamos almacenaje S3 +para las respuestas. 935 00:40:42,495 --> 00:40:45,260 936 00:40:45,260 --> 00:40:48,840 -And so we were treating S3 just -as a key value store. +Y tratamos S3 como un +almacén de clave/valor. 937 00:40:48,840 --> 00:40:52,470 -We used a hash of the contents -so that it was essentially +Usamos un hash de los contenidos +para que estén esencialmente 938 00:40:52,470 --> 00:40:53,720 -guaranteed-- +garantizados-- 939 00:40:53,720 --> 00:40:55,575 940 00:40:55,575 --> 00:40:56,060 -Right. +Claro. 941 00:40:56,060 --> 00:40:58,600 -As free as Amazon Simple Storage -Service, which I'm not +Tan libre como el servicio +"Amazon Simple Storage", del 942 00:40:58,600 --> 00:41:01,340 -sure we've talked about a -tremendous amount, but it lets +cual no estoy seguro de que +hemos hablado mucho, pero 943 00:41:01,340 --> 00:41:03,910 -you store files and guarantees, -pretty much, that +te deja guardar archivos y +garantiza, más que nada, 944 00:41:03,910 --> 00:41:08,080 -you'll get them back, and then -charges you by the byte in +que los puedas recuperar y +luego te cobra por byte en 945 00:41:08,080 --> 00:41:10,430 -terms of what you're storing -per month and also how much +términos de cuánto almacenas +por mes y también de acuerdo 946 00:41:10,430 --> 00:41:12,080 -bandwidth you use from Amazon. +a cuánto ancho de +banda usas de Amazon. 947 00:41:12,080 --> 00:41:13,910 -And it's very, very reliable. +Y es muy muy fiable. 948 00:41:13,910 --> 00:41:16,140 -So you pretty much know you put -something in S3, you're +Así que si pones algo +en S3, sabes que vas 949 00:41:16,140 --> 00:41:17,220 -going to be able to -get it back out. +a poder recuperarlo. 950 00:41:17,220 --> 00:41:17,610 -Right. +Claro. 951 00:41:17,610 --> 00:41:20,830 -And the only major issue with S3 -versus Mongo is, of course, +Y el único problem entre +S3 y Mongo es, por supuesto, 952 00:41:20,830 --> 00:41:22,490 -the latency of retrieval. +la latencia de la recuperación. 953 00:41:22,490 --> 00:41:23,040 -Yes. +Sí. 954 00:41:23,040 --> 00:41:25,970 -Because you're going across the -network and you're using +Porque vas a través de +la red y estás usando 955 00:41:25,970 --> 00:41:29,640 -another service, you have to -factor in the retrieval. +otro servicio tienes que tomar +en cuenta esa recuperación. 956 00:41:29,640 --> 00:41:33,120 -We actually load S3 documents -directly from the browser. +Nosotros cargamos los documentos +S3 directamente del navegador. 957 00:41:33,120 --> 00:41:39,540 -So we do not now include your -submitted entry history in the +Así que ya no incluimos el historial +de tus entradas de presentación en la 958 00:41:39,540 --> 00:41:40,570 -response back. +respuesta. 959 00:41:40,570 --> 00:41:42,750 -As we talked about in the major -application, as you go +Como hablamos, en la +aplicación principal, 960 00:41:42,750 --> 00:41:44,850 -through the application layer -and the API layer. +cuando vas a través de la capa +de la aplicación y de la API, 961 00:41:44,850 --> 00:41:47,420 -We only send back the associated -metadata or store +sólo retornamos los meta +datos asociados o guardamos 962 00:41:47,420 --> 00:41:51,160 -the metadata in the submissions -collection. +los meta datos en la +colección de presentaciones. 963 00:41:51,160 --> 00:41:54,190 -The actual entry itself is -stored in S3, and that +La entrada en sí está en S3 964 00:41:54,190 --> 00:41:56,050 -retrieval happens -on the client. +y esa recuperación +ocurre en el cliente. 965 00:41:56,050 --> 00:42:02,250 -And so that allows us to have -a very quick response cycle. +Así que nos permite tener un +ciclo de respuesta muy rápido. 966 00:42:02,250 --> 00:42:05,610 -So we did S3-backed -answer storage. +Así que usamos un almacén +de respuestas en S3. 967 00:42:05,610 --> 00:42:09,990 -And as a result, our submission -collection both +Y como resultado, nuestra +colección de presentaciones, 968 00:42:09,990 --> 00:42:20,060 -became significantly smaller, -but it also, each of the +se volvió significativamente más +pequeña y también, cada uno de los 969 00:42:20,060 --> 00:42:21,880 -documents in the submission -collection became more +documentos en la colección +de presentaciones de volvió 970 00:42:21,880 --> 00:42:24,760 -consistent in size, so that -significantly increased our +más consistente respecto a su +tamaño, lo que incrementó 971 00:42:24,760 --> 00:42:26,640 -compaction factor. +significativamente nuestro +factor de compactación. 972 00:42:26,640 --> 00:42:30,200 -And so as a result, we got an -even larger essentially, +Entonces, como resultado, +obtuvimos un incremento o 973 00:42:30,200 --> 00:42:34,210 -increase or benefit in the -decrease of the collection +una mejora aún más grande +con la reducción del tamaño 974 00:42:34,210 --> 00:42:35,925 -size, which was quickly -ballooning. +de la colección, la cual estaba +creciendo muy rápidamente. 975 00:42:35,925 --> 00:42:39,766 976 00:42:39,766 --> 00:42:43,670 -So in generation two, did you -eventually go to a sharded +Así que en la segunda generación, +¿eventualmente usaron una 977 00:42:43,670 --> 00:42:45,460 -configuration? +configuración con "shards"? 978 00:42:45,460 --> 00:42:47,350 -This is generation -three, right? +Ésta es la tercera +generación, ¿no? 979 00:42:47,350 --> 00:42:47,610 -Yeah. +Sí. 980 00:42:47,610 --> 00:42:49,020 -This is generation three. +Ésta es la tercera generación. 981 00:42:49,020 --> 00:42:51,850 -So in generation two, so the -documents are growing pretty +En la generación dos, los +documentos están creciendo 982 00:42:51,850 --> 00:42:55,250 -fast because you're storing -all the responses in this +muy rápido porque estás guardando +todas las respuestas en este array 983 00:42:55,250 --> 00:42:57,940 -answers array, and -the exercises are +de respuestas y los ejercicios 984 00:42:57,940 --> 00:42:59,220 -getting more complex. +están volviéndose +más complejos. 985 00:42:59,220 --> 00:43:02,070 -And so the amount of information -stored for each of +Y toda la información guardada +para cada una de las respuestas 986 00:43:02,070 --> 00:43:03,370 -the answers is growing. +está creciendo. 987 00:43:03,370 --> 00:43:09,260 -And after you moved to a -replicated environment where +Y después de que se movieron +a un ambiente replicado, donde 988 00:43:09,260 --> 00:43:12,080 -you're setting your writes to -your primary and your reads to +haces tus escrituras a tu +primario y tus lecturas de 989 00:43:12,080 --> 00:43:12,990 -your secondaries-- +tus secundarios-- 990 00:43:12,990 --> 00:43:16,230 -you told me before, we were -talking beforehand, that you +me dijiste antes, cuando hablamos +anteriormente, que eventualmente 991 00:43:16,230 --> 00:43:18,040 -eventually got to the point -where even that wasn't enough +llegaron al punto donde +hasta eso no era suficiente 992 00:43:18,040 --> 00:43:20,120 -and you decided to -shard the system. +y decidieron usar +"shards" en el sistema. 993 00:43:20,120 --> 00:43:23,410 -So can you talk a little bit -about the sharding you did and +¿Puedes hablar un poco sobre +el "sharding" que hicieron y 994 00:43:23,410 --> 00:43:26,820 +la clave de "shard" que escogieron +y cómo pensaron sobre ello? the shard key you chose and your thinking behind that? 995 00:43:26,820 --> 00:43:27,280 -Certainly. +Por supuesto. 996 00:43:27,280 --> 00:43:32,280 -So we had a submissions -collection which was very +Teníamos una colección +de presentaciones que 997 00:43:32,280 --> 00:43:33,630 -rapidly growing. +estaba creciendo rápidamente. 998 00:43:33,630 --> 00:43:36,790 -And, of course, when you have -a collection that's growing +Y por supuesto, cuando +tienes una colección que 999 00:43:36,790 --> 00:43:39,180 -both in volume and size and -you're starting to overload +está creciendo en volumen y +tamaño y comienzas a sobrecargar 1000 00:43:39,180 --> 00:43:44,180 -your machines, one of the, I -think, more common solutions +tus máquinas, una de las soluciones +más comunes para este problema, 1001 00:43:44,180 --> 00:43:45,400 -to the problem is sharding-- +pienso yo, es hacer "sharding". 1002 00:43:45,400 --> 00:43:48,030 -meaning that you're going to -split your collection across +Es decir, que vas a dividir +tu colección a través de 1003 00:43:48,030 --> 00:43:49,320 -multiple machines. +múltiples máquinas. 1004 00:43:49,320 --> 00:43:51,990 -And you need to split that -collection by a shard key. +Y tienes que dividir esa colección +usando una clave de "shard". 1005 00:43:51,990 --> 00:43:54,240 -And I don't know how much detail -you guys have gone into +Y no sé en cuánto detalle han +entrado respecto a cómo escoger 1006 00:43:54,240 --> 00:43:56,260 -about covering how to choose -your shard key. +tu clave de "shard". 1007 00:43:56,260 --> 00:43:57,080 -We did. +Sí lo cubrimos. 1008 00:43:57,080 --> 00:43:59,550 -And we talked about that last -week from a developer's +Y hablamos sobre esto la semana +pasada desde el punto de vista 1009 00:43:59,550 --> 00:44:00,380 -standpoint. +de un desarrollador. 1010 00:44:00,380 --> 00:44:02,650 -We haven't really gone over -extensively how to set up +No hemos cubierto extensivamente +cómo hacer una configuración de 1011 00:44:02,650 --> 00:44:05,500 -sharding configurations, which -is more of a DBA topic, but we +sharding, lo cual es más un +tema para DBAs, pero sí hablamos 1012 00:44:05,500 --> 00:44:08,850 -did talk about shard key -selection and criteria. +sobre la selección y los +criterio de las claves de "shard". 1013 00:44:08,850 --> 00:44:11,310 -So what did what you guys -choose and what was your +¿Qué escogieron ustedes +y cuál fue su razonamiento 1014 00:44:11,310 --> 00:44:12,110 -thinking behind it? +para dicha decisión? 1015 00:44:12,110 --> 00:44:14,470 -So we chose-- +Escogimos-- 1016 00:44:14,470 --> 00:44:16,080 -and this, I guess, was -somewhat naively. +y creo que fue +algo ingenuo. 1017 00:44:16,080 --> 00:44:18,750 -This was an experiment -in sharding. +Fue un experimento de "sharding". 1018 00:44:18,750 --> 00:44:22,280 -We wanted to see if this was a -valid solution to the problem. +Queríamos ver si era una +solución válida para el problema. 1019 00:44:22,280 --> 00:44:25,420 -And when you pick a shard key, -you both want something that's +Y cuando escoges una clave de "shard" +quieres que sea algo que no sea 1020 00:44:25,420 --> 00:44:29,300 -not monotonically increasing, -that has a random distribution +monótonamente creciente, que +tenga distribución aleatoria 1021 00:44:29,300 --> 00:44:36,340 -across whatever its range is, -and you also want, ideally, +de acuerdo a cualquiera que +sea su rango y también quieres, 1022 00:44:36,340 --> 00:44:39,520 -locality querying. +idealmente, localizar +las consultas. 1023 00:44:39,520 --> 00:44:43,550 -If you're going to be querying -multiple documents, you want, +Si vas a hacer consultas a +múltiples documentos, vas a 1024 00:44:43,550 --> 00:44:46,080 -ideally, them to come from the -same box or at least to be +querer, idealmente, que vengan +de la misma máquina o por lo 1025 00:44:46,080 --> 00:44:47,970 -fresh in memory. +menos que estén +frescos en memoria. 1026 00:44:47,970 --> 00:44:51,740 -For us, that was really across -the user ID because we would +Para nosotros, eso era en verdad +a través del ID del usuario porque 1027 00:44:51,740 --> 00:44:54,140 -never, for a single exercise, -loads submissions across +nunca, para un sólo ejercicio, +cargaríamos presentaciones de 1028 00:44:54,140 --> 00:44:56,630 -multiple users. +múltiples usuarios. 1029 00:44:56,630 --> 00:44:58,510 -It would always be for a single -user, and it might +Siempre sería para un solo +usuario y podría potencialmente 1030 00:44:58,510 --> 00:45:01,500 -potentially be across -multiple exercises. +ser a través de +múltiples ejercicios. 1031 00:45:01,500 --> 00:45:04,620 -And so for us, it was really -only two machines. +Así que para nosotros, en +verdad eran sólo dos máquinas. 1032 00:45:04,620 --> 00:45:10,100 -We noticed that there was an -even distribution of access. +Notamos que había distribución +pareja de acceso. 1033 00:45:10,100 --> 00:45:13,770 -Also a user who's currently very -active will be active in +También un usuario que actualmente +está muy activo, va a estar activo 1034 00:45:13,770 --> 00:45:18,510 -the next few moments, and so -its fresh in memory and it +por los siguientes momentos, +así que se sienta en memoria 1035 00:45:18,510 --> 00:45:19,530 -worked pretty well. +y funcionaba muy bien. 1036 00:45:19,530 --> 00:45:23,990 -We weren't so happy with how -quickly the submission +No estábamos tan felices con +lo rápido que la colección 1037 00:45:23,990 --> 00:45:27,340 -collection was growing, just -in raw size, and not +de presentaciones estaba +creciendo, respecto sólo al 1038 00:45:27,340 --> 00:45:31,660 -necessarily in the number of -cardinality of the set. +tamaño y no necesariamente a +la cardinalidad del conjunto. 1039 00:45:31,660 --> 00:45:35,630 -And so, for us, we thought that -sharding did give us the +Entonces, para nosotros, pensamos +que el "sharding" nos daba el 1040 00:45:35,630 --> 00:45:38,060 -benefit of distributing this -collection across multiple +beneficio de distribuir esta +colección a través de múltiples 1041 00:45:38,060 --> 00:45:41,480 -machines and the resources of -each, but we thought that +máquinas y los recursos de +cada una, pero pensamos que 1042 00:45:41,480 --> 00:45:43,510 -there might be a better solution -to the type of +tal vez habría una mejor +solución al tipo de problema 1043 00:45:43,510 --> 00:45:44,860 -problem that we were facing. +que estábamos teniendo. 1044 00:45:44,860 --> 00:45:46,860 -That problem is, essentially, -that we were treating MongoDB +Ése problema era, esencialmente +que estábamos tratando a MongoDB 1045 00:45:46,860 --> 00:45:50,530 -as a file store for the -submitted answers. +como un almacén de archivos +para las repuestas presentadas. 1046 00:45:50,530 --> 00:45:53,350 -So are you saying that you -experimented, set up some +¿Así que estás diciendo que +experimentaron, plantearon 1047 00:45:53,350 --> 00:45:55,580 -experimental configurations that -were sharded but never +configuraciones experimentales +que tenían "shards", pero nunca 1048 00:45:55,580 --> 00:45:57,640 -went live with the sharding -configuration for the users? +las usaron en producción con +"sharding" para los usuarios? 1049 00:45:57,640 --> 00:45:59,660 -Or you did go live with the -sharded configuration? +¿O la usaron en producción? 1050 00:45:59,660 --> 00:46:00,590 -We did go live. +¿Sí la usamos en producción? 1051 00:46:00,590 --> 00:46:02,465 -This is before we hit the-- +Esto fue antes de que llegamos-- 1052 00:46:02,465 --> 00:46:04,550 -I think there's some -arbitrary shard +creo que hay un tope arbitrario 1053 00:46:04,550 --> 00:46:07,030 -cap of like 120 gigabytes. +de cada shard de como 120 gigabytes. 1054 00:46:07,030 --> 00:46:07,980 -I'm not sure. +No estoy seguro. 1055 00:46:07,980 --> 00:46:10,570 -There's a collection -cap before you +Hay un límite para las +colecciones antes de que 1056 00:46:10,570 --> 00:46:13,800 -can shard it naively. +puedas hacerle "shard" ingenuamente. 1057 00:46:13,800 --> 00:46:15,960 -And so before we hit that, we -wanted to experiment and see +Entonces, antes de que llegamos +a ese tope, queríamos experimentar 1058 00:46:15,960 --> 00:46:17,720 -is this a solution that we -wanted to commit to. +y ver si era la solución con la +que nos queríamos comprometer. 1059 00:46:17,720 --> 00:46:20,010 -It's something that -we looked into. +Es algo que queríamos ver. 1060 00:46:20,010 --> 00:46:23,800 -Once we started experimenting -with it, I think we realized +Una vez que comenzamos a +experimentar nos dimos 1061 00:46:23,800 --> 00:46:27,170 -that there was a better solution -for us, particularly. +cuenta de que había una mejor +solución para nosotros en particular. 1062 00:46:27,170 --> 00:46:27,960 @@ -4910,204 +4888,205 @@ OK. 1063 00:46:27,960 --> 00:46:32,610 -So and when you went to a -sharded environment, you had +¿Así que cuando fueron a +un ambiente con "shards" 1064 00:46:32,610 --> 00:46:33,920 -sharded replica sets? +tenían "shards" con +conjuntos de réplicas? 1065 00:46:33,920 --> 00:46:35,130 -Is that what you did? +¿Eso fue lo que hicieron? 1066 00:46:35,130 --> 00:46:35,410 -Yeah. +Sí. 1067 00:46:35,410 --> 00:46:37,995 -We did a sharded replicants -sets. +Hicimos "shards" con +conjuntos de réplicas. 1068 00:46:37,995 --> 00:46:42,280 -It was just two shards. +Eran sólo dos "shards". 1069 00:46:42,280 --> 00:46:45,650 -You have your Mongo S, right? +Tenían su mongos, ¿no? 1070 00:46:45,650 --> 00:46:47,340 -I'll draw this over here. +Lo voy a dibujar acá. 1071 00:46:47,340 --> 00:46:53,990 1072 00:46:53,990 --> 00:47:00,340 -You have your Mongo S. And we -had two shard configurations. +Tienes tu mongos y ahora tenemos +dos configuraciones de "shard". 1073 00:47:00,340 --> 00:47:03,460 -Each has a primary. +Cada una tiene un primario. 1074 00:47:03,460 --> 00:47:05,525 -And then those were backed -by just two secondaries. +Y luego estos estaban respaldados +por sólo dos secundarios. 1075 00:47:05,525 --> 00:47:10,170 1076 00:47:10,170 --> 00:47:14,190 -And this was, I think, -pretty standard. +Y eso era, creo yo, muy estándar. 1077 00:47:14,190 --> 00:47:16,580 -We were just trying to get a -configuration that could scale +Simplemente estábamos tratando +de obtener una configuración que 1078 00:47:16,580 --> 00:47:18,400 -horizontally as we wanted to. +escale horizontalmente de +la manera que queríamos. 1079 00:47:18,400 --> 00:47:21,090 -But obviously, you're -essentially doubling your +Pero obviamente estás +duplicando tu número 1080 00:47:21,090 --> 00:47:22,810 -machine count. +de máquinas. 1081 00:47:22,810 --> 00:47:27,650 -We didn't feel like this was -necessarily the most efficient +No pensamos que era necesariamente +la manera más eficaz de solucionar 1082 00:47:27,650 --> 00:47:30,610 -solution to the problem, and -we were trying to identify +el problema y estábamos +tratando de identificar 1083 00:47:30,610 --> 00:47:32,280 -what really was our problem. +cuál era nuestro +verdadero problema. 1084 00:47:32,280 --> 00:47:36,520 -Our real problem was that the -size of the answer entries +Nuestro verdadero problema +era que el tamaño de las 1085 00:47:36,520 --> 00:47:39,200 -varied wildly. +entradas variaba de +manera descontrolada. 1086 00:47:39,200 --> 00:47:43,840 -We also treated submissions as -primarily read-heavy and not +También tratábamos a las presentaciones +como principalmente cargadas con lecturas 1087 00:47:43,840 --> 00:47:50,350 -write-heavy, so we didn't need -high level performance on +y no con escrituras, así que no +necesitábamos el rendimiento 1088 00:47:50,350 --> 00:47:51,850 -submission reads. +en lecturas de presentaciones. 1089 00:47:51,850 --> 00:47:52,300 -Right. +Claro. 1090 00:47:52,300 --> 00:47:54,440 -Actually, you don't read -them that often, so. +En verdad, no las lees +tan frecuentemente, entonces. 1091 00:47:54,440 --> 00:47:55,010 -Yeah. +Claro. 1092 00:47:55,010 --> 00:48:00,450 -As we talked about for the -flow of the request, +Como hablamos respecto al +flujo de la petición, 1093 00:48:00,450 --> 00:48:02,410 -essentially it's -mostly writes. +esencialmente son escrituras. 1094 00:48:02,410 --> 00:48:02,690 -Yeah. +Sí. 1095 00:48:02,690 --> 00:48:04,880 -You don't even need to read -the previous historical +Ni siquiera tienes que leer +la respuesta previa para 1096 00:48:04,880 --> 00:48:06,350 -response to take a new one. +tomar una nueva. 1097 00:48:06,350 --> 00:48:07,090 -Yeah. +Claro. 1098 00:48:07,090 --> 00:48:10,592 -Part of the solution here -before that we that we +Parte de la solución aquí, +fue que denormalizamos 1099 00:48:10,592 --> 00:48:15,410 -denormalized a lot of the -progress information of a user +mucha de la información sobre +el progreso de un usuario a 1100 00:48:15,410 --> 00:48:16,660 -through content. +través del contenido. 1101 00:48:16,660 --> 00:48:18,600 1102 00:48:18,600 --> 00:48:20,242 -That's, of course, -very read-heavy. +Eso es muy cargado en lecturas. 1103 00:48:20,242 --> 00:48:22,770 -As you're showing a user -his progress, you don't +Mientras le muestras al usuario +su progreso, no necesariamente 1104 00:48:22,770 --> 00:48:26,010 -necessarily need to retrieve the -submitted documents, but +tienes que recuperar todos +los documentos presentados, 1105 00:48:26,010 --> 00:48:28,460 -you do need to retrieve whether -or not the user has +pero sí saber si es que +el usuario ha completado 1106 00:48:28,460 --> 00:48:32,210 -completed the content, to what -extent, information like that. +o no el contenido, con cuánto +alcance, ése tipo de información. 1107 00:48:32,210 --> 00:48:35,000 -We denormalize into another -collection. +La podíamos desnormalizar +a otra colección. 1108 00:48:35,000 --> 00:48:35,820 @@ -5115,203 +5094,206 @@ OK. 1109 00:48:35,820 --> 00:48:39,546 -So experiments with sharding -found you didn't need it after +Entonces los experimentos con +sharding señalaron que no lo 1110 00:48:39,546 --> 00:48:41,970 -you moved to S3, and then moved -to what we'll call the +necesitabas después de que +se movieron a S3 y luego a 1111 00:48:41,970 --> 00:48:48,960 -third generation, which uses -S3 for those documents, and +lo que llamamos la tercera +generación, que usa S3 para 1112 00:48:48,960 --> 00:48:49,930 -the documents are a -lot more compact. +esos documentos y los documentos +son mucho más compactos. 1113 00:48:49,930 --> 00:48:52,170 -And now you've moved back to a -situation where you're using +Y ahora que han regresado a +una situación donde usan 1114 00:48:52,170 --> 00:48:54,480 -replica sets, and you basically -have a single +conjuntos de réplicas, +básicamente tienen un 1115 00:48:54,480 --> 00:48:58,580 -replica set, and it's performing -well enough to +solo conjunto de réplicas y +funciona lo suficientemente bien 1116 00:48:58,580 --> 00:48:59,700 -serve the whole system. +para servir a todo el sistema. 1117 00:48:59,700 --> 00:49:00,080 -Yeah. +Sí. 1118 00:49:00,080 --> 00:49:02,050 -A single replica set. +Un solo conjunto de réplicas. 1119 00:49:02,050 --> 00:49:04,920 -So we did move back from the -sharded configuration, as you +Sí regresamos de la configuración +con "shards", como dijiste, a 1120 00:49:04,920 --> 00:49:07,600 -said, to a single primary -and two secondaries. +tener un solo primario +con dos secundarios. 1121 00:49:07,600 --> 00:49:12,270 -Both still quad, large memory -instances on EC2. +Ambos aún instancias quad, +de gran memoria en EC2. 1122 00:49:12,270 --> 00:49:17,980 -But we're able to keep our -active set in memory without +Pero logramos tener nuestro +set activo en memoria sin 1123 00:49:17,980 --> 00:49:18,990 -any serious issues. +ningún problema serio. 1124 00:49:18,990 --> 00:49:22,810 -We haven't needed to set -up a caching layer. +No hemos necesitado configurar +una capa de cache. 1125 00:49:22,810 --> 00:49:26,730 -We've always tried to maintain -a policy of the simplest +Siempre hemos tratado de +mantener la política de 1126 00:49:26,730 --> 00:49:28,080 -solution is the best solution. +la solución más +simple es la mejor. 1127 00:49:28,080 --> 00:49:28,450 -Yeah. +Sí. 1128 00:49:28,450 --> 00:49:31,580 -And for us, it's been incredibly -performant. +Y para nosotros, nos ha +dado muy buen rendimiento. 1129 00:49:31,580 --> 00:49:34,050 -We will need to shard -at some point. +Vamos a necesitar hacer +"shards" en algún punto. 1130 00:49:34,050 --> 00:49:35,570 -That moment isn't now. +Pero no ahora. 1131 00:49:35,570 --> 00:49:39,420 -And it's clear, I think, that -the submissions collection +Y nos es claro, creo, que +la colección de presentaciones. 1132 00:49:39,420 --> 00:49:41,830 -will be one of the first -collections to be sharded. +Será una de las primeras +en tener "shards". 1133 00:49:41,830 --> 00:49:45,220 -But moving to S3 for us, at -the moment, was a pretty +Pero movernos a S3 para nosotros +en este momento, fue un triunfo 1134 00:49:45,220 --> 00:49:47,520 -significant win. +significativo. 1135 00:49:47,520 --> 00:49:48,490 -Yeah. +Claro. 1136 00:49:48,490 --> 00:49:52,680 -And in terms of your replicated -environment, have +Y en términos de tu +ambiente replicado, 1137 00:49:52,680 --> 00:49:55,526 -you found that you have to be -cognizant of the fact that +has encontrado que tienes +que estar consciente del 1138 00:49:55,526 --> 00:49:57,810 -you're in a replicated -environment or has it been +hecho que estás en un +ambiente con réplicas 1139 00:49:57,810 --> 00:50:01,720 -transparent to the developer? +o ha sido transparente +para el desarrollador? 1140 00:50:01,720 --> 00:50:04,480 -So, as we mentioned before, you -do you have to be aware, +Como mencionamos, tienes +que estar consciente, porque 1141 00:50:04,480 --> 00:50:07,625 -because we have writes to -primary and we have writes +tenemos escrituras al +primario y lecturas 1142 00:50:07,625 --> 00:50:08,060 -from secondary. +desde el secundario. 1143 00:50:08,060 --> 00:50:09,190 -Oh, there is that. +Ah claro, tienes eso. 1144 00:50:09,190 --> 00:50:09,890 -You have to be aware of that. +Tienes que estar +consciente de eso. 1145 00:50:09,890 --> 00:50:12,210 -I wasn't sure if you were still -doing that now that you +No estaba seguro si todavía +lo estaban haciendo ahora que 1146 00:50:12,210 --> 00:50:14,840 -realized you're more write-heavy -than read-heavy. +se dieron cuenta que están más +cargados de escrituras que de lecturas. 1147 00:50:14,840 --> 00:50:16,530 -So you still continue to send -you reads through your +Así que aún continúan a enviar +las lecturas a través de los 1148 00:50:16,530 --> 00:50:17,050 -secondaries. +secundarios. 1149 00:50:17,050 --> 00:50:18,960 -Well, the submission collection -is write-heavy. +Bueno, la colección de presentaciones +está cargada de escrituras. 1150 00:50:18,960 --> 00:50:21,710 -The majority of the other -collections are read-heavy. +La mayoría de las otras +están cargadas de lecturas. 1151 00:50:21,710 --> 00:50:22,623 -Ive got you. +Te entiendo. 1152 00:50:22,623 --> 00:50:23,470 @@ -5319,85 +5301,83 @@ OK. 1153 00:50:23,470 --> 00:50:24,290 -All right. +Muy bien. 1154 00:50:24,290 --> 00:50:28,410 -So there's that level -of awareness. +Así que tienen que estar +conscientes a ese nivel. 1155 00:50:28,410 --> 00:50:31,710 -You run with Safe Mode -equals true? +¿Ejecutan con "Safe Mode" en "true"? 1156 00:50:31,710 --> 00:50:34,070 -That's actually changed with the -most recent drivers, but +Eso ha cambiado ahora con los +drivers más recientes, pero 1157 00:50:34,070 --> 00:50:36,020 -you obviously got started -much earlier than that. +obviamente ustedes comenzaron +mucho antes que eso. 1158 00:50:36,020 --> 00:50:36,710 -Yeah. +Sí. 1159 00:50:36,710 --> 00:50:38,780 -If we're going to walk away -from the submission +Si nos vamos a alejar +un poco de la colección 1160 00:50:38,780 --> 00:50:39,540 -collection-- +de presentaciones-- 1161 00:50:39,540 --> 00:50:40,790 -I speak a little bit -more generally-- +voy a hablar de una manera +un poco más general-- 1162 00:50:40,790 --> 00:50:44,020 1163 00:50:44,020 --> 00:50:49,270 -any kind of stateful information -that the user +para cualquier tipo de información +de estado que el usuario 1164 00:50:49,270 --> 00:50:53,380 -would notice if it was to not -persist, or disappear, we +percibiría si es que no +persiste o desaparece, 1165 00:50:53,380 --> 00:50:54,870 -certainly use Safe Mode. +definitivamente usamos "Safe Mode". 1166 00:50:54,870 --> 00:51:00,240 -For a lot of the activity -logging or the more +Para mucha de la actividad de +registros o de las escrituras 1167 00:51:00,240 --> 00:51:04,600 -event-based writes that the -application performs, we +basadas en eventos que la +aplicación utiliza, deshabilitamos 1168 00:51:04,600 --> 00:51:07,500 -disable Safe Mode or -we'll optimize for +el "Safe Mode" u optimizamos 1169 00:51:07,500 --> 00:51:10,130 -just insertion speed. +para la velocidad de inserción. 1170 00:51:10,130 --> 00:51:10,960 -I've got you. +Te entiendo. 1171 00:51:10,960 --> 00:51:12,090 @@ -5405,97 +5385,97 @@ OK. 1172 00:51:12,090 --> 00:51:15,800 -So if it's more analytics or -something, then you'll-- +Así que si es más sobre información +analítica o al por el estilo, entonces-- 1173 00:51:15,800 --> 00:51:16,270 -Yeah. +Claro. 1174 00:51:16,270 --> 00:51:18,490 -We'll store additional -information on top of +Almacenamos información +adicional sobre las 1175 00:51:18,490 --> 00:51:23,200 -submissions, like general -information about how the +presentaciones, como información +general sobre cómo el usuario 1176 00:51:23,200 --> 00:51:26,430 -user's interacting with the -site, where they're going, how +interactúa con el sitio, +a dónde va, cómo está 1177 00:51:26,430 --> 00:51:28,460 -they're spending time on it. +pasando el tiempo. 1178 00:51:28,460 --> 00:51:30,220 -We store a lot of that -also in Mongo. +También guardamos +mucho de eso en Mongo. 1179 00:51:30,220 --> 00:51:32,730 1180 00:51:32,730 --> 00:51:36,040 -But, for the most part, for -that, we're using drivers and +Pero, mayormente usamos +los drivers para eso y 1181 00:51:36,040 --> 00:51:42,690 -we're very specific about our -insertion strategy around that +somos muy específicos sobre +nuestra estrategia de inserción 1182 00:51:42,690 --> 00:51:44,160 -type of information. +respecto a ese tipo +de información. 1183 00:51:44,160 --> 00:51:44,990 -Right. +Claro. 1184 00:51:44,990 --> 00:51:47,400 -So let's talk a little bit about -scaling and the way you +Entonces hay que hablar un poco +sobre escalar y la manera en que 1185 00:51:47,400 --> 00:51:50,950 -do capacity planning and other -things of that nature. +hacen planeamiento de capacidad +y otros cosas de esa naturaleza. 1186 00:51:50,950 --> 00:51:54,670 -So, first of all, you said you -were running on a 4x large. +Primeramente, dijiste que +están ejecutando en un 4x grande. 1187 00:51:54,670 --> 00:51:55,685 -Your replicas are the same? +¿También para tus réplicas? 1188 00:51:55,685 --> 00:51:58,090 -Are they all the same machine? +¿Son todas máquinas iguales? 1189 00:51:58,090 --> 00:51:59,580 -Primaries and secondaries -run on the same +Los primarios y secundarios están en 1190 00:51:59,580 --> 00:52:00,675 -instance type on EC2. +el mismo tipo de instancia en EC2. 1191 00:52:00,675 --> 00:52:01,170 -Same instance type. +Mismo tipo de instancia. 1192 00:52:01,170 --> 00:52:02,440 -Yep. +Sí. 1193 00:52:02,440 --> 00:52:03,660 @@ -5503,720 +5483,711 @@ OK. 1194 00:52:03,660 --> 00:52:07,500 -And if you want to add -more capacity, how do +Y si quieres agregar +más capacida, ¿cómo 1195 00:52:07,500 --> 00:52:09,210 -you go about that? +lo haces? 1196 00:52:09,210 --> 00:52:14,070 -So they weren't always -quad extra larges. +So siempre fueron +"quads" extra grandes. 1197 00:52:14,070 --> 00:52:16,876 -We had to upgrade, and we wanted -to upgrade in such a +Tuvimos que hacer una mejora +y queríamos hacerla de tal 1198 00:52:16,876 --> 00:52:18,670 -way that we didn't have -any downtime. +manera que no tengamos +ningún tiempo inactivo. 1199 00:52:18,670 --> 00:52:23,270 -And to do that, Mongo allows you -to switch into a replica +Para hacer eso, Mongo te permite +cambiar a una configuración 1200 00:52:23,270 --> 00:52:27,570 -set configuration, but you do -you have to, essentially, take +de conjunto de réplicas, pero +sí tienes que, esencialmente, 1201 00:52:27,570 --> 00:52:31,160 -the site down and turn off your -database at least for a +apagar el sitio y apagar la +base de datos por lo menos 1202 00:52:31,160 --> 00:52:32,260 -brief moment. +por un breve momento. 1203 00:52:32,260 --> 00:52:34,720 -So when we switched from a -single instance to a replica +Así que cuando cambiamos +de una sola instancia a 1204 00:52:34,720 --> 00:52:37,980 -set configuration, we did have -to bring the site down. +una configuración de conjunto de +réplicas sí apagamos el sitio. 1205 00:52:37,980 --> 00:52:42,300 -Between when you have a replica -configuration and we +Entre tener la configuración +de réplicas y querer actualizar 1206 00:52:42,300 --> 00:52:44,490 -wanted to upgrade our boxes, -what we would do is we would +las máquinas, lo que hicimos es 1207 00:52:44,490 --> 00:52:49,800 -add a larger provisioned -instance as a secondary, then +agregar una instancia abastecida +más grande como un secundario y 1208 00:52:49,800 --> 00:52:54,770 -have that new instance be -brought up to date through +hacer que esa instancia sea +puesta al día a través de 1209 00:52:54,770 --> 00:52:57,560 -replication across -the replica set. +la replicación del conjunto. 1210 00:52:57,560 --> 00:53:02,680 -Once it was synced up, we would -then demote the primary, +Una vez que estuvo sincronizada +degradamos el primario y pusimos 1211 00:53:02,680 --> 00:53:05,350 -and we would set the priority -flag in the new instance +la señal de prioridad en +la nueva instancia del 1212 00:53:05,350 --> 00:53:09,540 -secondary so that it would -assume responsibility for +secundario para que +asuma la responsabilidad 1213 00:53:09,540 --> 00:53:10,170 -being the primary. +de ser primario. 1214 00:53:10,170 --> 00:53:12,630 -So pretty seamless, actually. +Ocurrió sin interrupciones en verdad. 1215 00:53:12,630 --> 00:53:14,630 -Yeah. +Sí. 1216 00:53:14,630 --> 00:53:16,225 -And not a lot of downtime. +Y sin mucho tiempo +de inactividad. 1217 00:53:16,225 --> 00:53:19,000 -It could potentially be almost -no downtime right except for +Podría potencialmente tener ningún +tiempo inactivo excepto por el 1218 00:53:19,000 --> 00:53:21,470 -the time when you're just -transitioning and when you +momento en que estás haciendo +la transición y cuando degradas 1219 00:53:21,470 --> 00:53:24,220 -step down the primary to -bring the secondary up. +al primario para +promover al secundario. 1220 00:53:24,220 --> 00:53:24,710 -Yeah. +Sí. 1221 00:53:24,710 --> 00:53:26,810 -If you're patient, I think. +Y si eres paciente, creo. 1222 00:53:26,810 --> 00:53:29,600 -It's certainly faster to -sometimes take the site down, +Es de seguro más rápido a +veces apagar el sitio, 1223 00:53:29,600 --> 00:53:33,930 -and if you have EBS back-storage -to unmount it +y si tienes almacén EBS, +desmontarlo de una instancia 1224 00:53:33,930 --> 00:53:37,110 -from one instance, remount -it to another. +y remontarlo en otra. 1225 00:53:37,110 --> 00:53:39,345 -If you're pressed for time, -that's a quick option. +Sí estás apurado, ésa +es la opción rápida. 1226 00:53:39,345 --> 00:53:44,060 -If you're not pressed for time -and you've properly planned +Pero si no estás apurado y lo +has planeado correctamente 1227 00:53:44,060 --> 00:53:46,970 -things out and you see the trend -or the writing on the +y ves la tendencia o la +señal de advertencia, 1228 00:53:46,970 --> 00:53:50,100 -wall, then, yeah, you can, -potentially, of course, expand +pues entonces, sí, puedes, +potencialmente, expandir 1229 00:53:50,100 --> 00:53:51,850 -your capacity without -any downtime. +tu capacidad sin +tiempo de inactividad. 1230 00:53:51,850 --> 00:53:52,650 -Right. +Claro. 1231 00:53:52,650 --> 00:53:57,930 -So taking the server down, -attaching the EBS store to a +Entonces, apagar el servidor +y montar el almacén EBS a una 1232 00:53:57,930 --> 00:54:02,630 -new box results in more -downtime but a shorter +nueva máquina resulta en +más tiempo de baja pero en 1233 00:54:02,630 --> 00:54:04,610 -duration of time from the time -you make the decision to do +menos tiempo desde el momento +en que tomas la decisión de 1234 00:54:04,610 --> 00:54:06,330 -this to the time you'll -be up with a new box. +hacer esto y el momento +en que tienes la nueva máquina. 1235 00:54:06,330 --> 00:54:06,680 -Yeah. +Sí. 1236 00:54:06,680 --> 00:54:11,050 -Replication, especially for a -data set that's significantly +La replicación, especialmente +para un conjunto de datos que 1237 00:54:11,050 --> 00:54:13,570 -sized, can take a long time. +tiene un tamaño significativo, +puede tomar mucho tiempo. 1238 00:54:13,570 --> 00:54:14,900 -It could take hours. +Puede tomar horas. 1239 00:54:14,900 --> 00:54:17,270 -Do you copy over the data -files first and then do +¿Copias los archivos primero +y luego haces la replicación 1240 00:54:17,270 --> 00:54:19,460 -replication or do you -just let the whole +o dejas que la replicación +haga todo el proceso 1241 00:54:19,460 --> 00:54:20,090 -replication catch up? +de sincronizar? 1242 00:54:20,090 --> 00:54:22,310 -We've done both. +Hemos hecho ambos. 1243 00:54:22,310 --> 00:54:25,580 -We've tried our syncing -across the network +Hemos tratado de sincronizar +a través del ancho de banda 1244 00:54:25,580 --> 00:54:26,660 -bandwidth or the writes. +de la red, o de las escritura. 1245 00:54:26,660 --> 00:54:29,400 -If you have provisioned IOPS, -it's a lot better. +Si tienes IOPS abastecido, +es mucho mejor. 1246 00:54:29,400 --> 00:54:32,600 -If you're replicating across -provision IOPS instances from +Si estás replicando a través +de instancias abastecidas IOPS 1247 00:54:32,600 --> 00:54:35,160 -one to another, it's, of course, -much, much faster than +de una a otra, es, por supuesto, +mucho, mucho más rápido que 1248 00:54:35,160 --> 00:54:38,850 -if it's a standard EBS or a -femoral back-storage instance +si vas de un EBS estándar o una +instancia de almacén efímero 1249 00:54:38,850 --> 00:54:42,040 -to a provisioned IOPS or any -other instance type. +de soporte a una IOPS abastecida, +o cualquier otro tipo de instancia. 1250 00:54:42,040 --> 00:54:46,710 -But if they're both provisioned -IOPS, it can be +Pero si ambas son +abastecidas, puede 1251 00:54:46,710 --> 00:54:47,850 -performant. +tener buen rendimiento. 1252 00:54:47,850 --> 00:54:51,390 -It's certainly easiest just to -connector a completely fresh +Es de seguro más fácil simplemente +conectar un miembro completamente 1253 00:54:51,390 --> 00:54:55,220 -member to a replica set -and let it sync. +fresco al conjunto de réplicas +y dejar que sincronice. 1254 00:54:55,220 --> 00:54:58,030 -Sometimes you have to restart -it, but it almost +A veces tienes que reiniciarlo, 1255 00:54:58,030 --> 00:54:59,030 -always syncs up. +pero casi siempre se sincroniza. 1256 00:54:59,030 --> 00:55:04,700 -And in terms of getting the -performance you need, you run +Y en términos de obtener +la performance que necesitas, 1257 00:55:04,700 --> 00:55:09,290 -some of the front end on Heroku, -you were saying? +¿me decías que ejecutas algo +del "front end" en Heroku? 1258 00:55:09,290 --> 00:55:12,380 -And then the back end -is actually on AWS. +Y el "back end" +siempre está en AWS. 1259 00:55:12,380 --> 00:55:14,370 -So is that a challenge? +¿Es un desafío? 1260 00:55:14,370 --> 00:55:19,000 -Does the developer have to be -aware of that longer latency +¿Tiene que estar el desarrollador +consciente de la mayor latencia 1261 00:55:19,000 --> 00:55:20,662 -than sort of running -it locally. +que digamos si es que +lo ejecutas localmente? 1262 00:55:20,662 --> 00:55:22,860 -Do the developers have to be -more aware of the cost of +¿Tienen que estar más +conscientes del costo 1263 00:55:22,860 --> 00:55:25,210 -talking to a database that's not -necessarily located in the +de hablarle a una base de datos +que no está necesariamente conectada 1264 00:55:25,210 --> 00:55:27,660 -same LAN or something? +en el mismo LAN o algo así? 1265 00:55:27,660 --> 00:55:30,995 -So if we go back to our client, -our application, and +Entonces si es que retornamos a +nuestro cliente, nuestra aplicación 1266 00:55:30,995 --> 00:55:37,070 -our API layers, our application -layer and our API +y nuestro API, nuestra capa +de aplicación y nuestra capa 1267 00:55:37,070 --> 00:55:42,095 -layer, which essentially wraps -or handles all the reads and +de API, que esencialmente +envuelven o manejan todas 1268 00:55:42,095 --> 00:55:44,840 -writes to the database, -both of those two +las lecturas y escrituras +a la base de datos, ambos 1269 00:55:44,840 --> 00:55:46,620 -are hosted on Heroku. +están en Heroku. 1270 00:55:46,620 --> 00:55:51,980 -And Heroku is also AWS backed. +Y Heroku también está en AWS. 1271 00:55:51,980 --> 00:55:53,230 -Right They use AWS. +Claro, ellos usan AWS. 1272 00:55:53,230 --> 00:55:55,530 -Their dynamos are running -on top of AWS-- +Sus dínamos corren sobre AWS-- 1273 00:55:55,530 --> 00:55:57,990 -at least the last -that I heard. +al menos eso es +lo que he oído. 1274 00:55:57,990 --> 00:56:03,810 -And I'm fairly sure that -we use, in terms of our +Y estoy casi seguro que +usamos, en términos de 1275 00:56:03,810 --> 00:56:04,800 -availability zone-- +la zona de disponibilidad-- 1276 00:56:04,800 --> 00:56:07,660 -AWS has different availability -zones +AWS tiene diferentes +zonas de disponibilidad 1277 00:56:07,660 --> 00:56:08,890 -located across the world. +por todo el mundo. 1278 00:56:08,890 --> 00:56:12,510 -And, of course, whenever you're -across a network, you +Y por supuestom cuando +atraviesas una red, 1279 00:56:12,510 --> 00:56:16,590 -care about the latency -between the nodes. +te importa la latencia +entre los nodos. 1280 00:56:16,590 --> 00:56:20,200 -And if you're on the other -side of the world, you're +Y si estás al otro lado +del mundo, vas a tener 1281 00:56:20,200 --> 00:56:22,340 -going to have more significant -latency than if the two boxes +latencia más significativa +que si ambas máquinas están 1282 00:56:22,340 --> 00:56:25,810 -are connected, assuming that you -have fantastic connections +conectadas, asumiendo que +tienes conexiones fantásticas 1283 00:56:25,810 --> 00:56:26,830 -between them. +entre ellas. 1284 00:56:26,830 --> 00:56:32,690 -And both us and Heroku -are hosting the same +Y tanto nosotros +como Heroku estamos 1285 00:56:32,690 --> 00:56:34,070 -availability zone. +en la misma zona. 1286 00:56:34,070 --> 00:56:37,775 -And because of that, there is -less latency then if we were +Y por eso, hay menos +latencia que si estuviéramos 1287 00:56:37,775 --> 00:56:39,500 -in different availability -zones. +en diferentes zonas. 1288 00:56:39,500 --> 00:56:41,960 -But we still are going -across the network. +Pero igual atravesamos la red. 1289 00:56:41,960 --> 00:56:44,810 -And so whenever you have -an application that's +Así que cuando tienes +una aplicación que está 1290 00:56:44,810 --> 00:56:46,380 -communicating with the database -and they're not on +comunicándose con la +base de datos y no 1291 00:56:46,380 --> 00:56:49,310 -the same box, so they have to -go across the network, you +están en la misma caja, +van a tener que atravesar 1292 00:56:49,310 --> 00:56:51,320 -have to deal with latency -of one sort or another. +la red y tienes que lidiar con +un tipo de latencia u otro. 1293 00:56:51,320 --> 00:56:53,870 -And as a result, you have to -be very conscious of the +Como resultado, vas a tener +que estar bien consciente de 1294 00:56:53,870 --> 00:56:55,590 -number of requests-- +el número de peticiones-- 1295 00:56:55,590 --> 00:56:57,120 -not only the types of queries, -but just the +no sólo el tipo de consultas +sino el número bruto de 1296 00:56:57,120 --> 00:56:58,460 -raw number of queries-- +consultas-- 1297 00:56:58,460 --> 00:57:00,370 -that you're performing -on the database. +que le estás haciendo +a la base de datos. 1298 00:57:00,370 --> 00:57:03,560 -Because there's a communication -overhead just to +Porque hay un gasto general +de comunicación simplemente 1299 00:57:03,560 --> 00:57:06,060 -get to the database and get -the response back to the +para llegar a la base de datos +y enviar la respuesta a 1300 00:57:06,060 --> 00:57:06,660 -application. +la aplicación. 1301 00:57:06,660 --> 00:57:10,180 -So for us, we try to make sure -that every single request +Así que para nosotros, tratamos +de asegurarnos que cada petición 1302 00:57:10,180 --> 00:57:15,030 -involves a certain number of -database requests or fewer. +involucre un cierto número de +peticiones a la base de datos 1303 00:57:15,030 --> 00:57:17,360 -For us, it's about 10. +o menos. Para nosotros ése +número es más o menos 10. 1304 00:57:17,360 --> 00:57:23,260 -Even that's a little -bit generous. +Hasta eso es un poco generoso. 1305 00:57:23,260 --> 00:57:23,780 -Yeah. +Sí. 1306 00:57:23,780 --> 00:57:28,460 -It's interesting, because I'm -kind of an old guy, but in the +Es interesante, porque soy +un tipo un poco mayor, pero 1307 00:57:28,460 --> 00:57:34,390 -'90s and in the early part of -the 2000s when you would +en los noventas y a principio +de los 2000, cuando creabas 1308 00:57:34,390 --> 00:57:37,180 -create a database-backed system -attached to relational, +un sistema basado en una base +de datos relacional, la primera 1309 00:57:37,180 --> 00:57:39,890 -the first rule of thumb was -you never attached the web +regla era que nunca le +adjuntabas el servidor 1310 00:57:39,890 --> 00:57:42,960 -servers to the database because -it'd just be too slow. +web a la base de datos +porque sería muy lento. 1311 00:57:42,960 --> 00:57:44,800 -And you cache it. +Y usabas el cache. 1312 00:57:44,800 --> 00:57:48,020 -And I guess, for me, one of the -cool things about MongoDB +Y creo que para mí, una de las +cosas interesantes sobre MongoDB 1313 00:57:48,020 --> 00:57:52,770 -is that you now can attach the -web servers directly to the +es que ahora cuando adjuntas los +servidores web directamente a la 1314 00:57:52,770 --> 00:57:55,050 -database and not have a separate -caching layer and +base de datos y no tienes una +capa separada de cache y aún 1315 00:57:55,050 --> 00:57:58,700 -still get adequate performance -for the users. +así obtienes rendimiento +eficiente para los usuarios. 1316 00:57:58,700 --> 00:58:00,850 -That's cool. +Eso es interesante. 1317 00:58:00,850 --> 00:58:04,240 -But I guess now that we're -virtualizing everything and +Pero ahora creo que estamos +virtualizando todo y no es 1318 00:58:04,240 --> 00:58:07,150 -it's not always in the same, -it's getting a little tougher +siempre en el mismo sitio, +está volviéndose más difícil 1319 00:58:07,150 --> 00:58:09,820 -because we're getting -more latency. +porque obtenemos más latencia. 1320 00:58:09,820 --> 00:58:12,180 -Yeah, we moved the cloud, so now -it's easier, of course, to +Sí. Nos hemos movido a la nube, +así que ahora es más fácil 1321 00:58:12,180 --> 00:58:14,030 -provision and horizontally -scale. +proveer y escalar horizontalmente. 1322 00:58:14,030 --> 00:58:17,050 -But we've introduced a lot of -latency between connections. +Pero hemos introducido mucha +latencia entre conexiones. 1323 00:58:17,050 --> 00:58:19,810 -And as a result, you certainly -have to be very conscious of +Y como resultado, de todas maneras +tienes que estar muy consciente de 1324 00:58:19,810 --> 00:58:21,730 -just the volume of requests. +el volumen de peticiones. 1325 00:58:21,730 --> 00:58:24,050 -So you have to batch -your requests. +Así que tienes que +agrupar tus peticiones. 1326 00:58:24,050 --> 00:58:25,030 -You have to be conscious of it. +Tienes que ser muy +consciente de ello. 1327 00:58:25,030 --> 00:58:25,350 -Right. +Claro. 1328 00:58:25,350 --> 00:58:28,200 -And it's not even a throughput -issue, it's a latency issue. +Y ni siquiera es un problema con +el rendimiento, sino la latencia. 1329 00:58:28,200 --> 00:58:30,940 -It's not that you can't get -enough requests through the +No es que no puedas procesar +suficientes peticiones en el 1330 00:58:30,940 --> 00:58:34,750 -server, it's that any one user -that's doing one thing on a +servidor, es que cualquier usuario +que está haciendo algo en una página 1331 00:58:34,750 --> 00:58:38,970 -web page, you can't wait for a -lot of back and forths over a +web, no puedes esperar mucho +ida y vuelta sobre la red 1332 00:58:38,970 --> 00:58:40,585 -network or it's going to -get too slow for them. +o va a ser muy lento para ellos. 1333 00:58:40,585 --> 00:58:41,080 -Yeah, that's a good point. +Sí, es un buen punto. 1334 00:58:41,080 --> 00:58:43,580 -And that's why you want to be -making asynchronous requests +Así que por eso quieres +hacer peticiones asíncronas 1335 00:58:43,580 --> 00:58:47,530 -when possible or try to not have -them, at the very least, +si es posible o que no +tengan, por lo menos, 1336 00:58:47,530 --> 00:58:49,240 -be sequential. +que ser secuenciales. 1337 00:58:49,240 --> 00:58:50,970 -Right. +Claro. 1338 00:58:50,970 --> 00:58:51,530 -All right. +Muy bien. 1339 00:58:51,530 --> 00:58:57,330 -Well, thanks for letting us in -on the internals of Codecademy +Bueno, gracias por presentarnos +los temas internos de Codecademy 1340 00:58:57,330 --> 00:58:59,110 -and telling us how -it all works. +y explicarnos cómo funciona. 1341 00:58:59,110 --> 00:59:01,020 -This has been really great, -so thank you. +Ha sido fantástico así +que muchas gracias. 1342 00:59:01,020 --> 00:59:01,390 -Thank you. +Gracias. 1343 00:59:01,390 --> 00:59:02,610 -It was certainly -a fun exercise. +Fue un ejercicio muy divertido. 1344 00:59:02,610 --> 00:59:02,680 -All right. +Muy bien. 1345 00:59:02,680 --> 00:59:03,930 -It was good. +Fue muy bueno. 1346 00:59:03,930 --> 00:59:04,300 \ No newline at end of file