Had enough of serialized item merge conflicts? Come see how you can reduce merging pain and keep Sitecore items in sync across environments with Unicorn 3 and the Rainbow serialization engine.
Kam Figy - Serialization 2.0 with Unicorn and Rainbow - SUGCON
1. Organized by the Community, for the Community.
NEXT GENERATION
SERIALIZATION WITH
UNICORN 3
Kam Figy
Connective DX
@kamsar
2. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015
GOOD MORNING
3. Organized by the Community, for the Community.
WHY DOWE NEED
SERIALIZATION?
• Sitecore dev artifacts are a mixture of code files
and items, such as templates or renderings.
• Items are stored in the Sitecore database, code
is stored in source control.
• Source control commits are incomplete without
the items that complement the code.This is
bad.
Without serialization.
SUGCON NORTH AMERICA 2015 3
4. Organized by the Community, for the Community.
WHY BUILD
UNICORN?
• Back in the dark ages, we used shared
databases.
• We used packages.
• We triedTDS.
• None of these delivered the frictionless
development experience we desired.
SUGCON NORTH AMERICA 2015 4
5. Organized by the Community, for the Community.
HOW DOES
UNICORN WORK?
• You choose items to serialize.
• Database items are written to files on disk.
• Changes in Sitecore are updated to disk in real
time.
• “Sync” pushes changes from disk into your local
database.
• Merging is always done on disk.
SUGCON NORTH AMERICA 2015 5
6. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 6
STOP
DEMOTIME
7. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 7
DEMO:
SETTING UP UNICORN
In which we taunt the demo gods
8. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 8
DEMO:
TEAM COLLABORATION
In which we bite our thumbs at the demo gods
9. Organized by the Community, for the Community.
WHAT’S NEW IN UNICORN 3?
Features
• New format (YAML)
• New storage (SFS)
• Sitecore UI warnings
• Partial sync
• Partial reserialize
• Auto publish synced
• Split config schema
• Sync event pipelines
Improvements
• SPEED: 50% more of it
• Better messaging
• More extensible
• No Ninject required
• Versioned to shared
field conversion
• Fresh paint on the UI
• More info:
http://goo.gl/XwMjTa
SUGCON NORTH AMERICA 2015 9
10. Organized by the Community, for the Community.
RAINBOW:
A MODERN ITEM
SERIALIZATION
LIBRARY
Overview:
http://goo.gl/Yl4gkM
More about format:
http://goo.gl/LPMbVv
More about hierarchy:
http://goo.gl/8cSDNm
SUGCON NORTH AMERICA 2015 10
• Rainbow is a code library for serialization.
• Unicorn uses Rainbow.
• Easy to read file format.
• Human readable file hierarchy.
• Designed to be easy to merge when conflicts
occur.
• Item comparison APIs.
11. Organized by the Community, for the Community.
RAINBOW: SERIALIZING A MULTILIST FIELD
With Sitecore serialization format
…
Content-Length: n
{GUID}|{GUID}|{GUID}
If you and someone else both add a
GUID, you get a merge conflict and
have to manually recalculate
content length.
With Rainbow’sYAML format
…
{GUID}
{GUID}
{GUID}
Line oriented format increases
automerge chance,
no content length.
SUGCON NORTH AMERICA 2015 11
12. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 12
ONE MORETHING
13. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 13
INTRODUCING
TRANSPARENT SYNC
14. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 14
15. Organized by the Community, for the Community.
TRANSPARENT
SYNC
• Automatic, real-time sync.
• One less thing to remember to do.
• Amazing for code reviews.
• Great for dev artifact items.
• SSD recommended for the I/O.
• Enabled per-configuration.
• New deployment possibilities.
SUGCON NORTH AMERICA 2015 15
16. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 16
DEMO:
TRANSPARENT SYNC
In which we laugh at the demo gods
17. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015 17
QUESTIONS
“IS UNICORN 3 OUTYET?”
YES. RIGHT NOW.
18. Organized by the Community, for the Community.SUGCON NORTH AMERICA 2015
THANKYOU!
UNICORN IS AVAILABLE ON NUGET
OPEN SOURCE (MIT) ON GITHUB
TWEET @KAMSAR
BLOG: KAMSAR.NET
Source:
https://goo.gl/VF3Mkd
Documentation:
https://goo.gl/ePFki1