10. Drupal can be a:
● Personal blog
● Company official site
● Community forum
● Online commerce shopping mall
● Company intranet portal
● Heavy media site
● Video portal
● Mobile backend CMS
11.
12.
13.
14.
15.
16.
17.
18.
19. CMS?
Development oriented CMS
● Not (only) a framework
● config many things in UI
● Abstract in data layer
● Need 3-party modules
39. Session Storage
before 2008, Drupal 6 save session to DB
https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/_drupal_bootstrap/6
40. Session Storage
after 2011, Drupal 7, have plugable Session config in core
https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupal_bootstrap/7
41. Session Storage
after 2014, Drupal 8 include better handler from Symfony 2
Drupal 8 API: http://goo.gl/VVQ2Ua
42. Session Storage
PHP 5.4 also have better SessionHandler class
http://php.net/manual/en/class.sessionhandler.php
43. File Storage
● After upload
can other instance saw files?
46. File Storage
● After upload, send to AWS S3 or FTP?
– Yes! by hook_file_copy
● Before display, alter URL for CDN support?
– Yes! by hook_file_url_alter
● When load file, streaming by other host?
– Yes! by hook_file_load
50. Database Scaling
Drupal 6 - happy querying, tragedy scaling
function statistics_get($nid) {
if ($nid > 0) {
// Retrieve an array with both totalcount and
daycount.
$statistics = db_fetch_array(db_query('SELECT
totalcount, daycount, timestamp FROM {node_counter}
WHERE nid = %d', $nid));
}
return $statistics;
}
51. Database Scaling
Drupal 7 – DB abstract layer
$statistics = db_select('node_counter', 'n')
->fields('n', array(
'totalcount',
'daycount',
'timestamp'))
->condition('nid', $nid,'=')
->execute()
->fetchAssoc();
● Support another Database (not MySQL only)
● Separate R/W query easily
52. Database Scaling
random slave every time DB bootstrap
# default master (read / write query)
$databases['default']['default'] = $info_array;
# multiple slave (read only query)
$databases['default']['slave'][] = $info_array;
$databases['default']['slave'][] = $info_array;
58. Why a CMS designed like this?
● Pro
– Quick and easy to enter Drupal (even not Engineer)
– Can stack special requirement into Drupal
– When more function or more user, scale out
● Cons
– Not so easy (if you would like to develop with D)
– Not so flexible vs framework (because it isn’t)
– Definitely can scale if well planned, but always not
60. you may interested in:
● 2.4 million page views per day in Drupal
http://sf2010.drupal.org/conference/sessions/24-million-page-views-day-6
0-m-month-one-server.html
● Auto Scale Drupal setup in AWS
http://www.slideshare.net/burgerboydaddy/scaling-drupal-horizontally-and-in-
cloud
● Drupal vs Django
http://birdhouse.org/blog/2009/11/11/drupal-or-django/
● Drupal with nodejs
https://www.drupal.org/project/nodejs
● Drupal with Docker
https://github.com/ricardoamaro/docker-drupal
● Drupal with MongoDB
https://www.drupal.org/project/mongodb
61. Thank You!
You can also find Drupaler here:
1. DrupalTaiwan.org
2. goo.gl/PxuhqQ
每週三晚上8:00 Hangout 網路聚
3. FB/groups/drupaltaiwan/
DrupalTaiwan Facebook 社團