Pushing umbraco to the limits
-
Upload
dawoe -
Category
Technology
-
view
102 -
download
0
Transcript of Pushing umbraco to the limits
![Page 1: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/1.jpg)
PUSHING UMBRACO TO THE LIMITS
While building New Heroes
![Page 2: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/2.jpg)
• Lead developer @coloursinternet• Umbraco MVP 2016/2017• Working with Umbraco since late 2007 (v3)
Dave Woestenborghs @dawoe21
• Senior Developer @coloursinternet• 3 times Umbraco MVP• Working with Umbraco since 2009 (v4)• Was looking for a job last year during CG.
Since than only been working on this project.
Jeroen Breuer@j_breuer
INTR
OD
UCT
ION
![Page 3: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/3.jpg)
Pushing umbraco to the limits
THE AGENDA1. What is New Heroes2. Statistics3. Load balance setup4. 1-1 multilingual5. Database access6. Miniprofiler7. Performance tweaking8. Pluginmanager9. Other techniques10. Questions
![Page 4: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/4.jpg)
NEW HEROESNew Heroes is an online platform that allows access to soft skills and leadership training for anyone , anytime and anywhere in the world .
Through the platform , users can continue develop in the areas of communication, personal empowerment and leadership.
![Page 5: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/5.jpg)
5
NEW HEROES
For a fixed and low monthly amount, both individuals and businesses, have unlimited usage of all trainings , also known as 'learning journeys ' .
01
![Page 6: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/6.jpg)
VID
EO
![Page 7: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/7.jpg)
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS 02The statistics
• Lines of code : 69k• Git commits : 7500+• Community property editors : 4• Community tools : 7• Custom build property editors : 1
STATS CODE
![Page 8: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/8.jpg)
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS 02The statistics
• Umbraco Version : 7.3.8 (started on 7.3.0-beta1)• Number of media items : 1263• Number of content items : 8411• Number of cache instructions : +37k• Number of doctypes : 205
STATS UMBRACO
![Page 9: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/9.jpg)
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS 02The statistics
• Number of times that Jeroen deleted the wrong doctype : 2
STATS MISTAKES
![Page 10: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/10.jpg)
Development goals
• Application should autoscale• Use core/community functionality where possible • Focus on performance• DRY backend and front end• 1-1 multilingual for reusable content
OUR GOALS
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 11: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/11.jpg)
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS 03Load balance setup
• Hosted on Azure (Blob storage / redis cache)• VM with editors environment (master)• Front end runs on auto scaling web app (slaves)• Started on 7.3 beta because of the flexible loadbalancing
(no config for loadbalancing needed)• But you need to have some config tweaks. So make sure
you read the loadbalancing docs on our.umbraco.org
LOADBALANCED
![Page 12: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/12.jpg)
12
LOAD
BALA
NCE
D • Use correct events to update custom cache (e.g. output cache)
• Published event is only executed on the server where it’s triggered. Not on all other servers.
• Hook in to CacheRefreshers CacheUpdated event instead. PageCacheRefresher.CacheUpdated += (sender, args) =>{ { // clear cache here };
![Page 13: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/13.jpg)
13
LOAD
BALA
NCE
D • For custom needs it’s possible to create your own cache refreshers .
• Need to create a class that implements ICacheRefresher interface.
• Umbraco has some base classes that you can inherit from like CacheRefresherBase and JsonCacheRefresherBase
• When your data is changed tell the distributed cache that it needs to execute a method on the cacherefresher :
• DistributedCache.Instance.RefreshAll(CustomCacheRefresherGuid);
• And handle the CacheUpdated event for the cache refresher
![Page 14: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/14.jpg)
0414
1-1 multilingual
MULTILINGUAL SETUP
![Page 15: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/15.jpg)
15
MU
LTIL
ING
UAL
SETU
P
• Still uses a separate language tree• Nodes that need to be reused in a shared data folder.• Uses a UrlProvider and ContentFinder.• Vorto for the 1-1 properties• Nested Content to create fieldsets• ModelsBuilder for strongly typed fieldsets.• http://24days.in/umbraco/2015/multilingual-vorto-nested-
content/
![Page 16: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/16.jpg)
16
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 17: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/17.jpg)
17
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 18: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/18.jpg)
18
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 19: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/19.jpg)
19
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 20: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/20.jpg)
20
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 21: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/21.jpg)
21
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 22: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/22.jpg)
22
REN
DER
![Page 23: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/23.jpg)
23
MO
DEL
S BU
ILD
ER
![Page 24: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/24.jpg)
24
URL
PRO
VID
ER
![Page 25: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/25.jpg)
25
CON
TEN
T FI
ND
ER
![Page 26: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/26.jpg)
05Database access
• Needed custom database tables for storing user data• Needed to select a ORM• Decided to go with PetaPoco because it ships with
Umbraco.
DATABASE ACCESS
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 27: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/27.jpg)
27
EXAM
PLE
POCO
![Page 28: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/28.jpg)
28
CRU
D O
PERA
TIO
NS
![Page 29: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/29.jpg)
29
Database access
• Goal was to do database maintenance (creating, modifying tables) from code so that it becomes part of the automated build process.
• We’re using uSync for all Umbraco parts.
MAINTENANCE
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 30: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/30.jpg)
30
PETA
PO
CO A
TTEM
PT
![Page 31: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/31.jpg)
31
• Only possible to create and drop tables• No ways to alter tables, add constraints and indexes• Needed an alternative
PETA POCO ATTEMPT
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
Database access
![Page 32: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/32.jpg)
32
• Migrations is used by Umbraco process• Have been in place since 6.0.0• Open to the general public since 7.3.0
MIGRATIONS
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
Database access
![Page 33: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/33.jpg)
33
MIG
RATI
ON
S
![Page 34: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/34.jpg)
34
MIG
RATI
ON
S
![Page 35: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/35.jpg)
35
MIG
RATI
ON
S
![Page 36: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/36.jpg)
36
MIG
RATI
ON
S
![Page 37: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/37.jpg)
0737
Miniprofiler
PERFORMANCEMINIPROFILER
![Page 38: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/38.jpg)
38
LOG
GIN
G E
XECU
TIO
N T
IME
![Page 39: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/39.jpg)
39
LOG
GIN
G E
XECU
TIO
N T
IME
![Page 40: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/40.jpg)
40
LOG
GIN
G E
XECU
TIO
N T
IME
![Page 41: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/41.jpg)
41
MVC
WIT
H H
TML.
ACTI
ON
![Page 42: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/42.jpg)
42
MVC
WIT
H H
TML.
ACTI
ON
![Page 43: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/43.jpg)
43
EXAM
INE
![Page 44: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/44.jpg)
44
DAT
ABAS
E
![Page 45: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/45.jpg)
07Pluginmanager
Whenever types need to be found in assemblies in order to add them to resolvers, the PluginManager should be used. The TypeFinder should never be used directly in any code except for in PluginManager extension methods or in the PluingManager itself.• PluginManager.Current.ResolveTypes<T>• PluginManager.Current.ResolveAttributedTypes<T>()• PluginManager.Current.ResolveTypesWithAttribute<T,S>
PLUGINMANAGER
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 46: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/46.jpg)
Pluginmanager
A Resolver is an class that returns a plugin object or multiple plugin objects. There are 2 types of Resolvers: A single object resolver and a multiple object resolver.Some examples :Single object resolver : DefaultRenderMvcControllerResolver.CurrentMultiple object resolver : UrlProviderResolver.Current
OBJECTRESOLVERS
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 47: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/47.jpg)
47
EXAM
PLE
![Page 48: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/48.jpg)
48
EXAM
PLE
![Page 49: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/49.jpg)
49
EXAM
PLE
![Page 50: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/50.jpg)
50
Pluginmanager
EXAMPLE• Only possible to create and drop tables• No ways to alter tables, add constraints and indexes• Needed an alternative
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 51: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/51.jpg)
51
09Other techniquesOTHER TECHNIQUES• Custom section with Angular + Umbraco WebApi +
PetaPoco• Virtual nodes• Service API (ContentService, MediaService,
RelationService)• ImageProcessor to resize images• Dependency Injection• Custom property value converters
PU
SH
ING
UM
BR
AC
O T
O T
HE
LIM
ITS
![Page 52: Pushing umbraco to the limits](https://reader030.fdocuments.us/reader030/viewer/2022020922/589a0dd61a28ab7a318b605f/html5/thumbnails/52.jpg)
Pushing umbraco to the limits
QUESTIONS?