How to build a real web application (full-stack development)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey tech late here and welcome back to another episode of the attack lead i am the attack lead and this is coffee time with the tech lead we have a special guest here i think his name is clement or something anyways my name is the tech lead i am the tech lead i am drinking instant coffee today clement what are you drinking over there hi declaid yes my name is clement or at least i think it is and i'm drinking maybe instant coffee what we're going to do today is we're going to learn about how clement had built up algo expert io this is an entire web application fully functional in production with thousands of active users he built this up with a co-founder we're going to go from back end to front end and learn about how he put this together and i think that this is an incredibly valuable skill clement why don't you tell us about what is algo expert and how you've put this together for sure i'll go expert as some of you might already know is a platform that gives users a list of curated algorithm interview questions right now we have 65 for every question you have a coding workspace where you can code up your solution in whatever language you want out of five popular coding languages you can run that code against custom test cases see video explanations and so on and so forth this sounds absolutely amazing now is there a way that our viewers will be able to access this website with some kickbacks for myself i'm thrilled that you're asking this tech lead actually there is i think if you go to algo expert dot io tech slash tech lead let's not forget that slash tech lead your users will get a discount that's absolutely amazing did you guys all hear that you'll get a discount so check it out i'll go expert.io slash tech lead ace your next interview now why don't you tell us about your back end because when i first heard about this bag and it sounded completely over engineered to me i could probably build algo expert dial in an afternoon using php and javascript with html5 but how were you able to build this all right so it's very interesting that you say that actually there are very specific reasons for which we built the website the way that we did algo expert runs almost entirely on gcp google cloud platform we run on three virtual machines two of them are have 16 cores uh one of them has eight cores and then we use kubernetes to kind of orchestrate and manage all of these vms and all the containers that run on these vms okay can you give us a quick overview for those of us who don't understand what is kubernetes if you think about an application right you've got a lot of different services that each rely on different libraries different technologies different versions of these libraries containerized applications allow you to have sort of independent isolated containers for each of your services in your application and kubernetes is a great way to kind of manage all of these containers at scale reliably and easily and google kubernetes engine which is the the platform that we personally use allows you to do that extremely easily like they handle most of the sort of administrative part that you don't really want to handle as the developer cool and then what are you using for your back-end are you using python php laravel django node.js yeah so there's an interesting story behind that we started out by using node.js and express and then my co-founder antoine who was in charge of building the back end realized that all his expertise was in go and so we completely scrapped our node.js work went with a pure golang back end and that's what we have now that is fascinating because these days you don't hear all that often about completely go back ends usually they're used mostly for micro services how is that working for you that actually works really well for us because all of our backend services are split by functionality so we have you know our off backend service we have our subscription backend service we have our problems back in service so it really works out well for us and i think that's great because you can really choose any language any stack that you want the key is to just ship the product and make sure that it launches you don't necessarily have to be always following the hype train and using what other people are telling you that you have to use necessarily agreed i think the key is do what works for you so long as it's reasonable now one of the most difficult parts of any application is going to be in the database the database is notoriously difficult to scale the general web backend usually you can scale that by throwing money at it duplicating many machines using a load balancer the database sometimes is more difficult to manage and it is a major pain point i found for myself how do you manage your database so fortunately we live in a day and age where you have amazing cloud providers like google cloud platform amazon web services or microsoft azure that kind of handle a lot of the difficulties or complexities that come with databases for you you know replication backups and all that we started out by using a google cloud datastore as our main database what is google cloud data store cloud data store is a nosql database that scales is reliable and is very simple to use the really big selling point that they had for us when we started out was that they have a really nice ui in other words you can see really clean tables of all your data now one of the annoying parts of data store that actually came back to haunt us is that datastore only has eventual consistency and so for some of our services we needed strong consistency in our database and so we ended up migrating to uh postgres for some of our services so this is fascinating what eventual consistency is is when you write to a database it's not necessarily guaranteed to be written immediately it could be written later on and then when you read it you may get a sale value eventually though you will get the proper value the great thing about google cloud data store and services like these nosql databases is that they can scale very easily and you don't have to manage that claim by yourself you don't have to set up master master replication master slave backups all of that stuff i think that that is one interesting thing about using off-the-shelf database provider services like this so it sounds like that you're using a lot of third-party products like you're using kubernetes docker google cloud data store how many of these products are you buying from and then gluing them in versus how many are you building in-house just from scratch basic components for the more sort of a niche targeted services we've actually built them in-house to save a lot of money so the two big examples that come to mind are number one are code execution engine so on our website you can type your code and run it against our custom test cases in java c plus plus python javascript pipe uh golang and similarly we have a sort of continuous integration continuous deployment uh system built for feature releases and our testing and that's also built in house so we're saving a ton of money what is this code execution engine how are you setting this up and how do you test it the life of a code execution request is this someone is on the ui and they press run code the ui makes a request and uh we have a load balancer mg-inks that will route that request to a specific docker container that it knows of you know maybe like the javascript docker container that javascript docker container is going to say okay is this user able to send this request you know we have like rate limiting services that container is going to reroute the request to another container and there are optimizations there to like share file systems or certain mount points and that other container is going to then have like all the libraries or things that needs to run code in that particular language it's going to run it it gets the response then it gives the response back to container number one gives it back to the ui what is your rollout process like how are you releasing new features are you just coding on prod or do you actually put this onto staging and then wrote that out coding on prod tech lead that's what i do i don't make mistakes when i code so i can just code straight on prod and it's okay but for other people more normal people i can understand why you may want staging oh yes for us mere mortals we actually have you know different environments so we have three environments we have a qa environment a staging environment and a prod environment at least for the ui for the back end we have just staging and prod and then we have this really cool continuous integration platform that we've built in-house that makes it such that any commit we push up gets automatically tested or at least like the part of the code base that's been affected if we make a change to the ui all of the ui tests are going to be tested and it's been really really nice for us and it makes it such that we can deploy new features at a moment's notice i've actually deployed stuff to prod from the train from the subway from my phone with like zero downtime on algo expert which has been like super nice for us okay i guess you could do it that way i probably would have just coded on prod though that works too and what happens if one of your tests were to fail if our tests are running and one of them fails we actually have uh alerts via slack so we use slack bots and we get paid and we can immediately see like what's going on now how about your front end what are you doing for that so for the front end we use a react and redux the main reason we used react is that's what i was really comfortable with i hadn't worked in angular at the time that i started algo expert now i have to be honest i still think i would probably use react we also use redux as our sort of state management uh paradigm redux is super helpful for when you've got like relatively complex states and you want to be able to access them anywhere in your application like you know is the user logged in or has the user purchased the product already for testing we use just an enzyme very popular frameworks with react and uh the one thing that i do want to bring up is uh the language we use obviously we use javascript right it's unfortunate that at the time that we started algo expert i had no experience in typescript for those of you don't know typescript it's a superset of javascript it's basically a typed version of javascript it is amazing i cannot recommend it enough i've also heard very good things about typescript it's a huge effort to migrate the entire code base to the typescript that we don't have the resources to allocate to that right now but i wish we had been able to clement do you have any additional tips last minute messages that you would like to give to anybody else here who is considering building out their own tech stack i think i have three things to say number one is figure out what are the priorities of your business and build stuff accordingly number two is use the technologies that you feel comfortable with this echoes what you said at the beginning tech weed don't necessarily follow the buzz just because it's the buzz and the third thing which is kind of the opposite of that is do be careful with certain very crucial design decisions like that may come back to haunt you the fact that we started out with google cloud data store that was only eventually consistent started causing major problems recently and we did have to change that overall i think this is great advice the most important thing is that you guys were able to build this product and just moving the product forward is always going to be your highest priority without a product you don't have anything so don't go too hardcore on the tech and forgetting about the product well i think i'm almost done with my coffee that's my cue to leave is there anything else you want to say yeah just don't forget i am the tech lead that'll do for me if you liked the video give the like and subscribe and i'll see you next time bye
Info
Channel: TechLead
Views: 213,102
Rating: undefined out of 5
Keywords: techlead
Id: nXqP9Xn5hUc
Channel Id: undefined
Length: 12min 4sec (724 seconds)
Published: Thu Mar 14 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.