Backend 101 for Front-End Developers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
as a front-end developer trying to figure out which service to use for your back-end can be really difficult there's a ton of different services out there and it's hard to figure out what's going to work the best for your use case especially as you're trying to learn about the back-end in general i know that for myself personally as i learned more about react and i started to build applications it was a struggle to figure out the back end and understand which service worked where and when and when not i should use others so i want this video to be kind of a quick introduction into the back end for front-end developers and then give some tangible examples for solutions that you could use on the back end a lot of this video will be me posing questions to you to think about on the requirements for your application because it's very very dependent on what you're trying to build and what you need out of your application so if we break down the back end in the most simplest of terms we basically have two things we have a place to store data a database and then we have an api as a way of accessing that data as a front-end engineer you've probably worked with apis before they're allowing you to fetch data from some remote location but at some point along your career path and learning front-end development and transitioning more to full stack you'll probably have to build your own and that's where this video will help so the first question is do you even need a database you need a place to store data but that doesn't necessarily mean that you need a database with the rise of you know no code or low code tools you might be fine just putting your data in a google sheet or an air table and then using some kind of service or api that's automatically generated that allows you to fetch that data there's even custom react hooks that allow you to fetch information from google sheets so that's the first question to understand another question to consider is can your data live alongside the code so can you actually commit files as part of your workflow to your git repository if you can you might be able to use something like markdown to store your files and render them as part of your build process but let's assume that you do need a database and talk about a few things that you might run into that you'll need to understand along the way sql or no sql you'll probably see these terms thrown around quite a bit and if you're just getting the back end you might have absolutely no idea what these are so i'll break it down as simple as i can a sql database is used for relational data so let's consider a social media site you might have a table for users and for posts and there's a relation between these two tables for every user you might have many different posts but each post probably only has one user these relations then make it easy to look up different parts of data through queries which is what you use sql for nosql databases on the other hand are generally document oriented so rather than tables and rows you have documents and collections so for example in google firestore you have a collection of documents and each document has a set of key value pairs containing some data this is a really good approach if you have a large amount of collections that need to be stored with small documents you might also hear about graphql and rest and these are basically just two different ways of fetching data the third set of terms that you might hear about would be authentication and authorization authentication verifies who a user is while authorization controls what they have access to if you're building any kind of application that's going to need to manage users and have people log in you're probably going to need to learn a little bit more about these two if you're using next.js i have a video on how to do authentication with that so check that out if you are the fourth set of terms would be hosted versus self-hosted if your database is hosted it's managed by someone else if you're self-hosting that means that you're managing the infrastructure yourself in general what this means is if a back-end service is open source there's probably some way that allows you to self-host it in general though for front-end developers i would probably recommend sticking with managed services because there's less infrastructure for you to have to worry about or set up it's easier to you know hit the ground running and just start coding the fifth term is serverless kind of like managed infrastructure serverless allows you to not worry about any of the infrastructure and just focus on writing code which is great for front-end engineers so with traditional servers they're always running with serverless they're only running when you're executing something on them so in general what this means is they cost less and they have less maintenance now there are trade-offs and that's a pretty high level overview but for front-end engineers you might be fine just using serverless entirely the final term that you might hear about is called data modeling and i kind of led to this when i was talking about one-to-many and many to one these are simply ways that allow you to structure the data in your database you might also see database normalization which is how you structure your data into tables and columns okay so let's get into the meat of this video and i want to talk about levels of abstraction i'm going to pose some questions for you to think about and generally what it comes down to is what level of abstraction do i want to have in my back end how much control do i want over that infrastructure so are you trying to build this back in yourself are other people going to be working on it are you trying to launch a sas product and you're just trying to get a mvp minimal viable product out the door thinking about these questions is really important because every situation is unique and there are multiple providers to do the exact same thing personally if i'm building something for myself just as a project or as like a small sas application i'm going to be more willing to try something new and experiment a little bit because i have that luxury and freedom now if i'm doing something for my day job i'll probably use something that's more well adopted in the industry and has broader community support if you're needing something fast that's when you generally choose a higher level of abstraction and what i mean by that is some of the services i'm going to talk about provide code out of the box that you don't even have to write like they will take care of auto-generating an api for you providing that abstraction so that you don't have to worry about it yourself you might hear this called automating the boilerplate code or auto-generating the crud actions which is create read update and delete okay so let's assume that you want something more high-level which you probably do as a front-end engineer and i'll touch on if you wanted to kind of build your own at the end but let's start with some services that are a higher level of abstraction but first some questions to think about does your back end need to be built on open source technology what level of vendor lock-in are you okay with do you need to support social logins like google or github or whatever do you have an existing database are you looking for something that's completely managed these questions will help narrow down the list of providers we're going to talk about and really the first category is back-ends as a service so this is the highest level of abstraction in general you'll provide your schema you'll set up your tables you'll do your data modeling and these services will then auto-generate a significant portion of the code for you so let's just rapid fire off a bunch of different solutions we have firebase mongodb we have fauna user base hazura n-host superbase aws amplify there's a ton and i'm really only going to talk about the ones that i've used personally and that i have experience with let's start with firebase firebase is great it has an excellent developer experience and it's a choice that i would recommend if you're trying to build an application quick you're trying to get something off the ground maybe you need to have social logins like google or github and you're willing to sacrifice a little bit of that flexibility with it not being open source for the time spent and getting your product off the ground it's worth mentioning that firebase specifically firestore and how you store your data is a nosql database and if you're really familiar with sql already which maybe you are then you probably wouldn't want to use this approach the second back end of the service that i really like is called hazura and it provides a graphql api in a box so using their managed platform you can go in and use a ui to build out your entire schema and then it will just automatically update all of the create the crud actions for you so that you don't have to do any of that code yourself you might use hazura if you want to use graphql whether you just like the technology or you have an existing schema that you want to extend via their remote schemas in general i would recommend using hazura cloud it's a newer platform that they're offering that is the managed version of using the open source hazura product the next layer down of abstraction is building your own back end so there are tools that you can utilize that still simplify this process but they are requiring you to write more code on your own i don't know that i would recommend these for absolute beginners but when you get maybe past the beginner stage to an intermediate stage you can learn a lot by doing a more bare metal approach and learning how some of these things work i know that personally i learn best by doing and just actually building things and that's why i have fun kind of messing around with some of these build your own solutions and learning the nitty-gritty of how to put these things together so three services that you might consider would be aws dynamodb prisma or even using prisma plus nexus which is basically just graphql on top of prisma i want to talk about prisma because i have quite a bit of experience using it i actually have a video that i'll link below for using prisma with nextgs to build static sites but the really cool thing about prisma is that one you can bring your own database or you can create a new one and it allows you to have type safe access to your existing database schema so whether you're using postgres or mysql or sqlite or any sql-based database prisma makes it easy to access and modify the data inside of your database so in general if you're going to be using prisma and building your own that probably means that you're also going to be self-hosting as far as i know there isn't a like prisma in a box solution so you're probably going to be deploying your database and api somewhere like aws or digitalocean or heroku or render or whatever while we're here it's also worth mentioning that there's two full stack frameworks that are actually built on top of prisma so you have redwood js and you have blitz.js and both of these allow you to continue working as a front-end developer and more easily merge into the full stack space so i would recommend checking these out too there's also a whole category of back-ends called cmss which is content management system and to understand when you should use these again a couple more questions are you dealing with images or document storage do any non-technical users need to use your database or access your database do you need to localize the data do you want to have previews of like a post before it goes out all of these things kind of tailored towards you know writing or managing documentation would be a good example of a use case you probably want to use a cms and in that case there's a ton of different providers but it's worth mentioning wordpress which is the most popular one by far it's used by like 40 of the internet or some ridiculous number like that and then also headless cmss with wordpress not only do you have an api for accessing your data it also comes with the ui to manage that data bundled in one application versus headless cmss there's a decoupling between the data piece and the management piece so they will provide apis that allow you to update or manage that content and then there's also like a web app where your non-technical users can go in and modify and update data and you know have permissions for who gets to access that data so this is really great for having a separation of concerns of those two pieces plus in the past there have been some security vulnerabilities with wordpress and exposing specific versions when there's that tight coupling so that was part of the reason that we shifted towards headless cmss and also they align a little bit better with the jam stack paradigm that a lot of front-end developers are seeming to move towards the final piece to talk about is starting from scratch and really getting down to the nitty-gritty details of how you want to build your back end this is typically where more experienced backend or full stack developers will end up as they want complete control over every piece of their back-end and infrastructure in reality there's entire videos and courses and whole sections of textbooks dedicated to this so i'm not really going to get into the details here but what i want to leave you with is don't feel overwhelmed as a front-end engineer i think as front-end engineers we know that you don't need to know everything right like there's a million frameworks there's a million different pieces of front-end development that you could learn about but you don't necessarily need to know it all and the same is for getting into back-end or full-stack development my advice would be to start small learn and build applications and pretty soon you'll be a master of the full stack so that's pretty much it hopefully as a front-end developer you now have a better understanding of how to get into the back end how to become more full stack and what services you might use if you have any questions leave a comment below and i'll try my best to help out thanks for watching
Info
Channel: Lee Robinson
Views: 7,600
Rating: undefined out of 5
Keywords: backend, front-end developer, back-end developer, prisma, hasura, aws
Id: fbDoO83t1eM
Channel Id: undefined
Length: 14min 24sec (864 seconds)
Published: Thu Aug 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.