Placeholder Image

字幕列表 影片播放

  • creating these classes requires equipment and service.

  • Is that cost money?

  • If you appreciate this education, please think about going to Eli the computer guy dot com and offering a one time or monthly recurring donation.

  • Welcome back.

  • So today's video.

  • I'm going to do an introduction to databases in regards to cloud computing.

  • Now I do have to warn you, and you have to warn you, if you are an expert in databases, turn back now turn back.

  • Now leave.

  • Go away!

  • Watch game of Thrones.

  • The way that I'm going to probably do this introduction today is most likely going to piss off a lot of old school database administrators, because the problem that I have is when I am talking to people, I am talking to new people.

  • And so I have to find someplace to start in order to give folks context for everything else that I talk about later.

  • And so one of the issues you run into when you're doing introductory classes is you frustrate a lot of the old timers because they're like that's That's not Howard is a lorry, and you're like, Well, yeah, you know, in the real world, it gets a lot more complex.

  • And, ah, there's a lot of stuff in the real world, but I have to find some place to start from.

  • And so I am going to be started by talking about relational databases.

  • I think this is a good place to start when we start talking about databases, especially in the cloud computing world, because we're like relation.

  • All databases are most likely the types of databases that you will have run into in your normal day to day work and the type of databases that are most likely easiest for you to spend up.

  • S O.

  • There are different types of databases out there.

  • They focus on being able to deal with data in different ways.

  • Basically, relational databases is just one way that's been around for quite a long time now.

  • And if you're going to be dealing with databases such as my sequel databases or Maria de be a lot of the different types of databases out there, basically they're going to be a relational databases.

  • So if you are a database expert, let me be clear.

  • Yeah, I know.

  • I'm glossing over a lot of crap.

  • It's an introductory class, got may cut me a break here, right?

  • So when we start talking about databases, the important thing to be realizing when you're talking about databases is all a database does, or all database software or a service does.

  • Is it stores data in a way that is very easy, basically to search for and to be able to modify.

  • So that's all Oh, a database server does.

  • So this is very important because a lot of times when people start interacting with databases for the first time don't use a piece of software such as access.

  • So access is a piece of data base software that Microsoft creates and the way the Microsoft does everything, which is good from a production standpoint.

  • But it's horrible from an education standpoint.

  • They got a bundle.

  • Everything together s so what you're doing with access databases.

  • Basically, access has the database component, and it has the front and component, and it has the intelligence.

  • Basically, when you deal with access, you're dealing with a full product, right?

  • So one of the problems is when people go out to start using, let's say that's equal or my sequel or Maria D.

  • B, or some of the other database software.

  • They get really confused because they're like, Okay, I installed the database software.

  • Uh, where do I find the front end?

  • Where do I find the intelligence?

  • And it's like, No, no, all the database does.

  • All a database does, is it stores the data.

  • You then have to use some other front end, and you have to code the intelligence or have the intelligence coded for you to make that database actually do something worthwhile.

  • Right?

  • So when you're dealing with a database, most likely again, if you're gonna be using relation all databases, my sequel, mess sequel, something like that, In order to interact with the database, you will be using something called Sequel or structured query language.

  • And basically what that structure query language allows you to dio is it allows you to do things like create databases, create tables, create records, search for database search through databases.

  • Four records within tables.

  • It allows you to modifications a whole bunch of things.

  • But it's very commanding.

  • It's very command.

  • Select X, where block at right.

  • It's kind of like again will be kind of like trying to surf through the world wide Web at the command line.

  • There are tools and other scum called lynx that allows you to actually navigate the World Wide Web from the command line.

  • But nobody other than really hardcore Lennox administrators would actually ever even think about doing something like that.

  • It's just a horrible process, right?

  • And so that's one thing to realize with the databases, get my sequel or whatever Maria de be.

  • Whatever database they're gonna use is is you have the database software.

  • You're able to interact with the database software using something called structure, query language or whatever language that they use.

  • But that's that is horrible and nasty and God awful.

  • And it's not actually how any normal person is going be interacting with the database.

  • How people actually you're going to be interacting with the database is there's gonna be some front end that has been developed.

  • So basically, the front end is either a like a website that you go to or some kind of application has been created for your windows or your iPhone or whatever else.

  • Then there will be intelligent, so basically you have the front end, and then you code you code for that front end to be able to communicate with your data base eso such as, like if you're dealing with something like a WordPress or dribble.

  • Basically, you have a front end of that front end is 80 Mel and CSS and that type of thing you have a my sequel back end, and then you use PHP.

  • So basically, when you insert data So when you create a user account or when you create a post or something like that, basically PHP takes that information and then with PHP, that information is then input it into the database.

  • When you go to read a post off of something like WordPress and you click the link, what happens there is PHP goes, finds the records associated with that post it, then pulls that out of the database depending on the formatting than four mats.

  • It s so that you can then read it.

  • And so then you're reading it.

  • So one of the important things to remember when you're dealing with databases is all the databases does, is it just stores the data.

  • Basically, it stores those records so that you can access them.

  • How you actually access them, though, is generally through some external application.

  • And then there's some programming language that that communicates from that application back to the database.

  • It's kind of think about like a file server, maggot.

  • If you have a file server and you had a whole bunch of documents, you know, Excel, spreadsheets and documents and PDF files or whatever else in that file server.

  • Now imagine.

  • You know the final server, but you don't have word, and you don't have excel or anything that can open up a spreadsheet.

  • You don't have any of that kind of soft right?

  • That's the same kind of thing.

  • Imagine, imagine just a file server.

  • Just the file server.

  • It doesn't have Adobe Acrobat and stole.

  • It doesn't have word or open office or anything installed.

  • All it does is store files.

  • So the files are there.

  • That data is there, but in order to be able to actually access that dad, do anything useful for it.

  • You need an application installed on your computer that is able to read that data type, and then you're able to communicate with it over the network, and then you're able to open it and modify it.

  • Kind of think about that, like with databases.

  • So basically, you have his database software installed on your server.

  • But to really do anything useful with that at a base, you need some kind of external application that's been created.

  • That external application will then be communicating with the database to push poll, do whatever intelligence that data database requires.

  • So that kind of gives you a little bit of a brief idea what we're talking about with the databases just to kind of get you, get you in the right mindset here.

  • So now that you have a brief idea of what a databases, let's go over the white board so I can draw some things out to try to give you a visual representation of what's going on.

  • So I think it'll make a little bit more sense for you.

  • So let's kind of draw this out.

  • Let's do a little bit of a diagram of how this whole database system works and how clients are going to be interacting with it Now.

  • The important thing to be thinking about when I start talking about you know the database is that the modern world of databases has become much more complicated than how it used to be.

  • So I am trying to give you a basis here so that when you start reading and learning more about database is going into the future.

  • You have a base idea of what's supposed to be going on, and then you can understand what functions or features the product that you're looking at offers.

  • So, basically, in the old days, in the old days we had a server.

  • We had the server with the good old CPU fan on it, right?

  • So you have that he have the physical server.

  • You haven't OS installed on the server.

  • And then on top of that OS, you have a database such as my sequel installed.

  • So basically, you're going to have to actually install the saw that the database software.

  • So whether it's my sequel, whether it's Maria de Be, whether it's some type of Oracle product, Mongo D.

  • B.

  • There's a lot of different databases out there.

  • But again, the general that you'll be using is my sequel, and the important thing to understand is you actually have to install that onto the server operating system that you're using.

  • Then, once you have my sequel actually installed on your system within my sequel.

  • The first unit you're going to deal with is a database, right?

  • So the database is the highest unit that you're going to be dealing with within a database server so you can have a database.

  • So, like a lot of times with databases.

  • So if you're having ah WordPress websites So WordPress websites connect back to a my sequel back End.

  • So we talk about a back end.

  • We're normally talking about a database server, so it communicates with a my sequel back end.

  • So for like me, I have ah, Eli, the computer guy dot com.

  • Right?

  • So Eli, the computer guy dot com, uses WordPress.

  • And so for Eli, the computer guy dot com, there is a specific database for the information for Eli, the computer guy dot com on the same server.

  • I have a website called Fail normal dot com, and it has its own database.

  • So the database is kind of like the route right that it's the highest level that we're going to be dealing with when we're dealing with a database server.

  • Then from there, basically, you have software that's been encoded to be a push and pull data to that particular database.

  • So if you go to Eli, the computer guy dot com, right, you go to a website, your computer guy dot com, and you see all kinds of fancy stuff.

  • They're basically what's happening, right?

  • So I have my Web server.

  • My Web server has PHP installed.

  • And so the PHP programming language is communicating with the Eli, the computer guy dot com database, and it basically pushing and pulling a data from that database.

  • So when I sit down and I write a post so I sit down and I write a post and then I click the little published button that then sends all everything that I've written for that post to the database on the database server and then that's written there.

  • Then if somebody wants to read the post, they opened the post up.

  • Basically, the PHP goes to the database on the database server says, Hey, I need the record for this particular post and in that is sent that gets encoded with HTML CSS.

  • And then I am able to view whatever is going on here, so that's kind of gives you the idea of what's happening now.

  • It is important to understand that you can communicate between multiple databases right.

  • So again, since we're going to be interacting with databases basically since appropriate with a programming language, the reality is, is we can connect to multiple databases.

  • So let's say there's one database server here on one database server here.

  • So again, so something like if you're trying to create some application that allows your users to buy products from something like Amadeus amazon dot com.

  • So you have your user, let's say dot com database server.

  • And so you have a user database here, and then you want to connect to amazon dot com for whatever products that they're offering, right?

  • So basically, you want to create an app that connects users and recommends products.

  • Well, since you can code everything out in PHP or Python or whatever programming language, one of things that you can do is you can have your software.

  • Your application you've created.

  • It can communicate with your user database.

  • It can pull out usernames and preferences and shipping addresses and all kinds of stuff, right, and it can also go to amazon dot com's database and pull out products and prices, maybe reviews and other things.

  • And basically it's able to pull all of that information together so that when one of your users goes to a website, they get the recommended recommendations that are most appropriate to them.

  • So it is important, understand, when we talk about these database files, they are the highest level of storage within a database server.

  • But you can communicate with different database files, basically based off of how you encode your software, right?

  • So you're going be sitting there, you're going.

  • Be writing your application of PHP, Python or whatever else, and then you can have that application be able to connect to these multiple different databases.

  • So that's an important thing.

  • Like a lot of people get confused.

  • They try to dump way too much crap into a single database because there's this kind of this idea like, Oh, the database is the largest, like that's the largest unit I can have.

  • So therefore, I'm just going to keep dumping so much crap in that database on.

  • Then you get into a problem where becomes just a mess to try to manage that database because it's containing way too much crab and so is something to be thinking about is no.

  • You can have one database that focuses on one specific thing for your company or your organization, and then you can have another database that focuses on a different thing.

  • And if those two need to communicate, all you do is in a programming language.

  • You write a script that communicates with both both databases and then pulls the information in that it needs.

  • So that's one of the important things to realize when you're dealing with the databases.

  • So then past that.

  • So we're gonna have our server, right?

  • We're gonna have, you know, my sequel, my sequel, Maria de be whatever else installed, and then we're going to have our database.

  • So the data base is the largest again, the largest unit that you're going to be dealing with within a database.

  • Right?

  • So let's say we have Eli, the computer god dot com.

  • You know, this is the database within my sequel.

  • And so we've been here under the database.

  • We're then going to be dealing with something called Tables.

  • So tables are basically containers for the same type of information.

  • So let's say you have a table for user's on and then you have a table again.

  • If we're dealing with something like WordPress, we're dealing with a with a blog's system.

  • Then we have a table for posts, and then we may have another table for pages, right?

  • So basically, once you have that large edited.

  • So the database itself contains all the data for airline computer guy dot com and then within their you have tables and those tables are basically compartmentalized specific information.

  • So you have a user table of post table pages table and again if you go in and you actually look at a wordpress dot com award press database, I think it's like 20 or 30 different tables of different types of information that have to be stored where they store them in different tables to make it easier to be a grew in minister and manage again.

  • That's one of the big things to be thinking about is a realizing professional is trying, trying to compartmentalize content and things into into rational units.

  • So basically somebody can go.

  • Oh, I need to see what the user information is, and I can simply go to the user table within the Eli, the computer guy dot com database.

  • Imagine if everything was just stored in one massive table that could run you into some problems, right?

  • So then once you get past the table, then you have columns in the table, right?

  • So again.

  • So if you're dealing with a user table, you may then have the user I d.

  • So basically, you need one i d.

  • Number.

  • So you need an I.

  • D.

  • Number that is completely unique in a table.

  • Right?

  • So basically, to make sure that no records are absolutely identical again, one of problems you run into in the real world of I t is computers.

  • Computers can't think on their feet, computers can't.

  • Computers can't just invent new ways of doing things right.

  • So if you have two records that are actually absolutely identical, that can run into a big problem for the database.

  • Because imagine if you're doing a search in a table and you're looking for or something, you know, I need the one record that looks like this.

  • What if you have multiple records that are literally identical, right, You can actually run into problems from the computer room.

  • Now, you may sit there and they say, Well, wait a minute.

  • But what if I do a search and I do that search and my results look identical?

  • Well, thing is the first name it maybe be identical.

  • The last name might be identical.

  • The notes may be identical, but the user i d the unique key.

  • It's called a key.

  • The unique key will be different, right?

  • So So, basically, if you're looking at records so let's say use PHP and you're doing a report.

  • So you do PHP and you're doing a report.

  • You say I want this information, this information, this information Well, you may get you know, Bob, Bob, Billy And you know, is aged 12 and you may get Bob.

  • Billy is age 12 and make it Bob.

  • Billy is age 12 and say You say, Well, wait a minute, Eli, These records are identical.

  • When I when I asked for this information, I got three identical Bob Billy, age 12.

  • But what may not be printing out on that report that you're looking at is that there's a customer I d field and so this Baba Billy a 12 maybe record 101 in this Bob Billy A 12 maybe record 1000 and one in this Bob Billy A 12 Maybe record.

  • I'm 55.

  • And so I know, like right now that may not seem you may be like, Well, I don't understand why that matters, but the important thing is is when you're doing searches, when you're trying to modify records, when you're doing that type of thing, you need some kind of unique idea for the records that you're dealing with or things are going to get really, really bad.

  • They're really, really fast, right?

  • And so when you're dealing with the table, the first thing that you'll have in your table is some kind of unique key.

  • It's called a key.

  • You need a unique key within the table so that every record is different, like they're not completely identical.

  • If you have an identical record, your database will go to hell or really damn quick, then passed that.

  • Then you have something like the first name.

  • Then you have the last name.

  • Then again, its users maybe have passwords so on so forth.

  • And so these right here are called the columns.

  • So these are the columns and So when you're looking at the database, what will be going across the top again normally will be.

  • Like I said, you have some kind of user I d You'll have a first name, last name.

  • So on and so forth, then going across, then going across this.

  • This is what we call the Rose.

  • And so the rose are then the records themselves.

  • So we have a user i d of one.

  • A first name of Bob.

  • A last name groups a last name.

  • Come on, The last name of Billy.

  • So on and so forth, user I.

  • D.

  • Two And this is Sue Stevens.

  • So on and so forth.

  • Use Variety three.

  • And so this is where the records are.

  • And so that's how you will store the records.

  • So when you start looking at the data base again, you have a server.

  • So you have a server somewhere.

  • That server has the server software installed on it.

  • My sequel, Maria de be Mondo di B.

  • Whatever else within that server is then a database.

  • So you have the whole database.

  • So that's the highest level that's going to contain the data within that database.

  • You then have tables.

  • Uh, those tables are then basically ways to section off and be ableto basically be able categorize the type of information that you're going to be dealing with for that table.

  • So again you can have a user's table, a post table pages table, that type of thing and then in there, the up and down those air, the columns.

  • So the columns are basically the fields again.

  • When you think about plugging something in fields so again the fields, you'll have a user, I d.

  • So you will have a unique key.

  • You have to have at least one unique key s O that every record actually is individual.

  • None of them are actually exactly the same.

  • Then passed that for the fields for the columns again.

  • First name, last name.

  • Whatever information that you care about, once you have that, then you can start inserting records into that table.

  • And so that's where you have user.

  • I d one is Bob.

  • Billy.

  • Use righty to ISU.

  • Steepens use.

  • Righty three is Tim.

  • I don't know.

  • Bob's right and so on and so forth.

  • And so that's basically what the database starts looking like.

  • So now we get into when I talk about a relation A ll database.

  • What do I mean by a relational database?

  • So scroll down here.

  • So let's start with the overall database.

  • So again we have the overall database here.

  • And let's for this.

  • Let's say talk about an inventory database or sales data base, Let's say and so we're going to have a multiple different tables here.

  • So we're going to have a customer table.

  • Then let's say we're going to have a parts table and then we're going to have an order table, right?

  • So we're going to have these three different tables.

  • So then we go in, we take a look at, let's say, the customer table.

  • We're gonna have a table for the customer, right?

  • And so, in the customer table again, up here for the columns will have a customer, I d.

  • Then we'll have what's a first name, and then we'll have ah, last name and then we'll have notes.

  • Right.

  • So this is the different information here.

  • And so in this, then we have the rose.

  • So these are the records we have.

  • Customer.

  • I D.

  • 1234 1st name Sue Last name Bill Notes.

  • First name.

  • Tim.

  • Last name.

  • Stephens notes.

  • Customer three is Bob last name Billy.

  • And then there's notes and then customer.

  • Four.

  • As I don't know, Ralph, Tim's bad with coming up with names notes.

  • Right.

  • So this is the customer table, right?

  • It's a customer table.

  • You're the customer i d.

  • First name, last name notes and again for this table.

  • You got a whole bunch of information here.

  • You can have this three to dress you got on the state.

  • You have a tax i d.

  • Number lots and lots and lots and lots of things.

  • Do you realize when you're dealing with a table that it's not really that you're worried about the table size?

  • Not really.

  • That what you're worried about, How many fields a table contains The real thing when you're dealing with a table is that it makes a logical sense, right when somebody sits down and they're like, Oh, I have to modify the database.

  • They can sit there and they can easily say, Okay, three information that we're going to start needed from the customers for the customers.

  • We're gonna need this extra information, so that means I'm going to go and modify the customer table.

  • Right?

  • That's the important thing.

  • So you get this table here Could be really, really, really lark and then passed that right.

  • We have the departs table for this particular database.

  • And so let's stay with the parts table.

  • Right?

  • You have parts table, and so the part stable again.

  • You have the fields again, and then you're going have a part.

  • I d right.

  • So the part i d is going to be an absolutely unique idea.

  • It's going to be an absolutely unique key.

  • And then from that, you're going to have the name for the part.

  • And from that, you're under the price for the par.

  • Don't say from that.

  • You're gonna have a description of a part, all right?

  • And of course, you know, lots and lots and lots of stuff here, right?

  • And so then basically here.

  • You know these air, your rose, these air We called your records.

  • So part i d one is a cog on the costs.

  • $1 part attitude party.

  • Party I d number two is Ah sprocket.

  • That cost $2.

  • Part 83 is Ah ah rank that cost $4 part i d five or four?

  • Sorry, Part I d four is a, um don't lever that cost $2.50.

  • Just make my life complicated.

  • And then we're gonna have a description over here, and these are gonna be all the notes and all that kind of thing, right?

  • So right here.

  • So we have a customer table and we have a parts table.

  • The big thing to realize is that there's this customer i d here and that there's this part i d here.

  • And so what's going to then happen is you're going have an order table, right?

  • So you're gonna have an order table, and so it's cool with the order table, and so you could come here and basically you can create the order table.

  • So the order tables created.

  • And so when you're dealing with the columns of the order table, the first thing that you're going to do is we're going to create an order i d.

  • Again, you need a unique You need a unique identify for every single record that you're going, be creative.

  • But when somebody goes to create an order, one of the things that you can then Dio is.

  • Instead of plugging all of this information in to the order table, you can simply reference a particular idea.

  • So what you can say is, if you're saying that's if you're saying that Sue Sue Bill ordered something, What you can do is you can say customer I d one right?

  • So here you have customer I d.

  • And so when you have a record, right, you have order i d one customer i d one and so customer I 81 references, you know, Sue Bill, all of her information.

  • So instead of having put all of this information into the order table, you can simply a reference that customer I d.

  • And then when you go for the actual order itself, you can say, you know, uh, let's say item one, Item two, Item three Someone so far, there's a better way of doing this again.

  • Do not design any application of one off of what I'm showing you today.

  • I'm just trying to give you an idea of how this works, and so basically, you can say OK with this order.

  • The first thing that Sue ordered was a three.

  • The second things who ordered was a four.

  • And the third thing that to order Waas a two right?

  • And so basically what they're saying is this four this order.

  • So for order number one customer, Sue purchased a wrench, a lever on a sprocket.

  • Right, So all of that information is there, and then you can have additional information like this gets a little long, But again, let's say you have this.

  • Let's say you have the order table or at the order table.

  • See the order?

  • I d the customer.

  • I d.

  • Uh, item one, item two.

  • Item three.

  • Right.

  • So as we had before and then here you can then add in some of the additional things, right, it's you could have notes.

  • So additional notes.

  • So for this order.

  • So for order One, you know, Sue is purchasing, you know, three, three or four and a two.

  • And she may say, um, you know, leave at the back door.

  • And so this way were created an order that's able to pull in information from these other tables and you're able to put in your own information for this particular table, right?

  • And so what happens is you're going to use something like PHP.

  • And so in order to a report.

  • So you're basically print a report, so printing you do something, like printing a report.

  • Basically four for the invoice, right?

  • So you're going to an end voice.

  • And so what the envoys could do is with PHP PHP comm pole.

  • It can pull from this order table and then it will spell everything out.

  • So it'll didn't say Sue Bill at the address.

  • Whatever Address it ISS ordered a a three a four to making this too complicated.

  • Let's a wrench, a lever and a sprocket.

  • And so then it can say, you know, wrench, lever Ah, sprocket.

  • And then it can say the rent the wrench deliver.

  • So it's $2.54 dollars and two so that it can say, you know, to $54.2 and then it can do a little total.

  • So with PHP, PHP can add these up.

  • And so then that will come to a total price.

  • Oh, you know, $8.50 and then at the bottom there could be notes and the notes will say, you know, deliver to back door right?

  • And so PHP will then print this out on your website or we'll print it out to the printer.

  • So on and so forth.

  • What we're talking about with relational databases is basically when talking about relational databases.

  • You're talking about having different tables in the database, and they're kind of relation to each other, right?

  • So again, you can have.

  • Let's say, if you have a part you can have a part on and then you can have a manufacturer table and then you can have, like on order table.

  • And so these these will have their their own unique keys and then those.

  • So basically, here you would have the part I d.

  • As part of this table for orders and the part I d.

  • Part of this would have a manufacturer I D.

  • That would relate to the manufacturer table.

  • And so that's how the relational databases work.

  • So basically, if I'm looking at the part and I want to do a report on the park, it will give me all the information about the part and then for the manufacturer.

  • Then we'll say what the i d for the manufacturer is, and for that, then it goes to the manufacturer table, and then it's able to pull out the information that's there.

  • So that's what we're talking about with these relational databases.

  • Now, one of the big things with relaxing relational databases that can kind of muck you up at the end of the day is what is called the Schema.

  • So basically a lot of what I have just shown you is what the schema is.

  • And so what the schema is is when you develop the database, you were going to be doing all of the tables and you are going to be plugging in all of the fields for information.

  • So again, when we're dealing with a table here, right, you know, you have the user, I d Yeah.

  • You have the first name.

  • You have the last name, you have notes or whatever else, right?

  • And so basically, right here, this is the schema.

  • Why, this could become a problem is many times in the real world of I T departments is you have a database administrator, so you have the person that's responsible for the my sequel database or the Oracle database, and then you have the coders.

  • Then you have the code or something then you have the code.

  • So PHP or ruby or python or whatever else, and then you have the user's.

  • Then you have the user's well, sometimes will happen is the users will go to the developers basically the coders and they'll say, Hey, you know how we have this nice form And it asks for a first name, last name, notes and that type of thing.

  • Well, what we also want to d'oh is we also wanna have what's a A rewards awards number.

  • So when you code all of this, we want to be creating rewards number on have that stored?

  • Well, the problem is, is the people that are developing the PHP or the Ruby code they may not have access to the schema, basically be able to modify the scheme of the database.

  • So if you come up with a rewards, I d right.

  • But you have no roars.

  • I d field in your database, then you're not gonna have anywhere to store it.

  • So one of the things that comes up is with the scheme us.

  • You really have to decide.

  • Design the schema for everything that you think your application is going to require us for his data.

  • You build this out, then this is more or less set in stone.

  • And then from that you you write the software on top of that.

  • So this is one of the things that could be a little bit complicated, is basically having the coders and having the database people make sure that they're on the same page with something called the Schemer.

  • So that's the database server itself.

  • That's the tables.

  • That's the columns.

  • That's the records.

  • Now, one of the things that we have to look at is kind of the infrastructure that can be built when you're going to be dealing with database server.

  • So again in the old days and then the old way of thinking about it when you're dealing with the database, you're going to have to deal with the database server too, right?

  • So you're going to have to have a physical machine that is, a physical machine is gonna have an OS and on installed on it.

  • On top of that, you're gonna have my sequel or Maria TB or mongo D be installed on top of that, and then within that you're going to have all of your data bases, and then your applications are going be able to communicate with it, but you are going to be dealing with a server.

  • And again, the old school way of dealing with this is you have a server.

  • And so if you have a server, then you have to start thinking about things like what is the best way for your users to be able to access data off of the servers?

  • What about reliability without resiliency?

  • If a hurricane comes through, when literally wipes away all of your servers and what you do next?

  • And so that's when you start getting into things like a database server clustering, and then you start thinking about how you want the database servers to operate.

  • You want them to be what are called read write servers, Rita servers or right servers.

  • So the first thing we start talking about the database servers and an overall infrastructure is again clusters, right?

  • So we talk about clusters.

  • The idea here is that you have multiple servers that are able to communicate with each other, and they're basically able to replicate their data back and forth right, So that's one of things you deal with when you're dealing with database servers is you deal with what are called replication strategies.

  • And the idea is that if somebody adds data to one of the databases in a database server, that that data is then replicated to the other servers and the cluster so that if one of the servers fails, everything's okay because one of the other database servers in the cluster actually has the information.

  • Now, one of the things you may be sitting there you may be thinking about it.

  • Maybe like, Well, okay, so if you have all these servers in the cluster on and so you're able to read from them and you're able to write to them, you know that's great.

  • You have a cluster for liability.

  • If anyone fails, you're okay.

  • But isn't that a hacking concern?

  • If the Maur and more servers you have a cluster, there's that's more and more servers that are vulnerable to an operating system attack.

  • Or maybe one of systems doesn't get patched, or God knows what happens right?

  • If you can actually write to the data basis on all of these servers, that is a possible vulnerability for hacking.

  • And so That's when you start designing and basically start figuring out which ones of your servers will be able to have read.

  • Right?

  • So basically read right means if you go to that particular server, you can read from it and you can write to it.

  • Then you can have other servers that are read only, Right?

  • So let's say you're going to put a server out in the field so you want a database server close to your employees.

  • Let's say you have remote offices.

  • So you want a database server that's close to your employees so that they concert for information.

  • They can look up information.

  • They can get information from the server.

  • But you're worried about that hacking attack.

  • So basically what you dio is, you make it read only.

  • So when they're sitting at their computer, they ask for data.

  • They only get data back.

  • Basically, that read server is only able to be read from, and then you can have other servers.

  • Where you again, you're sitting there and you're thinking about, well again, we're gonna be building out in infrastructure.

  • We're gonna have a lot of right transactions to these servers, right?

  • So let's say think about, like credit card data bases or some kind of payment databases.

  • We're just hammering the hell out of out of these database servers.

  • You can actually make them write only.

  • So these servers are literally only built in order to have information go into them once the information goes into them, and they're able to process it.

  • They then replicate that that information their databases out to the read write and the reed servers.

  • So this is something to be thinking about when you start thinking about your actual server infrastructure.

  • So again, let's say you have a main facility right on this, as you're my sequel databases in it.

  • And so in here you may have a cluster of database servers and those air all read right.

  • So basically there read, and they're right.

  • So basically, people in the building will be able to read to them, and they'll be able to write to them.

  • These air these air fully fully functional servers.

  • But then, let's say again, you have remote offices.

  • You have remote offices out here, and you want to put in my sequel database server in those remote offices so that when the users or the employees in that remote office need to be able to access data they are able to access from the local server.

  • So if the Internet connection gets cut, or any other stupid things that happen normally in the course of business, they are still able to read from the database Because you don't want to read write database out in the field, where any little hacker can simply walk in the door, plug in a piece of equipment to that particular server and start putting down a in that will get replicated back to your main servers.

  • You don't want that kind of vulnerability, but you do want them to have read access.

  • So that's where you would have something like the Reed server.

  • Then imagine again.

  • You have something up in the cloud, all right, so, basically, again, let's say you're having some kind of transaction server, so you spin up in my sequel instance.

  • So you spend it spent upon my sequel instance.

  • You put a dedicated server on the cloud, and let's say you have all these users and they're all doing, you know, transactions.

  • And so when they're doing transactions, they need to be able to write to my sequel server.

  • And so all that's going to be doing is writing.

  • So that'll get written too.

  • And then once the information is written it, then well, then get replicated back down to the cluster that you have in your particular building.

  • Now, how all of this is gonna work because you're sitting there going, Oh, my God, that's complicated.

  • Well, that's where a programming like we just come in, right?

  • So, basically, with the programming language, what you can have happen is basically, when you're writing out your script, you can say, like when somebody goes to the website, you know, pull.

  • You know, Dad, a poll data basically from local server so you can set it up so we'll say, pulled out of from local server and then write data back to home server so you can have actually have it set up.

  • So when you have a user at your remote office and they pull up a Web page when they go to look up information when you're getting a report, it simply is pulled from that local server.

  • But when they go to write to the database, you can actually have it go.

  • So it'll automatically it'll actually route the data back to your main cluster city and your building s so that people aren't actually writing to this this local server.

  • And so again, this is where you start talking about, like, building out that intelligence and building out how the program will actually interact with all of these databases, and it can start to get pretty interesting here.

  • But one of the big ideas is again when you start dealing with actual data base infrastructure, you're gonna have read write databases.

  • You're going tohave, right?

  • Databases.

  • You're gonna have read databases.

  • You set these databases up based off of there, they're expected.

  • You sit by the end user.

  • So again.

  • So let's say let's say you have a website that people are only gonna read from.

  • God bless you.

  • Let's imagine you have a website where you got totally got rid of the comments section.

  • There is no comments.

  • We don't want to hear your comments.

  • We don't want to hear your comments.

  • Right.

  • So you have a website, you have website.

  • And when people go to the website, all that happens is their their their browser.

  • Basically, you get a Web page printed out based off of the information that the server is providing.

  • So with that, you could literally have just a read only database.

  • You can have it read only database, because when PHP goes the database, it will grab the information it will then print to your screen.

  • And you don't get to comment.

  • You don't get the longer you don't get to do anything else.

  • None for you.

  • We're tired of your crap.

  • I don't want to hear what you have to say, right?

  • Um, and so what you could do is like with that kind of infrastructure is again in your building.

  • You have a bunch of writers, and so what you could do is you can have a database server inside your building.

  • Your writers are able to write to that database server.

  • So when they write a post right when they write a post, when they write an article that will get written to that server and then you have a my sequel or database server up in the cloud, and basically, once they write to your local server, it will send simply then replicate out to that read server.

  • Why this is important, then, is basically, you can lock down this communication.

  • The Onley communication that can happen from the server on the cloud and your server locally is basically you can send outgoing replication data to the server.

  • That's it.

  • You shut down the ports.

  • There's no SS ache.

  • There's no FTP.

  • You only allow communication in the direction that you want.

  • You only allow the ports that you require, and then that creates a nice pouring of security.

  • So when users then go to access your website there, then simply hitting a read only database server that has basically no riel connection back to your internal infrastructure.

  • So this is a big problem that a lot of companies have.

  • Is they set up when he's my sequel or these database servers?

  • They give it read right access, and it's in the same effing a building at the same facility.

  • It's on the same sub net or network is everything else, and so you have a malicious actor.

  • I was able to do something called a sequel injection attack there, then able to gain control of that sequel server and then, once they've gained control of the sequel server all hell breaks loose.

  • If you have a read on Lee Server that sitting up in the cloud, the only way it gets communicated to buy your internal infrastructure is simply by outgoing, basically, database updates.

  • Then there is no right.

  • There is no right here.

  • You can't do the sequel injection attacks.

  • Even if you could theoretically compromise this server, it's up on the cloud.

  • It's firewall to Hi, Helen.

  • Back on Lee.

  • The appropriate ports are open.

  • So worst case scenario, you have to rebuild this one server versus worrying about your internal structure being compromised.

  • So this is the type of thing that you really need to be thinking about when you start building out your database infrastructure.

  • And this is one of those things that gets overlooked way too often.

  • So that's a bit of an introduction to databases in regards to cloud computing for you again, If you're an old school database administrator, stop.

  • Just stop.

  • I've got to start the kids somewhere.

  • I've got to start the kids somewhere if you're a kid and you've been reading ahead in the book and you heard about no sequel databases and ski Melis stuff and all that kind of stuff.

  • Just stop.

  • Come back, Come back.

  • We will talk about all that later.

  • Again.

  • One of the big problems we run into when we start talking about technology is all of these technologies are absolutely huge.

  • Feels unto themselves.

  • And so one of the issues you run into is where the hell do you start from?

  • So I think by starting with relation all databases kind of talking about the old, how the old database servers worked, talking about again the databases themselves, talking about the tables, the columns, the records, talking a little bit about read, right.

  • You know, those types of servers and clustering I think this is a good place to start from.

  • And then you can go out and you can start understanding a little bit, Maur what you're looking at when you do start to research databases again.

  • Databases issue is one of those things, like people overlook it.

  • People you don't realize like being a database administrator, being a database administrator for one particular product.

  • That's a job that's a job.

  • For some reason, I don't know why it iss people just kind of overlooked databases, and they're just like Yeah, you know that little back in being.

  • But in reality again, when you start talking about multiple servers when you talk about millions or billions of records, when you talk about all these things, things get complicated very quick and again, it requires a lot of maintenance that requires a lot of understanding.

  • One of the big things to be thinking about that when you're dealing with databases again when you're new, do you realize all the database does?

  • Is it stores the records?

  • First names, last names, part numbers, that type of thing.

  • That's it, right?

  • You don't get a front end with it.

  • You don't get intelligence with you.

  • Don't get all that fancy again.

  • When you sit down and deal with access, you're like, Oh, this is database software.

  • This isn't too bad.

  • I just realized access is giving you everything.

  • Access is giving you the back end the database component, and it's giving you the front end, basically able to build the user interface, and it's giving you the coding for the user interface to talk with the database.

  • It's giving all of you all that stuff in one package.

  • When you go out, you use my sequel, Mongo D Be Maria de Be Aurora.

  • Hang on 1000 different databases out there.

  • The important thing to understand is they're just going to give you that activist.

  • Here's where we store the records.

  • H

creating these classes requires equipment and service.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

雲計算 - 數據庫介紹 (Cloud Computing - Database Introduction)

  • 20 1
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字