max: realtime messaging and activity stream engine
TRANSCRIPT
![Page 1: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/1.jpg)
Activity stream and conversation engine
(MAX)Víctor Fernández de Alba (@sneridagh)
Carles Bruguera (@sunbit)
MAX is a project founded by @UPCnet and @BarcelonaTech
![Page 2: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/2.jpg)
![Page 3: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/3.jpg)
History• First commit on August, 2011
• Initially designed as the key feature for the BarcelonaTech university concept of social intranet
• The university’s social intranet concept is on the IT roadmap since 2007 and it has been developed with limited resources since then
![Page 4: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/4.jpg)
Social intranet concept
![Page 5: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/5.jpg)
Activity StreamActivity
CommentsLikes
FavoritesImages
Files
![Page 6: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/6.jpg)
Conversations
1to1GroupImages
Files
Realtime using STOMP RabbitMQ plugin
![Page 7: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/7.jpg)
Push notifications
iOS
Android
![Page 8: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/8.jpg)
External sources aggregator
![Page 9: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/9.jpg)
AuthenticationoAuth 2.0
Resource Owner Password Credentials flow (https://pypi.python.org/pypi/osiris)
LDAPand other pluggable
auth backends
![Page 10: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/10.jpg)
Activity stream• Stores activity from
users and applications
• The applications can impersonate users to feed the stream with useful information
oAuth server
API
MongoDB
![Page 11: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/11.jpg)
Context oriented
• Subscriptions are made against contexts
• A context is something with an unique URL
• An user can have n subscriptions to contexts
• The user timeline is composed of all the activity generated in these contexts
![Page 12: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/12.jpg)
Conversations
• Realtime conversations and private messaging
• Support for sending images and files
oAuth server
API (WSGI client)
MongoDB
RabbitMQ STOMP
Conversation queues
![Page 13: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/13.jpg)
InfrastructureoAuth server
API
MongoDB RabbitMQ
Queues
push Twitter
conversations
Consumers
Frontends
MAXUI.js
iOS
Android
![Page 14: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/14.jpg)
MAX API
88 RESTfulendpoints
> 600 tests and 96% coverage
![Page 15: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/15.jpg)
MAX API
Pyramid powered
gevent optimized
![Page 16: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/16.jpg)
BackendsMongoDB
RabbitMQ
General storage
Realtime conversation backendProcessing queues
![Page 17: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/17.jpg)
Queues and consumers• Designed for huge loads (conversations specially)
• RabbitMQ queues
• gevent consumers with WSGI API client
• Push (iOS and Android notifications)
• Twitter streaming traking consumers for contexts and users
• Conversations
![Page 18: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/18.jpg)
FrontendsMAXui.js
• jQuery, no framework but using modern JS development good practices
• Can be instantiated virtually in any web site given the username and oAuth token and MAX server
• Stomp.js (STOMP over websockets) powered
![Page 19: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/19.jpg)
• Native apps
• Stream, conversations, subscriptions
• Support for push notifications
FrontendsiOS & Android
![Page 20: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/20.jpg)
Performance4000 concurrent users
100 messages/sec
200 conversations 20 users/conversation
1 message every 2 seconds
![Page 21: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/21.jpg)
Plone integration
![Page 22: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/22.jpg)
What’s next?
• Follow people and activity publishing not related to any particular context
• Sharing
• Improve documentation!!
![Page 23: MAX: Realtime messaging and activity stream engine](https://reader034.vdocuments.net/reader034/viewer/2022042607/55a78b3e1a28ab206e8b467d/html5/thumbnails/23.jpg)
Resources
https://upcnet.github.io/max
https://github.com/UPCnet/max
https://github.com/UPCnet/maxserver