4. What Are Microservices? What are microservices? They are programmaticbuilding blocks Each has a single purpose and focuses on that single purpose If new technology comes along or we need to replace some functionality, the functional definitions allow us to add, subtract, or swap out these blocks
5. CDL’s Definition Devolve function into a granular set of independent, but interoperable micro-services Since each is small and self-contained, they are collectively easier to develop, maintain, and deploy Since the level of investment in any given service is small, they are easier to replace when they have outlived their usefulness The scope of each service is limited, but complex behavior can emerge from the strategic composition of individual atomistic services All service interactions through public interfaces
6. A Brief History of Microservices In computing, you have a ‘technology stack’ (i.e. the LAMP stack: Linux, Apache, MySQL, and PHP) California Digital Library has been working on creating individual services for each of the functions of a repository (deposit, retrieval, storage, index, etc.) (Merritt)
7.
8. WebsiteMicroservices These are the microservices that will make up the construction of the MSEL Library Website: JSON flat files (Content Storage) Mustache (Templating) Compass (Style & Layout) JQuery UI (UI Elements) JQuery BBQ (State Handling) Google (Site Search) git (Version Control) Bonsai (Compiler/Static Output) YUI Compressor (Compression) Lemonade (Image Processing) PHP-Typography (Document Formatting) Custom Sitemap Generator (Indexing)
9. JSON Flat Files Instead of keeping content in a database, we’ll be keeping it in individual files JSON keeps it structured Works well with version control systems
14. Compass http://compass-style.org CSS can be very difficult to maintain Compass allows you to write rules and logic that are not possible in CSS These compass files are then compiled into CSS that works on every web browser
17. JQuery UI http://jqueryui.com A convenient set of user interface widgets (buttons, dialog boxes, etc.) and interaction effects (animation, show/hide functions, etc.) Themable
20. Google We’ll be leveraging Google’s site search to allow users to search website content It’s free, why not use it?
21. git Version control system Allows us to “roll back” to previous versions of content, or indeed, previous versions of site functionality
22. Bonsai http://tinytree.info A set of scripts that ‘compiles’ the website from these disparate microservices into directories and HTML that can be uploaded to any web server
28. Custom Sitemap Generator In order to help out Google, we need a custom sitemap For our case, we want to make sure that Google indexes all of our dynamically-built URLs
29. Benefits of the Microservices Approach More feature-rich, but ultimately smaller and easier to maintain website Adaptability Content mobility
30. Content Mobility With the number of websites and presences we are a part of, we need a standard way to serve information from one place We can serve up the hours content as standard JSON, and use the Javascript version of Mustache to embed that data anywhere we need to. Website, JHU Portal, Blog, wherever. Write once, update everywhere
Has looked this way since 2004Desperately in need of a redesign
After some content/user behavior analysis, I determined that most of the most-used content is infrequently updated static content. We don’t need a CMS. We just need HTML.
California Digital Library has done a lot of work developing the microservices concept and is building a repository based on these concepts. Go to http://merritt.cdlib.org/ to read more about that.
Singular technologies that when combined, produce a single product (a database-driven website, in the case of LAMP)Same concept, but applied on a much more specific level in order to build a website
More or less broken up into four categories, content / visual design, integration / interaction, compilation and storage, and post-processing
12 individual microservices
Our “data” is just text, anyway.Version control systems are work well with text
The site will have a couple templates (layouts without any content), and Mustache brings the JSON-stored content and the layouts together to produce content-filled webpages
Headline and body are going to get pulled from the JSON, you can see also how you can include other templates for the header, footer, and analytics.
A flavor of SASS designed to look more CSS-likeMuch easier to maintainVariables, nested definitions, mixins
Compass allows for mixins, nested definitions, variables
This gives URLs to pages that don’t actually exist.By doing this, you can go back and forth using the back button in a dynamic applicationFor this site, this will allow users to bookmark the dynamic portions of the site (such as the staff contact search)You’ll see the /!#/ convention in Twitter and Facebook URLs. Same thing.
Because some portions of the site are dynamic, it will require a custom sitemap generator to index all of the content
Has a very advanced forking and merging system which would allow us to work on parallel versions of the site (for, say, a redesign) and then merge these changes back with ease
In order to be incorporated, all of the microservices are essentially ‘plugins’ to the Bonsai build system.This could really be a set of nicely complex ‘ant’ scripts, but I like bonsai for now.
Compressor takes Javascript and CSS files and reduces their file size by removing comments and simplifying variable names
CSS definitions then define the boundaries of the sprite, showing the user only the part of the (larger) graphic that is appropriate for that space
Sitemaps tell search engines where specific resources are and how to index them
Want to support the latest touch device? Write a new template, hit ‘compile’ and upload the new website.Maybe Compass is getting stale and we want to take advantage of the latest and greatest CSS specifications? Just swap it out.
Hours is a huge one
Most of these microservices take in HTML and spit out HTML, so that’s easy.Or takes in CSS and spits out CSSSwapping in and out of services only becomes complex when it takes in one data type and spits out another.