23
25/11/08 Mike Taczak [email protected] Mailtrust, a division of Rackspace www.mailtrust.com | www.rackspace.com Contributing to OSS in a commercial non-OSS environment

Contributing to OSS in a commercial non-OSS environment

Embed Size (px)

Citation preview

Page 1: Contributing to OSS in a commercial non-OSS environment

25/11/08

Mike [email protected]

Mailtrust, a division of Rackspacewww.mailtrust.com | www.rackspace.com

Contributing to OSS in a commercial non-OSS environment

Page 2: Contributing to OSS in a commercial non-OSS environment

2

Overview

□ What is Mailtrust□ What OSS does Mailtrust use□ How has Mailtrust contributed to Funambol□ Design challenges□ Review of integration strategies

Page 3: Contributing to OSS in a commercial non-OSS environment

3

□ Formerly Webmail.us□ Now a division of Rackspace

◊ Recently went public□ Business-class email hosting□ Noteworthy Webmail

◊ Full-featured AJAX-y webmail application◊ Competitive collaboration suite

Page 4: Contributing to OSS in a commercial non-OSS environment

4

Mailtrust and Open Source

□ Heavily Used◊ PHP◊ mySQL◊ Hadoop◊ Postfix◊ amavisd◊ policyd◊ Many others

□ Main Contributions◊ Funambol◊ Dovecot

Page 5: Contributing to OSS in a commercial non-OSS environment

5

Contributions to Funambol

□ DS-Server◊ Webmail Connector

□ Outlook Client◊ Support for 'custom fields'

□ Blackberry PIM Client◊ Initial development in-house◊ Now part of Funambol's core clients

□ iPhone client◊ 2 weeks in Italy

Page 6: Contributing to OSS in a commercial non-OSS environment

6

Goals for Sync Service

□ Synchronize shared data◊ Read-only

□ Give back to open source community◊ But keep proprietary systems private

□ Focus on a few highly refined clients◊ Outlook◊ Blackberry◊ Windows Mobile

Page 7: Contributing to OSS in a commercial non-OSS environment

7

System Architecture Evolution, Part 1

DS-Server WebmailModule

Webmail

Data

Initial design:● Very Simple● Connector hit DBs directly

UserDatabase

WebmailDatabase

Authentication

Page 8: Contributing to OSS in a commercial non-OSS environment

8

System Architecture Evolution, Part 1

DS-Server WebmailModule

Webmail

Lessons Learned:● 2 code bases to maintain!● Data validation duplicated● Proprietary DB schemas in open

source code!● We could not launch with this

architecture

Data

UserDatabase

WebmailDatabase

Authentication

Page 9: Contributing to OSS in a commercial non-OSS environment

9

System Architecture Evolution, Part 2

Webmail

Introducing the Webmail-Sync API● Implementation of SyncSource

interface in API form● Data parsing now in php

● Implemented a large Vobj library● Hope to open-source it!

● Uses existing structures and validation● HTTP + jsON

● Connector generic enough for other uses● Clear separation between Funambol

and Webmail

APIDS-Server WebmailModule

WebmailDatabase

Page 10: Contributing to OSS in a commercial non-OSS environment

10

System Architecture Evolution, Part 2

Lessons Learned● PHP has an execution time limit

● Don't do too much at once● Know your technologies intimately

● Distance matters● Reliability, speed deteriorates● Retry failed requests

● getSyncItemByKey is slow● Page calls and cache data

DS-Server WebmailModule Webmail

2000Miles!

API

WebmailDatabase

Page 11: Contributing to OSS in a commercial non-OSS environment

11

System Architecture Evolution, Part 3

Webmail

Batching calls to API● Can't batch calls w/ standard code

● addItem requires returning a GUID● Went one layer higher

● New BatchedSyncStrategy● New BatchedSyncSource● Completely compatible with original

● Reduced calls by 50-90%

APIDS-Server WebmailModule

Str

ate

gy

WebmailDatabase

Page 12: Contributing to OSS in a commercial non-OSS environment

12

System Architecture Evolution, Part 3

Webmail

Lessons Learned:● The Strategy is complicated● Test, Test, Test● Funambol is very flexible to these

kind of changes

APIDS-Server WebmailModule

Str

ate

gy

WebmailDatabase

Page 13: Contributing to OSS in a commercial non-OSS environment

13

System Architecture Evolution, Part 4

Webmail

New Problems● Cannot upload to webmail and

sync at the same time!● Do not want load from API

processing affecting webmail users

APIDS-Server WebmailModule

Str

ate

gy

WebmailDatabase

Page 14: Contributing to OSS in a commercial non-OSS environment

14

System Architecture Evolution, Part 4

DedicatedWebmail

ForSync

Lessons Learned:● Dedicate systems whenever possible● Scale services independently

APIDS-Server WebmailModule

Str

ate

gy

WebmailDatabase

Webmail

Page 15: Contributing to OSS in a commercial non-OSS environment

15

System Architecture Evolution, Part 5

DedicatedWebmail

ForSync

New Problems, Again!● Network connectivity issues

caused duplicates● Requests to addItems failed, and

were retried● Sync was hitting webmail

databases too hard ● 50 calendars can have a lot of data

APIDS-Server WebmailModule

Str

ate

gy

WebmailDatabase

Webmail

Page 16: Contributing to OSS in a commercial non-OSS environment

16

System Architecture Evolution, Part 5

DedicatedWebmail

ForSync

Lessons Learned:● Don't retry 'dangerous' commands● Database connections are limited

resources● Cache everything reasonable!

● Database requests● API requests!

● Open source has a solution

APIDS-Server WebmailModule

Str

ate

gy

WebmailDatabase

Webmail

memcached

mem

cach

ed

Page 17: Contributing to OSS in a commercial non-OSS environment

17

System Architecture – Misc details

□ SyncSourceRedirectSynclet◊ Replaces remote URI in requests◊ Uses content types sent by client, has defaults◊ 'contacts' => 'contacts-vcard21' or 'contacts-sif'◊ Easier for users to configure devices◊ Guarantees clients get the preferred type, if

available

Page 18: Contributing to OSS in a commercial non-OSS environment

18

System Architecture – Misc details

□ SessionConnectionLimiterSynclet◊ Disconnects a session that has lasted 'too long'◊ Protects service from runaway clients

Page 19: Contributing to OSS in a commercial non-OSS environment

19

System Architecture – Misc details

□ Authentication◊ Moved queries to mysql stored procedures◊ Keeps DB schema out of code and configuration◊ Allows installations to redefine these procedures

Page 20: Contributing to OSS in a commercial non-OSS environment

20

Summary

□ Use abstractions to hide proprietary details

◊ Write open logic, and share it!□ Physically and logically separate open and

closed source programs◊ API separated synchronization logic from

our proprietary systems and data◊ Stored procedures hide our database

behind an interface

Page 21: Contributing to OSS in a commercial non-OSS environment

21

Summary, cont.

□ Rely on configurations for details◊ Funambol does this already – model after

them◊ Requires flexible code, just the kind open

source needs□ Work at a great company

◊ The kind that values open source◊ The kind that lets you give back!

Page 22: Contributing to OSS in a commercial non-OSS environment

22

Summary, cont.

□ Coordinate with your community◊ Communication is key◊ Work out a way to share code and plans

often◊ Still working on this one ;)

□ Go to Italy!

Page 23: Contributing to OSS in a commercial non-OSS environment

23

The End

Questions? Comments?

[email protected]