SlideShare a Scribd company logo
1 of 172
Apereo OAE
Bootcamp, San Diego 2013
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Or something else?
Wednesday, 12 June 13
“Supporting academic collaboration”
Wednesday, 12 June 13
Wednesday, 12 June 13
Project goals
• Multi-tenant platform
• Cloud-ready
• SaaS
• Used at large scale
Wednesday, 12 June 13
Project goals
• Maintainable
• Extendable
• Integrate-able
Wednesday, 12 June 13
Solid foundation
Modern, not exotic
Wednesday, 12 June 13
July 1, 2013
1st production release
Wednesday, 12 June 13
Multi-tenancy
Wednesday, 12 June 13
Multi-tenancy
Wednesday, 12 June 13
Multi-tenancy
Wednesday, 12 June 13
Multi-tenancy
Wednesday, 12 June 13
Multi-tenancy
• Market is heading
• Support multiple institutions at same time
• Multi-tenancy+
• Easily created, maintained and configured
Wednesday, 12 June 13
Performance!
• Ability to scale horizontally
• Evidence based
• Continuous
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Wednesday, 12 June 13
OAE Architecture
The Apereo OAE project is made up of 2 distinct source code
platforms:
• “Hilary”
• Server-side RESTful web platform that exposes the
OAE services
• Written entirely using server-side JavaScript in Node.js
• “3akai-ux”
• A client-side / browser platform that provides the
HTML, JavaScript and CSS that make up the browser
UI of the application
Wednesday, 12 June 13
OAE Architecture
Wednesday, 12 June 13
Hilary System Architecture
Wednesday, 12 June 13
Application Servers
• Written in server-side JavaScript, run in Node.js
• Node.js used by: eBay, LinkedIn, Storify, Trello
• Light-weight single-threaded event-driven platform that process IO
asynchronously / non-blocking
• Uses callbacks and an event queue to stash work to be done after IO or
other heavy processes complete
• App servers can be configured into functional specialization:
• User Request Processor
• Activity Processor
• Search Indexer
• Preview Processor
Wednesday, 12 June 13
Apache Cassandra
• Authoritative data source
• Provides high-availability and fault-tolerance without trading away performance
• Regarding CAP theorem, Cassandra favours Availability and Partition Tolerance over
Consistency, however consistency is tunable on the query-level (we almost always
use “quorum”)
• Uses a ring topology to shard data across nodes, with configurable replication levels
• No RDBMS?
• Cassandra gives more flexibility with incremental scalability in a cloud
environment
• Flexible scaling helps to overcome unpredictable growth of multi-tenant systems
• Medium-to-long term options for replicating data to multiple data-centers for
localizing both reads and writes
• Used by: Netflix, eBay,Twitter
Wednesday, 12 June 13
ElasticSearch
• Lucene-backed search platform
• Built for masterless incremental scaling and high-
availability
• Powers Hilary search, including library, related content,
group members and memberships
• Exposes HTTP RESTful APIs for indexing and querying
documents
• RESTful query interface uses JSON-based Query DSL
• Used by: GitHub, FourSquare, StackOverflow,WordPress
Wednesday, 12 June 13
RabbitMQ
• Message queue platform written in Erlang
• Used for distributing tasks to specialized
application server instances
• Supports active-active queue mirroring for
high availability
• Used by: Joyent
Wednesday, 12 June 13
Redis
• Fills a variety of functionality:
• Broadcast messaging (can move to RabbitMQ)
• Locking
• Caching of basic user profiles
• Holds volatile activity aggregation data
• Comes with no managed clustering solution (yet), but has slave
replication for active fail-over
• Some clients manage master-slave switching, and distributed
reads for you
• Used by:Twitter, Instagram, StackOverflow, Flickr
Wednesday, 12 June 13
Etherpad
• Open Source collaborative editing
application written in Node.js
• Originally developed by Google and Mozilla
• Licensed under Apache License v2
• Powers collaborative document editing in
OAE
Wednesday, 12 June 13
Nginx
• HTTP and reverse-proxy server
• Used to distribute load to application
servers, etherpad servers and stream file
downloads
• Useful rate-limiting features based on
source IP
• Used by: Netflix,WordPress.com
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Wednesday, 12 June 13
Clustering Cassandra
• Cassandra uses a partitioned ring topology to distribute data
• Nodes are given a numeric token which determines their
“location” in the ring
• When data rows are read / written to Cassandra, the row
key is hashed using a “Partitioner”, which determines what
node holds the row’s data
• “Replication Strategy” is used to determine which nodes will
hold replicas of which rows
• E.g.“Simple Strategy” will use the N - 1 nodes clockwise
around the ring from the primary node
Wednesday, 12 June 13
Clustering Cassandra
(cont’d)
Wednesday, 12 June 13
Clustering Cassandra
(cont’d)
• Query consistency specified at request time
• ALL - All nodes must respond successfully
• LOCAL_QUORUM - (RF/2 + 1) nodes (in the
datacenter) must respond successfully
• EACH_QUORUM - (RF/2 + 1) nodes (in all
datacenters) must respond successfully
• ONE - Only one node must respond successfully
• Therefore, if you write with QUORUM then read with
QUORUM, then results should always be consistent
Wednesday, 12 June 13
Clustering ElasticSearch
• ElasticSearch shards data into a configurable
number of shards
• “Number of Replicas” can be configured at
runtime, which determines how many replicas
of each shard should exist
• Shard replicas are distributed among the
nodes in the cluster
• Shard is identified by hash of the document id
Wednesday, 12 June 13
Clustering ElasticSearch
(cont’d)
Wednesday, 12 June 13
Clustering Etherpad
• Short and sweet: It doesn’t really cluster
• Data is stored in Cassandra, but active sessions must all share
the same etherpad server
• Configure number of etherpad servers and their hosts in
Hilary, and configure Nginx to proxy to the appropriate
server
• Server is selected based on a numeric hash of the content
item id
• No high availability. If an etherpad server goes down, those
sessions are disconnected :( But etherpad content is retained
Wednesday, 12 June 13
Clustering Etherpad
(cont’d)
Wednesday, 12 June 13
Clustering RabbitMQ
• Uses a Master-Slave Active/Active queue mirroring
policy for redundancy
• We set a policy of ha-mode=all to all OAE queues
• Ensures messages are replicated to all queues
• Ensures all subscribed consumers receive
messages
• Since all nodes are active peers, when a node fails,
consumer simply reconnects
Wednesday, 12 June 13
Clustering Search
Indexers
• Search Indexers are regular application
nodes configured to consume search index
tasks
• INDEX_UPDATE, INDEX_DELETE
• Offloads fetching and processing of
indexing tasks to nodes that don’t impact
request latency
Wednesday, 12 June 13
Clustering Activity
Processors
• Regular application nodes that
• Receive and route activity tasks
• Collect and aggregate routed activities
• May be configured with dedicated Redis server for aggregation
• Aggregation is the process of deeming 2 or more activities “similar” and grouping them
into a single activity
• Maintains temporary information in Redis to keep track of what activities have occurred
recently and aggregate them on-the-fly
• Due to concurrency issues when aggregating new activities into feeds, routed activities are
sharded into “concurrency buckets”
• Avoids duplicate activities in streams, while not completely serializing the aggregation
process
• Bucket is selected based on a hash of
• Activity Stream ID (e.g., user or group id)
• Activity Type (e.g., share content, add to group, etc...)
Wednesday, 12 June 13
Clustering Activity Processors
(cont’d)
• Activity0 and Activity1 were serialized into bucket 0 to
avoid concurrency collisions in “user A”s stream
• A bucket is only collected by one activity processor at
a time
• An activity processor can concurrently collect multiple
buckets (max concurrent buckets is configurable)
• Number of buckets is configurable (is 3 in this
example)
Wednesday, 12 June 13
Clustering Preview
Processor
• Regular application node that is specialized
to handle preview processing tasks
• GENERATE_PREVIEWS
• Offloads the CPU and memory-intensive
process of generating previews to machines
that don’t impact user request latency
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Still with us?
Wednesday, 12 June 13
Hilary design and
extension points
• Common patterns
• Search
• Activities
• File storage
• Preview Processor
Wednesday, 12 June 13
Search producers /
transformers
• Search producers
• Generates documents that need to go in the
index
• Search transformers
• Transforms query results coming back from ES
into something the UI can use
Wednesday, 12 June 13
Search Producers
• Produces documents that can be indexed/stored
by ElasticSearch
• Simple JSON document
• A search document contains the full profile. (ie no data
is hidden)
• Runs on separate Search Indexing servers
Wednesday, 12 June 13
Search Producers - workflow
Wednesday, 12 June 13
Search Transformers
• Transforms an ElasticSearch result to something
the UI can use.
• Hides sensitive user data (if necessary)
• Adds thumbnail URLs
• Runs on the application servers
Wednesday, 12 June 13
Wednesday, 12 June 13
Custom search queries
• Exposed as a REST API
• Ex:
• /api/search/general
• /api/search/content-library
• /api/search/<search name>
Wednesday, 12 June 13
Custom search queries
• // GET http://cam.oae.com/api/search/custom-foo?q=bar
var SearchAPI = require('oae-search');
SearchAPI.registerSearch('custom-foo', function(ctx, opts, callback) {
// The query you need to write
// opts.q = “bar”
var query = …
// Access scope the results
var filter = ..
callback(null, SearchUtil.createQuery(query, filter, opts));
});
Wednesday, 12 June 13
Activities
• Follows the activitystrea.ms spec
• Each activity has:
• an object (content item “presentation.ppt”)
• an actor (BrandenVisser)
• a target (Bert Pareyn)
• a verb (to share)
• End up in an activity stream
• Generated by separate activity servers
Wednesday, 12 June 13
Activities
• Activity Seeds
• Activity Producers
• Activity Routers
• Activity Transformers
Wednesday, 12 June 13
Activities and notifications
• Notifications are “special” activities that
were routed to a separate activity stream
• E-mails can be sent out for notifications
• Piggy-backing notifications on activities
gives you free aggregation
Wednesday, 12 June 13
ActivityAPI.registerActivityType(‘content-comment’, {
'groupBy': [{'target': true}],
'notifications': {
'email': true,
'emailTemplateModule': 'oae-content',
'emailTemplateId': 'notify-content-comment'
}
}
);
Wednesday, 12 June 13
Activity seeds
• When something happens an activity seed
is created and sent out to RabbitMQ
• Contains the data for the Activity Servers
to produce the persisted activities and
generate the routes
Wednesday, 12 June 13
ContentAPI.on(‘content-comment', function(ctx, comment) {
// Create the actor, object and target objects for the activity
..
// Construct the activity seed
..
// Submit to RabbitMQ
ActivityAPI.postActivity(ctx, activitySeed);
});
Local events get offloaded to RabbitMQ
Wednesday, 12 June 13
Activity Producers
• Produces the persisted entity that should be
stored for each activity.
• Each entity should hold all the data necessary for
producing routes and transforming into UI friendly
data
• Should try to be compact as activities will be de-
normalized and an entity will be saved per stream
(each user has at least 2 streams, so this is a lot of data)
• Produced on separate activity servers
Wednesday, 12 June 13
Activities
// Persisted activity entity
{
    "oae:activityType": "content-share",                                 // Required
    "published": "2011-02-10T15:04:55Z",                                // Required
    "verb": "share"                                                     // Required
    "actor": { <ProducedEntity> },
    "object": { <ProducedEntity> },
    "target": { <ProducedEntity> }
}
Wednesday, 12 June 13
// Transformed activity entity
{
    "oae:activityType": "content-share",
    "published": "2011-02-10T15:04:55Z",
    "verb": "share"
    "actor": {
        "objectType": "user",
        "id": "http://my.oae.org/api/user/u:oae:mrvisser",
        "displayName": "Branden Visser",
        "url": "http://some.oae.org/~u:oae:mrvisser",
        "image": { .. }
    },
    "object": {
        "objectType": "content",
        "oae:contentType": "file",
        "oae:mimeType": "image/png"
        "id": "http://my.oae.org/content/contentId",
        "url": "http://my.oae.org/content/contentId",
        "displayName": "Super cool image",
        "image": { .. }
    },
    "target": {
        "objectType": "user",
        "id": "http://my.oae.org/user/u:cam:bert",
        "url": "http://my.oae.org/~u:cam:bert",
        "image": { .. }
    }
}
Wednesday, 12 June 13
Activity routes
• Activities can be routed to “activity streams”
• Each user and group has an activity stream, users also have a notification
stream
• Routing is the process of taking an activity and
determining who should receive the activity
• A route is a simple string with the ID of the
principal to which the activity should be delivered
• Routed on separate activity servers
Wednesday, 12 June 13
Activity Routes - Propagation
• Permissions/privacy in activities
• Possible values:
• ANY The produced entity data can be routed to any route. i.e., The entity is public or loggedin
• ROUTES The entity can only be propagated to the activity routes specified by the router
• SPECIFY Specify additional routes the entity should be routed to
• ex: Branden adds Bert to the Private group “OAE-Team”
• Actor: Branden, Object: “OAE-Team”-group, Target: Bert
• The default routing would generate an activity for all the managers of the OAE-Team group, need to
add a route for Bert as well
Wednesday, 12 June 13
ActivityAPI.registerActivityRouter('content-comment', function(...) {
// Generate routes for all the content managers/viewers
...
// Generate routes for all the recent contributes
...
// return the generated routes
});
Wednesday, 12 June 13
Activity Transformers
• Transforms persisted activities into
activitystrea.ms compliant results
• Adds OAE specific data that can be
consumed by the UI.
• ex: More images
Wednesday, 12 June 13
ActivityAPI.registerActivityEntityTransformer('content-comment', function(ctx, entities) {
// Add thumbnail URLs
...
// Add replies to comments
// (This data is available in the entity itself, it just needs to be cleaned up.)
..
// return
});
Wednesday, 12 June 13
File storage
• New file storage backends can be plugged in
• Available storage backends:
• Local disk storage / Mounted NFS
• Amazon S3
• Try not to serve actual file bodies with Hilary
Wednesday, 12 June 13
Preview Processor
• Generates thumbnail and large readable preview
images of content in the system
• Uses the REST API to interact with OAE
• Isolation from the application server
• Informed of new content to process by RabbitMQ
• Allows for multiple processors, prevents
dropped messages
Wednesday, 12 June 13
Preview Processor
• Existing processors for:
• Collabdocs - Uses webshot to take a browser screenshot of the etherpad
• Images - GraphicsMagick used to make various sized thumbnails
• Office Docs and PDFS - Individual page snapshots using LibreOffice and GraphicsMagick,
so the whole document may be viewed in the browser
• Arbitrary links
• Flickr, SlideShare,Vimeo,YouTube: Special Handling for REST APIs to fetch display
name, description and preview images directly
• Other links: Uses webshot to take a screenshot of links for which it doesn’t have a
specific handler
• Creating custom processors
• New processors can be added in new NPM modules
• Uses a registration pattern to hook in to the Preview Processor
• Flexible meta-data to back custom widgets
Wednesday, 12 June 13
Storage interface
• get
• store
• remove
• getDownloadLink
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Wednesday, 12 June 13
Performance testing
• Workflow
• Model loader
• Tsung tests
• Analysis
• Cases
Wednesday, 12 June 13
Workflow
1. Generate data
2. Load data into the system
3. Tsung tests
4. Circonus
5. Analysis
Wednesday, 12 June 13
Workflow
• Establish a baseline by cycling through
testing, analysis and improvement
• Iterate-and-improve
• Try and maintain an acceptable baseline
when adding new features
Wednesday, 12 June 13
OAE model loader
• NodeJS tool that generates and loads data
• Tries to reflect real life scenarios
• ex: 30% of the members of a group
should be managers
Wednesday, 12 June 13
Model loader - Generation
• Generates re-runnable JSON files that define data to
be loaded into the system
• All data is based on predefined distributions and can
be tweaked
• Supports:
• Users
• Groups
• Content
• Links / Collaborative documents / Files
• Discussions
Wednesday, 12 June 13
Model loader - loading
• Loads the data into the system
• Writes the generated IDs to disk so they
can be re-used in the Tsung tests
Wednesday, 12 June 13
Tsung
• Tsung is an Erlang distributed load-testing
tool
• Able to simulate thousands of concurrent
users
• Used to stress test the application
Wednesday, 12 June 13
Tsung
• Takes an XML file that defines the HTTP requests and fires them off at the
server
• Sessions
• Each session has a probability of execution
• Contains:Transactions, dynamic variables
• Transactions
• Contains: Requests,Thinktime
• Requests
Wednesday, 12 June 13
<session name="general_interest_term_anon" probability="17" type="ts_http">
<setdynvars sourcetype="file" fileid="users.csv" delimiter=";" order="random">
<var name="users_id" />
<var name="users_username" />
<var name="users_password" />
</setdynvars>
<transaction name="tx_login">
<request subst="true">
<dyn_variable name="loggedin_user_id" jsonpath="$.id"/>
<http url="/api/auth/login" method="POST" version="1.1" contents="username=%%_users_username%%&amp;password=%%_users_password%%"
>
<http_header name="Referer" value="/" />
</http>
</request>
</transaction>
<thinktime value="4" random="true"/>
<transaction name="tx_general_search_search">
<request subst="true">
<http url="/api/search/general/all?q=%%_search_term_30%%&amp;from=10&amp;size=10" method="GET" version="1.1" ></http>
</request>
</transaction>
...
</session>
Wednesday, 12 June 13
node-oae-tsung
• Tsung’s XML syntax is hard and boring + xml files can get
huge
• => Automate it
• NodeJS tool to generate XML file
• Uses generated ID from the model loader data load
• Contains 3 layers:
• API
• Tests
• Suites
Wednesday, 12 June 13
node-oae-tsung API
• Each method in the Tsung API represents a high-level
user action against your UI
• Performs the REST API requests that would get called
when a user performs that “click” / action / page visit
• Encapsulates those requests into a “transaction”
• ex: Loading the group members page would do a
request to:
• GET /api/me
• GET /api/group/<group>/members
Wednesday, 12 June 13
node-oae-tsung API
// “Show the members of a group”-page
var members = module.exports.members = function(session, group) {
var tx = session.addTransaction('group_members');
tx.addRequest('GET', '/api/me');
tx.addRequest('GET', '/api/group/' + group + '/members');
};
Wednesday, 12 June 13
node-oae-tsung test
case
• Each test case describes a possible user session by executing a
number “transactions” / API methods:
• User logs in
• User searches for groups
• User visits a group
• Thinks a bit
• Searches for users to add
• Adds some users
• Performs a general search
• Visits a content item
• Shares that content item with a group
• Logs out
• End result is a Tsung “session” object that contains many
transactions and “think times”
Wednesday, 12 June 13
module.exports.test = function(runner, probability) {
probability = probability || 100;
// Create a new session.
var session = runner.addSession('add_group_users', probability);
var user = User.login(session, '%%_group_add_users_manager_username%%', '%%_group_add_users_manager_passwo
Group.profile(session, '%%_group_add_users_group_id%%');
session.think(2);
// Go to the members list
Group.members(session, groupId);
session.think(6);
// Add 2 users
var update = {
'%%_group_add_users_user_0%%': 'member',
'%%_group_add_users_user_1%%': 'member'
};
Group.updateMembers(session, groupId, update);
session.think(2);
...
}
Wednesday, 12 June 13
node-oae-tsung suite
• Contains a list of test cases / sessions you want to include in your test suite (i.e.,Tsung XML file)
• Has an optional probability option to control the session distribution
• Standard test suite file:
general_interest_term_anon,15
general_interest_term_auth,50
general_interest_content_auth,5
general_interest_group_auth,7
general_interest_user_auth,10
private_groups_interest,40
study_group_content,40
edit_content,40
edit_group,15
add_content_users,10
add_content_groups,5
add_group_users,10
add_group_groups,5
Wednesday, 12 June 13
Putting it together
• Need to create a new mix of sessions and distributions? Just
create a new suite file.
• Need to create new sessions that do different things? Just
create new test cases that use the API methods.
• Did web requests in your application change on certain pages?
Just update the requests executed in the API methods, all test
cases / suites update with it.
• New feature in your application? Create the API methods for
the new actions, incorporate into test cases.
• Did your UI get completely overhauled? Oops... remodel your
API methods from scratch.
Wednesday, 12 June 13
Tsung
• Take the tsung.xml file and run it
• Depending on the session lengths, can take
a couple of hours
• Generates graphs
Wednesday, 12 June 13
Setup
• 1 nginx load balancer (0.5GB / 1CPU)
• 2 app nodes (0.5GB / 1 CPU)
• 3 db nodes (8GB / 2 CPU)
• 1 redis node (0.5GB / 1 CPU)
• 1 search node (0.5GB / 1 CPU)
Wednesday, 12 June 13
Transactions
Wednesday, 12 June 13
Request latency
Wednesday, 12 June 13
Transactions / sec
Wednesday, 12 June 13
Arrival rate of new users
Wednesday, 12 June 13
Simultaneous users
Wednesday, 12 June 13
HTTP Requests / sec
Wednesday, 12 June 13
Circonus Telemetry
• Circonus is a tool built by OmniTI to
gather, graph and analyze data.
• Allows for push/pull data entry
Wednesday, 12 June 13
Circonus Telemetry
• Latencies
• HTTP Request
• Cassandra queries
• Search queries
• Permission checks
• Activity collection / routing / delivery
• Counts
• Each API Call (ex: POST./api/user/create)
• Cassandra queries (READ - WRITE)
• Error counts
Wednesday, 12 June 13
Circonus Telemetry
• Has multiple graph types (line, bar,
histogram)
• Allows you to overlay multiple data points
Wednesday, 12 June 13
Average latency for POST /api/*
Wednesday, 12 June 13
Histogram latency - POST /api/*
Wednesday, 12 June 13
So, does it scale?
• Yes. We can scale the application
horizontally by adding more nodes
• Doubling the hardware, roughly doubles
the throughput
Wednesday, 12 June 13
Simultaneous users
Wednesday, 12 June 13
Requests / sec
Wednesday, 12 June 13
Case: Permissions
• Identified as a key component that would impact performance
the most
• Permissions are propagated indirectly through group membership
• Steve has access to ContentAVIA GroupC
• Steve has access to GroupAVIA GroupC and GroupB
Wednesday, 12 June 13
Case: Permissions
(cont’d)
Attempt #1:
First do a direct association check against the target. If unsuccessful,“Explode” and store
denormalized group memberships for user when permission check is performed (if
necessary). Group membership changes intelligently try and keep denormalized groups list
up to date to avoid invalidation.
When doing a permission check, fetch the exploded list of groups and a select against the
target’s members with the indirect list of groups.
Assumption #1: Most permission checks would be for direct access to resources, so
exploded check would not happen often
Assumption #2: When needed, fetching exploded group hierarchy would be quite fast:
Fetch one row from Cassandra.
Assumption #3: Selecting matches in the direct target members would be quite fast:
Query finite number of columns from one row would be fast
Result: Baseline test peaked at about 300 requests per second. Scaling up to larger sizes
would explode the resource costs unacceptably, try and do better.
Wednesday, 12 June 13
Case: Permissions
(cont’d)
What went wrong?
For starters, D-Trace analysis shows our app
servers are spending over 90% of their time
serializing / deserializing Thrift bodies from
Cassandra
Wednesday, 12 June 13
Case: Permissions
(cont’d)
How do we fix it?
Maybe we’re querying exploded groups more than we assumed, and there is much
more data in the exploded group memberships than we assumed.
Attempt #2
Query the target resource direct members. If there are no groups, simply compare
the direct members with the source user. If there are groups, explode the groups of
the source user (if not already denormalized), and only query the group ids from the
exploded memberships that are directly assocated to the target resource. If no
results, no access. If there are results, there is access.
Assumption #1: Fetching full “exploded” groups is expensive, avoid it
Assumption #2: Most permission checks are against resources who don’t have
groups assigned as members, and there are generally much fewer groups assigned as
members than groups a user will indirectly be a member of
Result: Same baseline test peaked at 850 requests per second.Thats reasonable!
Wednesday, 12 June 13
Case:Activity
Activity Aggregation is the process of collecting multiple
“similar” activities into a single aggregated activity. In order to
accomplish this, lots of “recent activities” need to be pooled
together, and consulted for each routed activity.
Attempt #1: Store the activity history and activity buckets
in Cassandra
Result: 3 Cassandra nodes, breaks down on a routed
activity throughput of 135 per second during data-load’.
Equivalent to roughly 1.3 activities per second in our tests.
Not acceptable.
Wednesday, 12 June 13
Case:Activity (cont’d)
Problem #1: Cassandra latency reports in DataStax OpsCenter showing Cassandra
nodes are surpassing 5000 requests per second, and latency is climbing to over 10 seconds
and load on the Cassandra servers pushing 7.
Solution #1: Move aggregation into Redis.The data is volatile and gets evicted over time
any way.Avoids cluster co-ordination gossip and disk I/O for a large part of the activity
load.
Problem #2: Initial tests showed the memory footprint easily skyrocketed over 8Gb.
Not Acceptable.
Solution #2: Normalize the aggregated entities in Redis rather than duplicate them for
each activity aggregation entry.
Result: With 3 Cassandra nodes and 3 activity servers, collection happens at ~1500
routed activities per second (translates to 15 activities per second).With 3 Cassandra
nodes and 6 activity servers, collection was occurring at 2500 routed activities per
second, which is as fast as the mass data-load was creating them. Memory footprint in all
tests remains less than 4Gb for the entire duration. Cassandra remains stable in all tests.
Good to go!
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Someone poke the guy sleeping in the back.
Wednesday, 12 June 13
Deployment and
Automation
• As you can imagine, many machines to manage. Current inventory:
• 3x Cassandra
• 2x Redis
• 2x RabbitMQ
• 4x Application + Indexer
• 3x Preview Processor
• 1x Activity Processor
• 1x Nginx
• 3x Etherpad
• Performance testing with a cluster of 21 virtual machines
• Additional scalability testing and verification with ~30 virtual machines
Wednesday, 12 June 13
Puppet
• Use puppet to centralize machine configuration and prevent configuration drift
• Collection of “Manifests” that define the state that the machine should in based on
its hostname / role:
• What files should exist? What should their contents be?
• What packages should be installed?
• What services should be running, or stopped?
• http://github.com/sakaiproject/puppet-hilary
• All 20+ machines in cluster have Puppet installed, which ask for “catalog” info
(expected configuration state) from a single puppet master machine
• Puppet Master knows how to determine the machine state from the manifests
based on its host (e.g., db0 is a cassandra node, it should have cassandra, java, etc...)
• Use puppetdb with “External Resources” to share machine-specific information
with each other node in the cluster
Wednesday, 12 June 13
Hiera
• Serves configuration information for puppet
• JSON-based data-format, which can be inherited in a flexible manner
• Keeps large complex configuration data as clean as possible
{
"classes": [
"::oaeservice::hosts",
"::oaeservice::firewall::open",
"::oaeservice::rsyslog"
],
"nodetype": "%{nodetype}",
"nodesuffix": "%{nodesuffix}",
"web_domain": "oae-performance.oaeproject.org"
Wednesday, 12 June 13
MCollective
• Provides parallel execution over a number of machines at
one time
• Start / Stop / Check status of services
• Install / Remove / Check version of packages
• Use puppet resource syntax to check adhoc machine
facts
• Apply puppet manifests
• Each cluster node subscribes to an ActiveMQ server to
receive commands. Central machine (the “client”) publishes
the command and waits for reply
Wednesday, 12 June 13
Slapchop
• Missing piece:We need to create 21 machines of different specs in a
cloud service, and somehow get MCollective on them
• A tool we lovingly call slapchop
• Define a JSON manifest that holds machines configs and instances
• Run slapchop to create the machines in Joyent cloud, start them, get
mcollective installed
• Well, kind of...
• Now you can log in to the MCollective client and run mco puppet
apply
• Well, kind of...
• Go from empty cloud to working 21 machine cluster in ~15 minutes
Wednesday, 12 June 13
Nagios
• Provides monitoring and alerts
• Cassandra health
• Diskspace
• ElasticSearch JVM stats (memory usage, garbage collection)
• Application server health
• OS memory usage
• Nginx health
• RabbitMQ queue sizes
• RabbitMQ health
• Redis health
• Nagios NRPE scripts deployed with puppet
Wednesday, 12 June 13
Nagios (cont’d)
Wednesday, 12 June 13
Munin
• We are using Munin for time-series OS
resource statistics
• Disk, network, redis, load, memory
• Deployed automatically through puppet
manifests all nodes
Wednesday, 12 June 13
Munin (cont’d)
Wednesday, 12 June 13
Munin (cont’d)
Wednesday, 12 June 13
Security
• Machines deployed in privateVLAN -- private interfaces are isolated
• Public interface firewall completely closed on all nodes
• Single bastion node with public SSH enabled, key-only authentication
• Single Nginx node with public Web ports enabled
• TCP Syn cookies enabled for publically exposed machines to prevent syn-floods
• Rate-limiting to 50req/s per source IP applied for Web API requests
• Several XSS tests and all issues followed up
• Using OWASP JQuery plugin for XSS filtering user-created data
• All infrastructure security deployed automatically with puppet
• Penetration testing performed by University of Mercia
• UI vulnerability testing performed by SCIRT group
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Wednesday, 12 June 13
UI Architecture
Hilary
3akai-ux
Mobile UI
3rd party integrations
Wednesday, 12 June 13
Core UI Architecture
• JS frameworks
• CSS framework
• 3rd party plugins
• OAE UI API
• OAE CSS Components
Wednesday, 12 June 13
Core frameworks
• RequireJS
• jQuery
• underscore.js
Wednesday, 12 June 13
RequireJS
• File and module loader
• Necessity to keep things modular
• Optimisation built-in
Wednesday, 12 June 13
RequireJS
• Define modules
• Load files and modules on fly
Wednesday, 12 June 13
• DOM manipulation
• Cross-browser abstraction
• Events
• Pretty much everything
Wednesday, 12 June 13
• Utility toolbelt
• Manipulate objects, arrays, etc.
Wednesday, 12 June 13
CSS frameworks
• Twitter Bootstrap
• Font Awesome
Wednesday, 12 June 13
Twitter Bootstrap
• Re-usable, consistent CSS is hard
• Most popular CSS framework
• Documentation already there
• Basic components, styles, etc.
• Override where necessary
Wednesday, 12 June 13
Twitter Bootstrap
Wednesday, 12 June 13
Font Awesome
• Icon font
• No more images
• Style with CSS
• Skinning
• Easy
Wednesday, 12 June 13
Font Awesome
Wednesday, 12 June 13
3rd party plug-ins
• jQuery plug-ins
• Bootstrap plug-ins
Wednesday, 12 June 13
3rd party plug-ins
• Autosuggest
• History.js
• Fileupload
• Validate
• Templates
• etc.
Wednesday, 12 June 13
OAE UI API
• Wrapper for REST requests
• Users
• Profile
• Groups
• Content
• Discussions
• Search
• Config
Wednesday, 12 June 13
OAE UI API
• Utilities
• i18n
• l10n
• Widget loading
• Template rendering
• Notifications
• XSS escaping
• etc.
Wednesday, 12 June 13
OAE CSS Components
• Re-usable HTML fragments
• OAE specific elements
• Consistency
• Design guidelines
Wednesday, 12 June 13
Visibility icons
Indicate visibility of groups, content,
discussions, etc.
Wednesday, 12 June 13
Large options
Wednesday, 12 June 13
Thumbnails
Wednesday, 12 June 13
Clips
Wednesday, 12 June 13
Tiles
Wednesday, 12 June 13
List items
Wednesday, 12 June 13
Toolbox
JS frameworks
CSS framework
3rd party plugins
OAE UI API
OAE CSS Components
Wednesday, 12 June 13
Toolbox
JS frameworks
CSS framework
3rd party plugins
OAE UI API
OAE CSS Components
WIDGET SDK
Wednesday, 12 June 13
Putting it together
Wednesday, 12 June 13
Widgets
• Modular components
• HTML Fragment
• JavaScript
• CSS
• Config file
• Loaded into DOM
Wednesday, 12 June 13
Namespacing
• Widgets share same container
• Avoid clashes
• Namespace:
• HTML IDs
• CSS classes
• jQuery selectors
Wednesday, 12 June 13
Widget JS
• Require required APIs
• Return function to be executed as widget
Wednesday, 12 June 13
i18n
• UI available in multiple languages
• Standard .properties files
• 2 types of bundles
• Core bundles
• Widget bundles
Wednesday, 12 June 13
i18n
Translation priority
1. Widget user language file
2. Widget default language file
3. Container user language file
4. Container user language file
Wednesday, 12 June 13
i18n
__MSG__TRANSLATION_KEY__
Wednesday, 12 June 13
i18n
• English
• French
• German
• Italian
• Spanish
• Russian (Partial)
• Chinese (Partial)
Wednesday, 12 June 13
l10n
• API methods for localizing:
• Timezones
• Date Formatting
• Currency
Wednesday, 12 June 13
UI templating
• TrimPath
• Avoids lots of DOM manipulation
• Pass in JSON data
• Supports if statements, for loops, etc.
Wednesday, 12 June 13
UI templating
• Templates are defined in between <!-- -->
• oae.api.util.template().render(...)
Wednesday, 12 June 13
UI templating
• Template
<div id="example_template"><!--
<h4>Welcome {firstName}.</h4>
You are ${profile.age} years old
--></div>
• Input
oae.api.util.template().render($("#example_template"), {
“firstName”: “John”,
“profile”: {
“placeofbirth”: “Los Angeles”,
“age”: 45
}
});
• Result
<h4>Welcome John.</h4>
You are 45 years old.
Wednesday, 12 June 13
UI templating
• Template
<div id="example_template"><!--
{if score >= 5}
<h1>Congratulations, you have succeeded</h1>
{elseif score >= 0}
<h1>Sorry, you have failed}
{else}
<h1>You have cheated</h1>
{/if}
--></div>
• Input
oae.api.util.template().render($("#example_template"), {
“score”: 6
});
• Result
<h1>Congratulations, you have succeeded!</h1>
Wednesday, 12 June 13
UI templating
• Template
<div id="example_template"><!--
{for conference in conferences}
<div>${conference.name} (${conference.year})</div>
{forelse}
<div>No conferences have been organized</div>
{/for}
--></div>
• Input
oae.api.util.template().renderTemplate($("#example_template"), {
“conferences”: [
{“name”: “Sakai San Diego”, “year”: 2013},
{“name”: “Sakai Atlanta”, “year”: 2012}
]
});
• Result
<div>Sakai San Diego (2013)</div>
<div>Sakai Atlanta (2012)</div>
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
Or something else?
Wednesday, 12 June 13
Customization and
configuration
• Administration UI
• Global administration
• Tenant administration
• Manage production environment
Wednesday, 12 June 13
Tenant management
• Start, stop, edit tenants
• Create new tenants
Wednesday, 12 June 13
Tenant management
Wednesday, 12 June 13
Tenant configuration
• Configure global tenant (overridden by tenants) or
individual tenant configurations
• Configure on the fly
• Single Sign On integration
• Default UI language
• Default visibility settings
• Data storage settings
• etc.
Wednesday, 12 June 13
Tenant configuration
Wednesday, 12 June 13
Tenant skinning
• Skinning UI
• Skin entire application
• Branding, colors, etc.
• LESS
• Component re-use
Wednesday, 12 June 13
Tenant skinning
Wednesday, 12 June 13
Tenant skinning
Wednesday, 12 June 13
Tenant skinning
Wednesday, 12 June 13
Extending with NPM
• NPM - Node Package Manager
• Dependency management, including remote fetching custom modules from
the NPM repo or github
• Stored inside of node_modules directory of your project
• Usually a logical set of functionality (e.g., a back-end REST API, or a set of
related widgets)
• NPM module in 3akai-ux is searched for custom widgets
• NPM module in Hilary (that starts with oae-) is searched for init.js to
integrate to the application container
• New dependencies can be added to package.json file
• Changes to this file must be maintained with a patch, though :(
Wednesday, 12 June 13
UI Release Processes
• Grunt
• Task-based build system implemented in JavaScript
• Similar in theory of operation to Make, Rake
• Rich ecosystem of plug-ins to do most tasks
• Easy to implement new task when a plugin doesn’t exist
yet
• Used for running test suites, production builds, linting
tools
Wednesday, 12 June 13
UI Release Processes
• Production Build
• Optimizes the static assets to reduce throughput, request frequency, and optimize
caching across versions
• Require.js Optimization:
• Concatenate JavaScript dependencies (reduces number of web requests significantly)
• Minify / Uglify JavaScript files (reduces payload sizes significantly, even when gzip
enabled on web server)
• Hash optimization:
• Hash the contents of static assets and append result to the filename, then cache
them indefinitely on the browsers
• When the files change, the hash in the filename changes to force reloading of the
updated asset
• If files never change across version, client never reloads file until their cache is
cleared
Wednesday, 12 June 13
Developer Resources:
Widget SDK
• Contains help on creating widgets
• Code best practices
• Design style guide
• UI and API documentation
• Widget Builder
• Examples
Wednesday, 12 June 13
Developer Resources:
Docs UI
• UI that has documentation automatically
generated from the docs in the Hilary and
3akai-ux source code
• Accessible from /docs path of any tenant
Wednesday, 12 June 13
Topics
1. Project Goals
2. Hilary System Architecture
3. Clustering
4. Hilary Design and Extension Patterns
5. Performance Testing
6. Deployment and Automation
7. UI Architecture
8. Customization and Configuration
9. Part 2: Hands on example
You do have Hilary installed, right?
Wednesday, 12 June 13

More Related Content

What's hot

Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...
Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...
Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...Chris Mattmann
 
The hadoop ecosystem table
The hadoop ecosystem tableThe hadoop ecosystem table
The hadoop ecosystem tableMohamed Magdy
 
Introduction to Cassandra Basics
Introduction to Cassandra BasicsIntroduction to Cassandra Basics
Introduction to Cassandra Basicsnickmbailey
 
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...WSO2
 
Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...
Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...
Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...✔ Eric David Benari, PMP
 
Web Crawling with Apache Nutch
Web Crawling with Apache NutchWeb Crawling with Apache Nutch
Web Crawling with Apache Nutchsebastian_nagel
 
Considerations for using NoSQL technology on your next IT project
Considerations for using NoSQL technology on your next IT projectConsiderations for using NoSQL technology on your next IT project
Considerations for using NoSQL technology on your next IT projectAkmal Chaudhri
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQLRTigger
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsMike Broberg
 
Nutch - web-scale search engine toolkit
Nutch - web-scale search engine toolkitNutch - web-scale search engine toolkit
Nutch - web-scale search engine toolkitabial
 
Building a system for machine and event-oriented data - Data Day Seattle 2015
Building a system for machine and event-oriented data - Data Day Seattle 2015Building a system for machine and event-oriented data - Data Day Seattle 2015
Building a system for machine and event-oriented data - Data Day Seattle 2015Eric Sammer
 
Building a system for machine and event-oriented data - Velocity, Santa Clara...
Building a system for machine and event-oriented data - Velocity, Santa Clara...Building a system for machine and event-oriented data - Velocity, Santa Clara...
Building a system for machine and event-oriented data - Velocity, Santa Clara...Eric Sammer
 
Nutch as a Web data mining platform
Nutch as a Web data mining platformNutch as a Web data mining platform
Nutch as a Web data mining platformabial
 
MySQL 5.7 GIS
MySQL 5.7 GISMySQL 5.7 GIS
MySQL 5.7 GISMatt Lord
 
MySQL as a Document Store
MySQL as a Document StoreMySQL as a Document Store
MySQL as a Document StoreTed Wennmark
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSecuring Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSpark Summit
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid C2B2 Consulting
 
from source to solution - building a system for event-oriented data
from source to solution - building a system for event-oriented datafrom source to solution - building a system for event-oriented data
from source to solution - building a system for event-oriented dataEric Sammer
 
NYC HUG - Application Architectures with Apache Hadoop
NYC HUG - Application Architectures with Apache HadoopNYC HUG - Application Architectures with Apache Hadoop
NYC HUG - Application Architectures with Apache Hadoopmarkgrover
 
Introduction to apache nutch
Introduction to apache nutchIntroduction to apache nutch
Introduction to apache nutchSigmoid
 

What's hot (20)

Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...
Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...
Lessons Learned in the Development of a Web-scale Search Engine: Nutch2 and b...
 
The hadoop ecosystem table
The hadoop ecosystem tableThe hadoop ecosystem table
The hadoop ecosystem table
 
Introduction to Cassandra Basics
Introduction to Cassandra BasicsIntroduction to Cassandra Basics
Introduction to Cassandra Basics
 
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
WSO2Con ASIA 2016: WSO2 Analytics Platform: The One Stop Shop for All Your Da...
 
Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...
Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...
Making MySQL Flexible with ParElastic Database Scalability, Amrith Kumar, Fou...
 
Web Crawling with Apache Nutch
Web Crawling with Apache NutchWeb Crawling with Apache Nutch
Web Crawling with Apache Nutch
 
Considerations for using NoSQL technology on your next IT project
Considerations for using NoSQL technology on your next IT projectConsiderations for using NoSQL technology on your next IT project
Considerations for using NoSQL technology on your next IT project
 
Sql vs NoSQL
Sql vs NoSQLSql vs NoSQL
Sql vs NoSQL
 
SQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 QuestionsSQL to NoSQL: Top 6 Questions
SQL to NoSQL: Top 6 Questions
 
Nutch - web-scale search engine toolkit
Nutch - web-scale search engine toolkitNutch - web-scale search engine toolkit
Nutch - web-scale search engine toolkit
 
Building a system for machine and event-oriented data - Data Day Seattle 2015
Building a system for machine and event-oriented data - Data Day Seattle 2015Building a system for machine and event-oriented data - Data Day Seattle 2015
Building a system for machine and event-oriented data - Data Day Seattle 2015
 
Building a system for machine and event-oriented data - Velocity, Santa Clara...
Building a system for machine and event-oriented data - Velocity, Santa Clara...Building a system for machine and event-oriented data - Velocity, Santa Clara...
Building a system for machine and event-oriented data - Velocity, Santa Clara...
 
Nutch as a Web data mining platform
Nutch as a Web data mining platformNutch as a Web data mining platform
Nutch as a Web data mining platform
 
MySQL 5.7 GIS
MySQL 5.7 GISMySQL 5.7 GIS
MySQL 5.7 GIS
 
MySQL as a Document Store
MySQL as a Document StoreMySQL as a Document Store
MySQL as a Document Store
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo VanzinSecuring Spark Applications by Kostas Sakellis and Marcelo Vanzin
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
 
Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid Advanced queries on the Infinispan Data Grid
Advanced queries on the Infinispan Data Grid
 
from source to solution - building a system for event-oriented data
from source to solution - building a system for event-oriented datafrom source to solution - building a system for event-oriented data
from source to solution - building a system for event-oriented data
 
NYC HUG - Application Architectures with Apache Hadoop
NYC HUG - Application Architectures with Apache HadoopNYC HUG - Application Architectures with Apache Hadoop
NYC HUG - Application Architectures with Apache Hadoop
 
Introduction to apache nutch
Introduction to apache nutchIntroduction to apache nutch
Introduction to apache nutch
 

Similar to Apereo OAE - Bootcamp

Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...
Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...
Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...Cloudian
 
Introduction to Hadoop and MapReduce
Introduction to Hadoop and MapReduceIntroduction to Hadoop and MapReduce
Introduction to Hadoop and MapReduceeakasit_dpu
 
Java scalability considerations yogesh deshpande
Java scalability considerations   yogesh deshpandeJava scalability considerations   yogesh deshpande
Java scalability considerations yogesh deshpandeIndicThreads
 
AWS Big Data in everyday use at Yle
AWS Big Data in everyday use at YleAWS Big Data in everyday use at Yle
AWS Big Data in everyday use at YleRolf Koski
 
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...Shubham Tagra
 
Presentation of Apache Cassandra
Presentation of Apache Cassandra Presentation of Apache Cassandra
Presentation of Apache Cassandra Nikiforos Botis
 
Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart...
 Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart... Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart...
Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart...Ashish Tadose
 
Hadoop/MapReduce/HDFS
Hadoop/MapReduce/HDFSHadoop/MapReduce/HDFS
Hadoop/MapReduce/HDFSpraveen bhat
 
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...Alluxio, Inc.
 
Big data and cloud computing 9 sep-2017
Big data and cloud computing 9 sep-2017Big data and cloud computing 9 sep-2017
Big data and cloud computing 9 sep-2017Dr. Anita Goel
 
Designing and developing your database for application availability
Designing and developing your database for application availabilityDesigning and developing your database for application availability
Designing and developing your database for application availabilityCharley Hanania
 
Introduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Introduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventIntroduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Introduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventHyunsik Choi
 
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventApache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventGruter
 
Hadoop: The Default Machine Learning Platform ?
Hadoop: The Default Machine Learning Platform ?Hadoop: The Default Machine Learning Platform ?
Hadoop: The Default Machine Learning Platform ?Milind Bhandarkar
 
Sa introduction to big data pipelining with cassandra &amp; spark west mins...
Sa introduction to big data pipelining with cassandra &amp; spark   west mins...Sa introduction to big data pipelining with cassandra &amp; spark   west mins...
Sa introduction to big data pipelining with cassandra &amp; spark west mins...Simon Ambridge
 
Infinitely Scalable Clusters - Grid Computing on Public Cloud - London
Infinitely Scalable Clusters - Grid Computing on Public Cloud - LondonInfinitely Scalable Clusters - Grid Computing on Public Cloud - London
Infinitely Scalable Clusters - Grid Computing on Public Cloud - LondonHentsū
 
Duraspace Hot Topics Series 6: Metadata and Repository Services
Duraspace Hot Topics Series 6: Metadata and Repository ServicesDuraspace Hot Topics Series 6: Metadata and Repository Services
Duraspace Hot Topics Series 6: Metadata and Repository ServicesMatthew Critchlow
 
Big data processing using hadoop poster presentation
Big data processing using hadoop poster presentationBig data processing using hadoop poster presentation
Big data processing using hadoop poster presentationAmrut Patil
 
Cloudera Search Webinar: Big Data Search, Bigger Insights
Cloudera Search Webinar: Big Data Search, Bigger InsightsCloudera Search Webinar: Big Data Search, Bigger Insights
Cloudera Search Webinar: Big Data Search, Bigger InsightsCloudera, Inc.
 

Similar to Apereo OAE - Bootcamp (20)

Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...
Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...
Case Study: Implementing Hadoop and Elastic Map Reduce on Scale-out Object S...
 
Introduction to Hadoop and MapReduce
Introduction to Hadoop and MapReduceIntroduction to Hadoop and MapReduce
Introduction to Hadoop and MapReduce
 
Java scalability considerations yogesh deshpande
Java scalability considerations   yogesh deshpandeJava scalability considerations   yogesh deshpande
Java scalability considerations yogesh deshpande
 
AWS Big Data in everyday use at Yle
AWS Big Data in everyday use at YleAWS Big Data in everyday use at Yle
AWS Big Data in everyday use at Yle
 
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
 
Presentation of Apache Cassandra
Presentation of Apache Cassandra Presentation of Apache Cassandra
Presentation of Apache Cassandra
 
Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart...
 Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart... Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart...
Distributed Query Service Powered By Presto & Alluxio Across Clouds @Walmart...
 
Hadoop/MapReduce/HDFS
Hadoop/MapReduce/HDFSHadoop/MapReduce/HDFS
Hadoop/MapReduce/HDFS
 
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
Enterprise Distributed Query Service powered by Presto & Alluxio across cloud...
 
Big data and cloud computing 9 sep-2017
Big data and cloud computing 9 sep-2017Big data and cloud computing 9 sep-2017
Big data and cloud computing 9 sep-2017
 
Designing and developing your database for application availability
Designing and developing your database for application availabilityDesigning and developing your database for application availability
Designing and developing your database for application availability
 
Introduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Introduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventIntroduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Introduction to Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
 
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special EventApache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
Apache Tajo - Bay Area HUG Nov. 2013 LinkedIn Special Event
 
Hadoop: The Default Machine Learning Platform ?
Hadoop: The Default Machine Learning Platform ?Hadoop: The Default Machine Learning Platform ?
Hadoop: The Default Machine Learning Platform ?
 
Sa introduction to big data pipelining with cassandra &amp; spark west mins...
Sa introduction to big data pipelining with cassandra &amp; spark   west mins...Sa introduction to big data pipelining with cassandra &amp; spark   west mins...
Sa introduction to big data pipelining with cassandra &amp; spark west mins...
 
Infinitely Scalable Clusters - Grid Computing on Public Cloud - London
Infinitely Scalable Clusters - Grid Computing on Public Cloud - LondonInfinitely Scalable Clusters - Grid Computing on Public Cloud - London
Infinitely Scalable Clusters - Grid Computing on Public Cloud - London
 
CC -Unit4.pptx
CC -Unit4.pptxCC -Unit4.pptx
CC -Unit4.pptx
 
Duraspace Hot Topics Series 6: Metadata and Repository Services
Duraspace Hot Topics Series 6: Metadata and Repository ServicesDuraspace Hot Topics Series 6: Metadata and Repository Services
Duraspace Hot Topics Series 6: Metadata and Repository Services
 
Big data processing using hadoop poster presentation
Big data processing using hadoop poster presentationBig data processing using hadoop poster presentation
Big data processing using hadoop poster presentation
 
Cloudera Search Webinar: Big Data Search, Bigger Insights
Cloudera Search Webinar: Big Data Search, Bigger InsightsCloudera Search Webinar: Big Data Search, Bigger Insights
Cloudera Search Webinar: Big Data Search, Bigger Insights
 

More from Nicolaas Matthijs

Apereo OAE - State of the project - Open Apereo 2015
Apereo OAE - State of the project - Open Apereo 2015Apereo OAE - State of the project - Open Apereo 2015
Apereo OAE - State of the project - Open Apereo 2015Nicolaas Matthijs
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overviewNicolaas Matthijs
 
Apereo OAE - State of the project
Apereo OAE - State of the projectApereo OAE - State of the project
Apereo OAE - State of the projectNicolaas Matthijs
 
Apereo Mexico 2014 - Apereo OAE - State of the project
Apereo Mexico 2014 - Apereo OAE - State of the projectApereo Mexico 2014 - Apereo OAE - State of the project
Apereo Mexico 2014 - Apereo OAE - State of the projectNicolaas Matthijs
 
WSDM 2011 - Nicolaas Matthijs and Filip Radlinski
WSDM 2011 - Nicolaas Matthijs and Filip RadlinskiWSDM 2011 - Nicolaas Matthijs and Filip Radlinski
WSDM 2011 - Nicolaas Matthijs and Filip RadlinskiNicolaas Matthijs
 

More from Nicolaas Matthijs (9)

Apereo OAE - State of the project - Open Apereo 2015
Apereo OAE - State of the project - Open Apereo 2015Apereo OAE - State of the project - Open Apereo 2015
Apereo OAE - State of the project - Open Apereo 2015
 
Apereo OAE - Architectural overview
Apereo OAE - Architectural overviewApereo OAE - Architectural overview
Apereo OAE - Architectural overview
 
Apereo OAE - State of the project
Apereo OAE - State of the projectApereo OAE - State of the project
Apereo OAE - State of the project
 
Apereo OAE - Bootcamp
Apereo OAE - BootcampApereo OAE - Bootcamp
Apereo OAE - Bootcamp
 
Apereo Mexico 2014 - Apereo OAE - State of the project
Apereo Mexico 2014 - Apereo OAE - State of the projectApereo Mexico 2014 - Apereo OAE - State of the project
Apereo Mexico 2014 - Apereo OAE - State of the project
 
Apereo Europe - Apereo OAE
Apereo Europe - Apereo OAEApereo Europe - Apereo OAE
Apereo Europe - Apereo OAE
 
ESUP Days - Apereo OAE
ESUP Days - Apereo OAEESUP Days - Apereo OAE
ESUP Days - Apereo OAE
 
WSDM 2011 - Nicolaas Matthijs and Filip Radlinski
WSDM 2011 - Nicolaas Matthijs and Filip RadlinskiWSDM 2011 - Nicolaas Matthijs and Filip Radlinski
WSDM 2011 - Nicolaas Matthijs and Filip Radlinski
 
Sakai 3 R&D
Sakai 3 R&DSakai 3 R&D
Sakai 3 R&D
 

Recently uploaded

Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxheathfieldcps1
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptxmary850239
 
How to Send Emails From Odoo 17 Using Code
How to Send Emails From Odoo 17 Using CodeHow to Send Emails From Odoo 17 Using Code
How to Send Emails From Odoo 17 Using CodeCeline George
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 
Work Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sashaWork Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sashasashalaycock03
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
Optical Fibre and It's Applications.pptx
Optical Fibre and It's Applications.pptxOptical Fibre and It's Applications.pptx
Optical Fibre and It's Applications.pptxPurva Nikam
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
Over the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptxOver the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptxraviapr7
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?TechSoup
 
A gentle introduction to Artificial Intelligence
A gentle introduction to Artificial IntelligenceA gentle introduction to Artificial Intelligence
A gentle introduction to Artificial IntelligenceApostolos Syropoulos
 

Recently uploaded (20)

Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
The basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptxThe basics of sentences session 10pptx.pptx
The basics of sentences session 10pptx.pptx
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
March 2024 Directors Meeting, Division of Student Affairs and Academic Support
March 2024 Directors Meeting, Division of Student Affairs and Academic SupportMarch 2024 Directors Meeting, Division of Student Affairs and Academic Support
March 2024 Directors Meeting, Division of Student Affairs and Academic Support
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
3.21.24 The Origins of Black Power.pptx
3.21.24  The Origins of Black Power.pptx3.21.24  The Origins of Black Power.pptx
3.21.24 The Origins of Black Power.pptx
 
How to Send Emails From Odoo 17 Using Code
How to Send Emails From Odoo 17 Using CodeHow to Send Emails From Odoo 17 Using Code
How to Send Emails From Odoo 17 Using Code
 
5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 
Work Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sashaWork Experience for psp3 portfolio sasha
Work Experience for psp3 portfolio sasha
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
Optical Fibre and It's Applications.pptx
Optical Fibre and It's Applications.pptxOptical Fibre and It's Applications.pptx
Optical Fibre and It's Applications.pptx
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
Finals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quizFinals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quiz
 
Over the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptxOver the counter (OTC)- Sale, rational use.pptx
Over the counter (OTC)- Sale, rational use.pptx
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
 
A gentle introduction to Artificial Intelligence
A gentle introduction to Artificial IntelligenceA gentle introduction to Artificial Intelligence
A gentle introduction to Artificial Intelligence
 

Apereo OAE - Bootcamp

  • 1. Apereo OAE Bootcamp, San Diego 2013 Wednesday, 12 June 13
  • 2. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Or something else? Wednesday, 12 June 13
  • 5. Project goals • Multi-tenant platform • Cloud-ready • SaaS • Used at large scale Wednesday, 12 June 13
  • 6. Project goals • Maintainable • Extendable • Integrate-able Wednesday, 12 June 13
  • 7. Solid foundation Modern, not exotic Wednesday, 12 June 13
  • 8. July 1, 2013 1st production release Wednesday, 12 June 13
  • 13. Multi-tenancy • Market is heading • Support multiple institutions at same time • Multi-tenancy+ • Easily created, maintained and configured Wednesday, 12 June 13
  • 14. Performance! • Ability to scale horizontally • Evidence based • Continuous Wednesday, 12 June 13
  • 15. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Wednesday, 12 June 13
  • 16. OAE Architecture The Apereo OAE project is made up of 2 distinct source code platforms: • “Hilary” • Server-side RESTful web platform that exposes the OAE services • Written entirely using server-side JavaScript in Node.js • “3akai-ux” • A client-side / browser platform that provides the HTML, JavaScript and CSS that make up the browser UI of the application Wednesday, 12 June 13
  • 19. Application Servers • Written in server-side JavaScript, run in Node.js • Node.js used by: eBay, LinkedIn, Storify, Trello • Light-weight single-threaded event-driven platform that process IO asynchronously / non-blocking • Uses callbacks and an event queue to stash work to be done after IO or other heavy processes complete • App servers can be configured into functional specialization: • User Request Processor • Activity Processor • Search Indexer • Preview Processor Wednesday, 12 June 13
  • 20. Apache Cassandra • Authoritative data source • Provides high-availability and fault-tolerance without trading away performance • Regarding CAP theorem, Cassandra favours Availability and Partition Tolerance over Consistency, however consistency is tunable on the query-level (we almost always use “quorum”) • Uses a ring topology to shard data across nodes, with configurable replication levels • No RDBMS? • Cassandra gives more flexibility with incremental scalability in a cloud environment • Flexible scaling helps to overcome unpredictable growth of multi-tenant systems • Medium-to-long term options for replicating data to multiple data-centers for localizing both reads and writes • Used by: Netflix, eBay,Twitter Wednesday, 12 June 13
  • 21. ElasticSearch • Lucene-backed search platform • Built for masterless incremental scaling and high- availability • Powers Hilary search, including library, related content, group members and memberships • Exposes HTTP RESTful APIs for indexing and querying documents • RESTful query interface uses JSON-based Query DSL • Used by: GitHub, FourSquare, StackOverflow,WordPress Wednesday, 12 June 13
  • 22. RabbitMQ • Message queue platform written in Erlang • Used for distributing tasks to specialized application server instances • Supports active-active queue mirroring for high availability • Used by: Joyent Wednesday, 12 June 13
  • 23. Redis • Fills a variety of functionality: • Broadcast messaging (can move to RabbitMQ) • Locking • Caching of basic user profiles • Holds volatile activity aggregation data • Comes with no managed clustering solution (yet), but has slave replication for active fail-over • Some clients manage master-slave switching, and distributed reads for you • Used by:Twitter, Instagram, StackOverflow, Flickr Wednesday, 12 June 13
  • 24. Etherpad • Open Source collaborative editing application written in Node.js • Originally developed by Google and Mozilla • Licensed under Apache License v2 • Powers collaborative document editing in OAE Wednesday, 12 June 13
  • 25. Nginx • HTTP and reverse-proxy server • Used to distribute load to application servers, etherpad servers and stream file downloads • Useful rate-limiting features based on source IP • Used by: Netflix,WordPress.com Wednesday, 12 June 13
  • 26. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Wednesday, 12 June 13
  • 27. Clustering Cassandra • Cassandra uses a partitioned ring topology to distribute data • Nodes are given a numeric token which determines their “location” in the ring • When data rows are read / written to Cassandra, the row key is hashed using a “Partitioner”, which determines what node holds the row’s data • “Replication Strategy” is used to determine which nodes will hold replicas of which rows • E.g.“Simple Strategy” will use the N - 1 nodes clockwise around the ring from the primary node Wednesday, 12 June 13
  • 29. Clustering Cassandra (cont’d) • Query consistency specified at request time • ALL - All nodes must respond successfully • LOCAL_QUORUM - (RF/2 + 1) nodes (in the datacenter) must respond successfully • EACH_QUORUM - (RF/2 + 1) nodes (in all datacenters) must respond successfully • ONE - Only one node must respond successfully • Therefore, if you write with QUORUM then read with QUORUM, then results should always be consistent Wednesday, 12 June 13
  • 30. Clustering ElasticSearch • ElasticSearch shards data into a configurable number of shards • “Number of Replicas” can be configured at runtime, which determines how many replicas of each shard should exist • Shard replicas are distributed among the nodes in the cluster • Shard is identified by hash of the document id Wednesday, 12 June 13
  • 32. Clustering Etherpad • Short and sweet: It doesn’t really cluster • Data is stored in Cassandra, but active sessions must all share the same etherpad server • Configure number of etherpad servers and their hosts in Hilary, and configure Nginx to proxy to the appropriate server • Server is selected based on a numeric hash of the content item id • No high availability. If an etherpad server goes down, those sessions are disconnected :( But etherpad content is retained Wednesday, 12 June 13
  • 34. Clustering RabbitMQ • Uses a Master-Slave Active/Active queue mirroring policy for redundancy • We set a policy of ha-mode=all to all OAE queues • Ensures messages are replicated to all queues • Ensures all subscribed consumers receive messages • Since all nodes are active peers, when a node fails, consumer simply reconnects Wednesday, 12 June 13
  • 35. Clustering Search Indexers • Search Indexers are regular application nodes configured to consume search index tasks • INDEX_UPDATE, INDEX_DELETE • Offloads fetching and processing of indexing tasks to nodes that don’t impact request latency Wednesday, 12 June 13
  • 36. Clustering Activity Processors • Regular application nodes that • Receive and route activity tasks • Collect and aggregate routed activities • May be configured with dedicated Redis server for aggregation • Aggregation is the process of deeming 2 or more activities “similar” and grouping them into a single activity • Maintains temporary information in Redis to keep track of what activities have occurred recently and aggregate them on-the-fly • Due to concurrency issues when aggregating new activities into feeds, routed activities are sharded into “concurrency buckets” • Avoids duplicate activities in streams, while not completely serializing the aggregation process • Bucket is selected based on a hash of • Activity Stream ID (e.g., user or group id) • Activity Type (e.g., share content, add to group, etc...) Wednesday, 12 June 13
  • 37. Clustering Activity Processors (cont’d) • Activity0 and Activity1 were serialized into bucket 0 to avoid concurrency collisions in “user A”s stream • A bucket is only collected by one activity processor at a time • An activity processor can concurrently collect multiple buckets (max concurrent buckets is configurable) • Number of buckets is configurable (is 3 in this example) Wednesday, 12 June 13
  • 38. Clustering Preview Processor • Regular application node that is specialized to handle preview processing tasks • GENERATE_PREVIEWS • Offloads the CPU and memory-intensive process of generating previews to machines that don’t impact user request latency Wednesday, 12 June 13
  • 39. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Still with us? Wednesday, 12 June 13
  • 40. Hilary design and extension points • Common patterns • Search • Activities • File storage • Preview Processor Wednesday, 12 June 13
  • 41. Search producers / transformers • Search producers • Generates documents that need to go in the index • Search transformers • Transforms query results coming back from ES into something the UI can use Wednesday, 12 June 13
  • 42. Search Producers • Produces documents that can be indexed/stored by ElasticSearch • Simple JSON document • A search document contains the full profile. (ie no data is hidden) • Runs on separate Search Indexing servers Wednesday, 12 June 13
  • 43. Search Producers - workflow Wednesday, 12 June 13
  • 44. Search Transformers • Transforms an ElasticSearch result to something the UI can use. • Hides sensitive user data (if necessary) • Adds thumbnail URLs • Runs on the application servers Wednesday, 12 June 13
  • 46. Custom search queries • Exposed as a REST API • Ex: • /api/search/general • /api/search/content-library • /api/search/<search name> Wednesday, 12 June 13
  • 47. Custom search queries • // GET http://cam.oae.com/api/search/custom-foo?q=bar var SearchAPI = require('oae-search'); SearchAPI.registerSearch('custom-foo', function(ctx, opts, callback) { // The query you need to write // opts.q = “bar” var query = … // Access scope the results var filter = .. callback(null, SearchUtil.createQuery(query, filter, opts)); }); Wednesday, 12 June 13
  • 48. Activities • Follows the activitystrea.ms spec • Each activity has: • an object (content item “presentation.ppt”) • an actor (BrandenVisser) • a target (Bert Pareyn) • a verb (to share) • End up in an activity stream • Generated by separate activity servers Wednesday, 12 June 13
  • 49. Activities • Activity Seeds • Activity Producers • Activity Routers • Activity Transformers Wednesday, 12 June 13
  • 50. Activities and notifications • Notifications are “special” activities that were routed to a separate activity stream • E-mails can be sent out for notifications • Piggy-backing notifications on activities gives you free aggregation Wednesday, 12 June 13
  • 51. ActivityAPI.registerActivityType(‘content-comment’, { 'groupBy': [{'target': true}], 'notifications': { 'email': true, 'emailTemplateModule': 'oae-content', 'emailTemplateId': 'notify-content-comment' } } ); Wednesday, 12 June 13
  • 52. Activity seeds • When something happens an activity seed is created and sent out to RabbitMQ • Contains the data for the Activity Servers to produce the persisted activities and generate the routes Wednesday, 12 June 13
  • 53. ContentAPI.on(‘content-comment', function(ctx, comment) { // Create the actor, object and target objects for the activity .. // Construct the activity seed .. // Submit to RabbitMQ ActivityAPI.postActivity(ctx, activitySeed); }); Local events get offloaded to RabbitMQ Wednesday, 12 June 13
  • 54. Activity Producers • Produces the persisted entity that should be stored for each activity. • Each entity should hold all the data necessary for producing routes and transforming into UI friendly data • Should try to be compact as activities will be de- normalized and an entity will be saved per stream (each user has at least 2 streams, so this is a lot of data) • Produced on separate activity servers Wednesday, 12 June 13
  • 55. Activities // Persisted activity entity {     "oae:activityType": "content-share",                                 // Required     "published": "2011-02-10T15:04:55Z",                                // Required     "verb": "share"                                                     // Required     "actor": { <ProducedEntity> },     "object": { <ProducedEntity> },     "target": { <ProducedEntity> } } Wednesday, 12 June 13
  • 56. // Transformed activity entity {     "oae:activityType": "content-share",     "published": "2011-02-10T15:04:55Z",     "verb": "share"     "actor": {         "objectType": "user",         "id": "http://my.oae.org/api/user/u:oae:mrvisser",         "displayName": "Branden Visser",         "url": "http://some.oae.org/~u:oae:mrvisser",         "image": { .. }     },     "object": {         "objectType": "content",         "oae:contentType": "file",         "oae:mimeType": "image/png"         "id": "http://my.oae.org/content/contentId",         "url": "http://my.oae.org/content/contentId",         "displayName": "Super cool image",         "image": { .. }     },     "target": {         "objectType": "user",         "id": "http://my.oae.org/user/u:cam:bert",         "url": "http://my.oae.org/~u:cam:bert",         "image": { .. }     } } Wednesday, 12 June 13
  • 57. Activity routes • Activities can be routed to “activity streams” • Each user and group has an activity stream, users also have a notification stream • Routing is the process of taking an activity and determining who should receive the activity • A route is a simple string with the ID of the principal to which the activity should be delivered • Routed on separate activity servers Wednesday, 12 June 13
  • 58. Activity Routes - Propagation • Permissions/privacy in activities • Possible values: • ANY The produced entity data can be routed to any route. i.e., The entity is public or loggedin • ROUTES The entity can only be propagated to the activity routes specified by the router • SPECIFY Specify additional routes the entity should be routed to • ex: Branden adds Bert to the Private group “OAE-Team” • Actor: Branden, Object: “OAE-Team”-group, Target: Bert • The default routing would generate an activity for all the managers of the OAE-Team group, need to add a route for Bert as well Wednesday, 12 June 13
  • 59. ActivityAPI.registerActivityRouter('content-comment', function(...) { // Generate routes for all the content managers/viewers ... // Generate routes for all the recent contributes ... // return the generated routes }); Wednesday, 12 June 13
  • 60. Activity Transformers • Transforms persisted activities into activitystrea.ms compliant results • Adds OAE specific data that can be consumed by the UI. • ex: More images Wednesday, 12 June 13
  • 61. ActivityAPI.registerActivityEntityTransformer('content-comment', function(ctx, entities) { // Add thumbnail URLs ... // Add replies to comments // (This data is available in the entity itself, it just needs to be cleaned up.) .. // return }); Wednesday, 12 June 13
  • 62. File storage • New file storage backends can be plugged in • Available storage backends: • Local disk storage / Mounted NFS • Amazon S3 • Try not to serve actual file bodies with Hilary Wednesday, 12 June 13
  • 63. Preview Processor • Generates thumbnail and large readable preview images of content in the system • Uses the REST API to interact with OAE • Isolation from the application server • Informed of new content to process by RabbitMQ • Allows for multiple processors, prevents dropped messages Wednesday, 12 June 13
  • 64. Preview Processor • Existing processors for: • Collabdocs - Uses webshot to take a browser screenshot of the etherpad • Images - GraphicsMagick used to make various sized thumbnails • Office Docs and PDFS - Individual page snapshots using LibreOffice and GraphicsMagick, so the whole document may be viewed in the browser • Arbitrary links • Flickr, SlideShare,Vimeo,YouTube: Special Handling for REST APIs to fetch display name, description and preview images directly • Other links: Uses webshot to take a screenshot of links for which it doesn’t have a specific handler • Creating custom processors • New processors can be added in new NPM modules • Uses a registration pattern to hook in to the Preview Processor • Flexible meta-data to back custom widgets Wednesday, 12 June 13
  • 65. Storage interface • get • store • remove • getDownloadLink Wednesday, 12 June 13
  • 66. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Wednesday, 12 June 13
  • 67. Performance testing • Workflow • Model loader • Tsung tests • Analysis • Cases Wednesday, 12 June 13
  • 68. Workflow 1. Generate data 2. Load data into the system 3. Tsung tests 4. Circonus 5. Analysis Wednesday, 12 June 13
  • 69. Workflow • Establish a baseline by cycling through testing, analysis and improvement • Iterate-and-improve • Try and maintain an acceptable baseline when adding new features Wednesday, 12 June 13
  • 70. OAE model loader • NodeJS tool that generates and loads data • Tries to reflect real life scenarios • ex: 30% of the members of a group should be managers Wednesday, 12 June 13
  • 71. Model loader - Generation • Generates re-runnable JSON files that define data to be loaded into the system • All data is based on predefined distributions and can be tweaked • Supports: • Users • Groups • Content • Links / Collaborative documents / Files • Discussions Wednesday, 12 June 13
  • 72. Model loader - loading • Loads the data into the system • Writes the generated IDs to disk so they can be re-used in the Tsung tests Wednesday, 12 June 13
  • 73. Tsung • Tsung is an Erlang distributed load-testing tool • Able to simulate thousands of concurrent users • Used to stress test the application Wednesday, 12 June 13
  • 74. Tsung • Takes an XML file that defines the HTTP requests and fires them off at the server • Sessions • Each session has a probability of execution • Contains:Transactions, dynamic variables • Transactions • Contains: Requests,Thinktime • Requests Wednesday, 12 June 13
  • 75. <session name="general_interest_term_anon" probability="17" type="ts_http"> <setdynvars sourcetype="file" fileid="users.csv" delimiter=";" order="random"> <var name="users_id" /> <var name="users_username" /> <var name="users_password" /> </setdynvars> <transaction name="tx_login"> <request subst="true"> <dyn_variable name="loggedin_user_id" jsonpath="$.id"/> <http url="/api/auth/login" method="POST" version="1.1" contents="username=%%_users_username%%&amp;password=%%_users_password%%" > <http_header name="Referer" value="/" /> </http> </request> </transaction> <thinktime value="4" random="true"/> <transaction name="tx_general_search_search"> <request subst="true"> <http url="/api/search/general/all?q=%%_search_term_30%%&amp;from=10&amp;size=10" method="GET" version="1.1" ></http> </request> </transaction> ... </session> Wednesday, 12 June 13
  • 76. node-oae-tsung • Tsung’s XML syntax is hard and boring + xml files can get huge • => Automate it • NodeJS tool to generate XML file • Uses generated ID from the model loader data load • Contains 3 layers: • API • Tests • Suites Wednesday, 12 June 13
  • 77. node-oae-tsung API • Each method in the Tsung API represents a high-level user action against your UI • Performs the REST API requests that would get called when a user performs that “click” / action / page visit • Encapsulates those requests into a “transaction” • ex: Loading the group members page would do a request to: • GET /api/me • GET /api/group/<group>/members Wednesday, 12 June 13
  • 78. node-oae-tsung API // “Show the members of a group”-page var members = module.exports.members = function(session, group) { var tx = session.addTransaction('group_members'); tx.addRequest('GET', '/api/me'); tx.addRequest('GET', '/api/group/' + group + '/members'); }; Wednesday, 12 June 13
  • 79. node-oae-tsung test case • Each test case describes a possible user session by executing a number “transactions” / API methods: • User logs in • User searches for groups • User visits a group • Thinks a bit • Searches for users to add • Adds some users • Performs a general search • Visits a content item • Shares that content item with a group • Logs out • End result is a Tsung “session” object that contains many transactions and “think times” Wednesday, 12 June 13
  • 80. module.exports.test = function(runner, probability) { probability = probability || 100; // Create a new session. var session = runner.addSession('add_group_users', probability); var user = User.login(session, '%%_group_add_users_manager_username%%', '%%_group_add_users_manager_passwo Group.profile(session, '%%_group_add_users_group_id%%'); session.think(2); // Go to the members list Group.members(session, groupId); session.think(6); // Add 2 users var update = { '%%_group_add_users_user_0%%': 'member', '%%_group_add_users_user_1%%': 'member' }; Group.updateMembers(session, groupId, update); session.think(2); ... } Wednesday, 12 June 13
  • 81. node-oae-tsung suite • Contains a list of test cases / sessions you want to include in your test suite (i.e.,Tsung XML file) • Has an optional probability option to control the session distribution • Standard test suite file: general_interest_term_anon,15 general_interest_term_auth,50 general_interest_content_auth,5 general_interest_group_auth,7 general_interest_user_auth,10 private_groups_interest,40 study_group_content,40 edit_content,40 edit_group,15 add_content_users,10 add_content_groups,5 add_group_users,10 add_group_groups,5 Wednesday, 12 June 13
  • 82. Putting it together • Need to create a new mix of sessions and distributions? Just create a new suite file. • Need to create new sessions that do different things? Just create new test cases that use the API methods. • Did web requests in your application change on certain pages? Just update the requests executed in the API methods, all test cases / suites update with it. • New feature in your application? Create the API methods for the new actions, incorporate into test cases. • Did your UI get completely overhauled? Oops... remodel your API methods from scratch. Wednesday, 12 June 13
  • 83. Tsung • Take the tsung.xml file and run it • Depending on the session lengths, can take a couple of hours • Generates graphs Wednesday, 12 June 13
  • 84. Setup • 1 nginx load balancer (0.5GB / 1CPU) • 2 app nodes (0.5GB / 1 CPU) • 3 db nodes (8GB / 2 CPU) • 1 redis node (0.5GB / 1 CPU) • 1 search node (0.5GB / 1 CPU) Wednesday, 12 June 13
  • 88. Arrival rate of new users Wednesday, 12 June 13
  • 90. HTTP Requests / sec Wednesday, 12 June 13
  • 91. Circonus Telemetry • Circonus is a tool built by OmniTI to gather, graph and analyze data. • Allows for push/pull data entry Wednesday, 12 June 13
  • 92. Circonus Telemetry • Latencies • HTTP Request • Cassandra queries • Search queries • Permission checks • Activity collection / routing / delivery • Counts • Each API Call (ex: POST./api/user/create) • Cassandra queries (READ - WRITE) • Error counts Wednesday, 12 June 13
  • 93. Circonus Telemetry • Has multiple graph types (line, bar, histogram) • Allows you to overlay multiple data points Wednesday, 12 June 13
  • 94. Average latency for POST /api/* Wednesday, 12 June 13
  • 95. Histogram latency - POST /api/* Wednesday, 12 June 13
  • 96. So, does it scale? • Yes. We can scale the application horizontally by adding more nodes • Doubling the hardware, roughly doubles the throughput Wednesday, 12 June 13
  • 99. Case: Permissions • Identified as a key component that would impact performance the most • Permissions are propagated indirectly through group membership • Steve has access to ContentAVIA GroupC • Steve has access to GroupAVIA GroupC and GroupB Wednesday, 12 June 13
  • 100. Case: Permissions (cont’d) Attempt #1: First do a direct association check against the target. If unsuccessful,“Explode” and store denormalized group memberships for user when permission check is performed (if necessary). Group membership changes intelligently try and keep denormalized groups list up to date to avoid invalidation. When doing a permission check, fetch the exploded list of groups and a select against the target’s members with the indirect list of groups. Assumption #1: Most permission checks would be for direct access to resources, so exploded check would not happen often Assumption #2: When needed, fetching exploded group hierarchy would be quite fast: Fetch one row from Cassandra. Assumption #3: Selecting matches in the direct target members would be quite fast: Query finite number of columns from one row would be fast Result: Baseline test peaked at about 300 requests per second. Scaling up to larger sizes would explode the resource costs unacceptably, try and do better. Wednesday, 12 June 13
  • 101. Case: Permissions (cont’d) What went wrong? For starters, D-Trace analysis shows our app servers are spending over 90% of their time serializing / deserializing Thrift bodies from Cassandra Wednesday, 12 June 13
  • 102. Case: Permissions (cont’d) How do we fix it? Maybe we’re querying exploded groups more than we assumed, and there is much more data in the exploded group memberships than we assumed. Attempt #2 Query the target resource direct members. If there are no groups, simply compare the direct members with the source user. If there are groups, explode the groups of the source user (if not already denormalized), and only query the group ids from the exploded memberships that are directly assocated to the target resource. If no results, no access. If there are results, there is access. Assumption #1: Fetching full “exploded” groups is expensive, avoid it Assumption #2: Most permission checks are against resources who don’t have groups assigned as members, and there are generally much fewer groups assigned as members than groups a user will indirectly be a member of Result: Same baseline test peaked at 850 requests per second.Thats reasonable! Wednesday, 12 June 13
  • 103. Case:Activity Activity Aggregation is the process of collecting multiple “similar” activities into a single aggregated activity. In order to accomplish this, lots of “recent activities” need to be pooled together, and consulted for each routed activity. Attempt #1: Store the activity history and activity buckets in Cassandra Result: 3 Cassandra nodes, breaks down on a routed activity throughput of 135 per second during data-load’. Equivalent to roughly 1.3 activities per second in our tests. Not acceptable. Wednesday, 12 June 13
  • 104. Case:Activity (cont’d) Problem #1: Cassandra latency reports in DataStax OpsCenter showing Cassandra nodes are surpassing 5000 requests per second, and latency is climbing to over 10 seconds and load on the Cassandra servers pushing 7. Solution #1: Move aggregation into Redis.The data is volatile and gets evicted over time any way.Avoids cluster co-ordination gossip and disk I/O for a large part of the activity load. Problem #2: Initial tests showed the memory footprint easily skyrocketed over 8Gb. Not Acceptable. Solution #2: Normalize the aggregated entities in Redis rather than duplicate them for each activity aggregation entry. Result: With 3 Cassandra nodes and 3 activity servers, collection happens at ~1500 routed activities per second (translates to 15 activities per second).With 3 Cassandra nodes and 6 activity servers, collection was occurring at 2500 routed activities per second, which is as fast as the mass data-load was creating them. Memory footprint in all tests remains less than 4Gb for the entire duration. Cassandra remains stable in all tests. Good to go! Wednesday, 12 June 13
  • 105. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Someone poke the guy sleeping in the back. Wednesday, 12 June 13
  • 106. Deployment and Automation • As you can imagine, many machines to manage. Current inventory: • 3x Cassandra • 2x Redis • 2x RabbitMQ • 4x Application + Indexer • 3x Preview Processor • 1x Activity Processor • 1x Nginx • 3x Etherpad • Performance testing with a cluster of 21 virtual machines • Additional scalability testing and verification with ~30 virtual machines Wednesday, 12 June 13
  • 107. Puppet • Use puppet to centralize machine configuration and prevent configuration drift • Collection of “Manifests” that define the state that the machine should in based on its hostname / role: • What files should exist? What should their contents be? • What packages should be installed? • What services should be running, or stopped? • http://github.com/sakaiproject/puppet-hilary • All 20+ machines in cluster have Puppet installed, which ask for “catalog” info (expected configuration state) from a single puppet master machine • Puppet Master knows how to determine the machine state from the manifests based on its host (e.g., db0 is a cassandra node, it should have cassandra, java, etc...) • Use puppetdb with “External Resources” to share machine-specific information with each other node in the cluster Wednesday, 12 June 13
  • 108. Hiera • Serves configuration information for puppet • JSON-based data-format, which can be inherited in a flexible manner • Keeps large complex configuration data as clean as possible { "classes": [ "::oaeservice::hosts", "::oaeservice::firewall::open", "::oaeservice::rsyslog" ], "nodetype": "%{nodetype}", "nodesuffix": "%{nodesuffix}", "web_domain": "oae-performance.oaeproject.org" Wednesday, 12 June 13
  • 109. MCollective • Provides parallel execution over a number of machines at one time • Start / Stop / Check status of services • Install / Remove / Check version of packages • Use puppet resource syntax to check adhoc machine facts • Apply puppet manifests • Each cluster node subscribes to an ActiveMQ server to receive commands. Central machine (the “client”) publishes the command and waits for reply Wednesday, 12 June 13
  • 110. Slapchop • Missing piece:We need to create 21 machines of different specs in a cloud service, and somehow get MCollective on them • A tool we lovingly call slapchop • Define a JSON manifest that holds machines configs and instances • Run slapchop to create the machines in Joyent cloud, start them, get mcollective installed • Well, kind of... • Now you can log in to the MCollective client and run mco puppet apply • Well, kind of... • Go from empty cloud to working 21 machine cluster in ~15 minutes Wednesday, 12 June 13
  • 111. Nagios • Provides monitoring and alerts • Cassandra health • Diskspace • ElasticSearch JVM stats (memory usage, garbage collection) • Application server health • OS memory usage • Nginx health • RabbitMQ queue sizes • RabbitMQ health • Redis health • Nagios NRPE scripts deployed with puppet Wednesday, 12 June 13
  • 113. Munin • We are using Munin for time-series OS resource statistics • Disk, network, redis, load, memory • Deployed automatically through puppet manifests all nodes Wednesday, 12 June 13
  • 116. Security • Machines deployed in privateVLAN -- private interfaces are isolated • Public interface firewall completely closed on all nodes • Single bastion node with public SSH enabled, key-only authentication • Single Nginx node with public Web ports enabled • TCP Syn cookies enabled for publically exposed machines to prevent syn-floods • Rate-limiting to 50req/s per source IP applied for Web API requests • Several XSS tests and all issues followed up • Using OWASP JQuery plugin for XSS filtering user-created data • All infrastructure security deployed automatically with puppet • Penetration testing performed by University of Mercia • UI vulnerability testing performed by SCIRT group Wednesday, 12 June 13
  • 117. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Wednesday, 12 June 13
  • 118. UI Architecture Hilary 3akai-ux Mobile UI 3rd party integrations Wednesday, 12 June 13
  • 119. Core UI Architecture • JS frameworks • CSS framework • 3rd party plugins • OAE UI API • OAE CSS Components Wednesday, 12 June 13
  • 120. Core frameworks • RequireJS • jQuery • underscore.js Wednesday, 12 June 13
  • 121. RequireJS • File and module loader • Necessity to keep things modular • Optimisation built-in Wednesday, 12 June 13
  • 122. RequireJS • Define modules • Load files and modules on fly Wednesday, 12 June 13
  • 123. • DOM manipulation • Cross-browser abstraction • Events • Pretty much everything Wednesday, 12 June 13
  • 124. • Utility toolbelt • Manipulate objects, arrays, etc. Wednesday, 12 June 13
  • 125. CSS frameworks • Twitter Bootstrap • Font Awesome Wednesday, 12 June 13
  • 126. Twitter Bootstrap • Re-usable, consistent CSS is hard • Most popular CSS framework • Documentation already there • Basic components, styles, etc. • Override where necessary Wednesday, 12 June 13
  • 128. Font Awesome • Icon font • No more images • Style with CSS • Skinning • Easy Wednesday, 12 June 13
  • 130. 3rd party plug-ins • jQuery plug-ins • Bootstrap plug-ins Wednesday, 12 June 13
  • 131. 3rd party plug-ins • Autosuggest • History.js • Fileupload • Validate • Templates • etc. Wednesday, 12 June 13
  • 132. OAE UI API • Wrapper for REST requests • Users • Profile • Groups • Content • Discussions • Search • Config Wednesday, 12 June 13
  • 133. OAE UI API • Utilities • i18n • l10n • Widget loading • Template rendering • Notifications • XSS escaping • etc. Wednesday, 12 June 13
  • 134. OAE CSS Components • Re-usable HTML fragments • OAE specific elements • Consistency • Design guidelines Wednesday, 12 June 13
  • 135. Visibility icons Indicate visibility of groups, content, discussions, etc. Wednesday, 12 June 13
  • 141. Toolbox JS frameworks CSS framework 3rd party plugins OAE UI API OAE CSS Components Wednesday, 12 June 13
  • 142. Toolbox JS frameworks CSS framework 3rd party plugins OAE UI API OAE CSS Components WIDGET SDK Wednesday, 12 June 13
  • 144. Widgets • Modular components • HTML Fragment • JavaScript • CSS • Config file • Loaded into DOM Wednesday, 12 June 13
  • 145. Namespacing • Widgets share same container • Avoid clashes • Namespace: • HTML IDs • CSS classes • jQuery selectors Wednesday, 12 June 13
  • 146. Widget JS • Require required APIs • Return function to be executed as widget Wednesday, 12 June 13
  • 147. i18n • UI available in multiple languages • Standard .properties files • 2 types of bundles • Core bundles • Widget bundles Wednesday, 12 June 13
  • 148. i18n Translation priority 1. Widget user language file 2. Widget default language file 3. Container user language file 4. Container user language file Wednesday, 12 June 13
  • 150. i18n • English • French • German • Italian • Spanish • Russian (Partial) • Chinese (Partial) Wednesday, 12 June 13
  • 151. l10n • API methods for localizing: • Timezones • Date Formatting • Currency Wednesday, 12 June 13
  • 152. UI templating • TrimPath • Avoids lots of DOM manipulation • Pass in JSON data • Supports if statements, for loops, etc. Wednesday, 12 June 13
  • 153. UI templating • Templates are defined in between <!-- --> • oae.api.util.template().render(...) Wednesday, 12 June 13
  • 154. UI templating • Template <div id="example_template"><!-- <h4>Welcome {firstName}.</h4> You are ${profile.age} years old --></div> • Input oae.api.util.template().render($("#example_template"), { “firstName”: “John”, “profile”: { “placeofbirth”: “Los Angeles”, “age”: 45 } }); • Result <h4>Welcome John.</h4> You are 45 years old. Wednesday, 12 June 13
  • 155. UI templating • Template <div id="example_template"><!-- {if score >= 5} <h1>Congratulations, you have succeeded</h1> {elseif score >= 0} <h1>Sorry, you have failed} {else} <h1>You have cheated</h1> {/if} --></div> • Input oae.api.util.template().render($("#example_template"), { “score”: 6 }); • Result <h1>Congratulations, you have succeeded!</h1> Wednesday, 12 June 13
  • 156. UI templating • Template <div id="example_template"><!-- {for conference in conferences} <div>${conference.name} (${conference.year})</div> {forelse} <div>No conferences have been organized</div> {/for} --></div> • Input oae.api.util.template().renderTemplate($("#example_template"), { “conferences”: [ {“name”: “Sakai San Diego”, “year”: 2013}, {“name”: “Sakai Atlanta”, “year”: 2012} ] }); • Result <div>Sakai San Diego (2013)</div> <div>Sakai Atlanta (2012)</div> Wednesday, 12 June 13
  • 157. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example Or something else? Wednesday, 12 June 13
  • 158. Customization and configuration • Administration UI • Global administration • Tenant administration • Manage production environment Wednesday, 12 June 13
  • 159. Tenant management • Start, stop, edit tenants • Create new tenants Wednesday, 12 June 13
  • 161. Tenant configuration • Configure global tenant (overridden by tenants) or individual tenant configurations • Configure on the fly • Single Sign On integration • Default UI language • Default visibility settings • Data storage settings • etc. Wednesday, 12 June 13
  • 163. Tenant skinning • Skinning UI • Skin entire application • Branding, colors, etc. • LESS • Component re-use Wednesday, 12 June 13
  • 167. Extending with NPM • NPM - Node Package Manager • Dependency management, including remote fetching custom modules from the NPM repo or github • Stored inside of node_modules directory of your project • Usually a logical set of functionality (e.g., a back-end REST API, or a set of related widgets) • NPM module in 3akai-ux is searched for custom widgets • NPM module in Hilary (that starts with oae-) is searched for init.js to integrate to the application container • New dependencies can be added to package.json file • Changes to this file must be maintained with a patch, though :( Wednesday, 12 June 13
  • 168. UI Release Processes • Grunt • Task-based build system implemented in JavaScript • Similar in theory of operation to Make, Rake • Rich ecosystem of plug-ins to do most tasks • Easy to implement new task when a plugin doesn’t exist yet • Used for running test suites, production builds, linting tools Wednesday, 12 June 13
  • 169. UI Release Processes • Production Build • Optimizes the static assets to reduce throughput, request frequency, and optimize caching across versions • Require.js Optimization: • Concatenate JavaScript dependencies (reduces number of web requests significantly) • Minify / Uglify JavaScript files (reduces payload sizes significantly, even when gzip enabled on web server) • Hash optimization: • Hash the contents of static assets and append result to the filename, then cache them indefinitely on the browsers • When the files change, the hash in the filename changes to force reloading of the updated asset • If files never change across version, client never reloads file until their cache is cleared Wednesday, 12 June 13
  • 170. Developer Resources: Widget SDK • Contains help on creating widgets • Code best practices • Design style guide • UI and API documentation • Widget Builder • Examples Wednesday, 12 June 13
  • 171. Developer Resources: Docs UI • UI that has documentation automatically generated from the docs in the Hilary and 3akai-ux source code • Accessible from /docs path of any tenant Wednesday, 12 June 13
  • 172. Topics 1. Project Goals 2. Hilary System Architecture 3. Clustering 4. Hilary Design and Extension Patterns 5. Performance Testing 6. Deployment and Automation 7. UI Architecture 8. Customization and Configuration 9. Part 2: Hands on example You do have Hilary installed, right? Wednesday, 12 June 13