Jump to content
php.lv forumi

Cik daudzi no jums lieto?


mypoint

Recommended Posts

Sveiki! Nolēmu šo tēmu izveidot intereses pēc.

Cik daudzi no jums lieto MySQL?

Cik daudzi no jums lieto MySQLi?

Cik daudzi no jums lieto PDO?

 

Kā arī tiem kuri ir lietojuši MySQLi gan PDO. Kurš no viņiem jūsuprāt ir labāks, ja jālieto tikai ar MySQL tipa DB?

 

 

Link to comment
Share on other sites

Visus vecos projektus esmu pārlicis no mysql uz mysqli, jo tas bija diezgan vienkārši. Jaunajos projektos "pa taisno" ar db nedarbojos, bet izmantoju dažādo ietvaru db risinājumus...

Ja vari, tad nomaini topika nosaukumu- nevar uzreiz saprast, ko tu gribi...

Edited by malinens
Link to comment
Share on other sites

Par performanci, MySQLi ir savus 5% ātrāks par PDO, bet lielākos projektos diez vai izvēle starp PDO un MySQLi būs dēļ to veiktspējas. Drīzāk pēc tā, kāds slānis tiks implementēts virs MySQLi vai PDO. Bet te jau atkal jādomā par izstrādes laika - veiktspējas trade-off.

Edited by F3llony
Link to comment
Share on other sites

Nu ne visur arī gluži PDO un ORM izmantoju :D Iedomājies, korpolapa ar kontaktu formu, atsauksmēm un jaunumiem kas sastāv no 5 kverijiem uz full-blown orma PDO un noskeilota uz mākoņa. :D

 

P.S kāds šim topikam sakars ar drošību?

Edited by F3llony
Link to comment
Share on other sites

> Iedomājies, korpolapa ar kontaktu formu, atsauksmēm un jaunumiem kas sastāv no 5 kverijiem uz full-blown orma PDO un noskeilota uz mākoņa.

 

Neredzu problēmu nelietot ORM. Tieši šāda tipa lapai pati performance būs visnesvarīgākā, tā kā...

Link to comment
Share on other sites

ORM un MySQL nav salīdzināms.

 

ORM ir datubāzes menedžēšana ar objektiem. Attiecīgi, klase ir tabula, bet klases instance — ieraksts. Tas ļauj nerakstīt SQL pašam (to izdara pats ORM), bet nedaudz (daudz? tā jau ir cita diskusija) cieš kopējā performance. ORM var būt vairāki bakendi, piemēram, MySQL, PostgreSQL, SQLite... pat NoSQL, kā MongoDB.

 

Re kur pats pseido-kods, kā varētu izskatīties strādāšana ar ORM:

 

~~~

user = User.create("daGrevis", "phpsux")

article = Artice()

article.user = user

article.title = "PHP Sux"

article.content = "This is article tries to say that PHP sux."

article.save()

print article.pk # 1

# Lets request the same article again.

article_copy = Article.get(article.pk)

article_copy.delete()

Article.delete_all()

print Article.count() # 0

for user in User.all():

print article.signature

# PHP Sux

# PHP Sux even more

# PHP is the most suxy, suxy thing

~~~

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...