All language subtitles for 002 How To (Not) Connect To A Database_en

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

Now, before we dive into any demo or any code

let's understand how React apps do talk to databases.

And as you can tell, by the title of this slide,

it's not working as you maybe thought it works

because React apps, or in general browser-side apps,

browser-side code, so JavaScript code

running in the browsers

should never directly talk to a database.

So, if you have a React app and then some kind of database,

a SQL database, a NoSQL database like MongoDB

it does not matter if you have such a database running

on some database server then, of course,

you might want to fetch and store some data

and you might wanna establish a connection,

but that's not what you should do

and that's not what you'll ever see out there in the wild

unless it's a highly insecure and bad written application.

Because if you would directly connect to a database,

if we leave a site that this will technically

be challenging, but if you would do that,

if you would directly connect to a database server

from inside your client-side, your browser-side

JavaScript code, you would expose your

database credentials in that code.

Because you must never forget that all JavaScript code

running in the browser can be accessed and read,

not just by the browser,

but also by the users of your website.

Simply open up the developer tools

and you can view all the code there.

This generally is no problem, and attached you'll find

a more detailed article and video which I created on this.

But, of course, it will become a problem

if you expose security relevant details in your code.

For example, credentials that allow access to a database.

In addition, directly connecting to a database

could also bring other problems like performance issues

but the security problem is the biggest problem of all.

So, therefore, instead of directly talking to a database

from inside your reactive code,

you always take another route.

You have a Backend application running on another machine

not running in the browser,

but running on some server out there,

maybe on the same server as the database,

often on a different server, though.

Now, this Backend application can be written

with any server-side language of your choice,

NodejS, PHP, ASP.NET, everything is possible.

And it's this Backend application

which will do the talking to the database,

because you can safely store and use database credentials

on the Backend application since that Backend code

can't be viewed by your users.

It's on a different server and the users

of your website will never see that code.

And, therefore, the reactive will then talk

to that Backend server, to that Backend API, typically,

which is a server which exposes different URLs

requests can be sent to

and we're going to see this throughout this section.

And then you have a safe connection to the database

because the credentials are on this Backend app,

and for talking to the Backend app

no security relevant details are needed.

This is how this works, and this is what we're going to see

in action in this course module.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.