270 likes | 415 Views
presenter. Shuhei Kawasakiauthor of MobaSiF (today: in charge of Q
E N D
1. Introducing MobaSiF(Mobile Simple Framework) Tokiharu Noto
Shuhei Kawasaki
{noto,kawasaki}@dena.jp
2. presenter Shuhei Kawasaki
author of MobaSiF (today: in charge of Q&A)
mobile service creator
Moba-oku (mobile auction, http://mbok.jp/)
Pocket Affiliate (affiliate ASP, http://smaf.jp/)
Mobage-town (mobile game town, portal, SNS, http://mbga.jp/)
150? (15 billion) page views / month
1000? (10 million) registered customers
director of DeNA Co., Ltd.
Tokiharu Noto
search technology engineer in DeNA
PR of engineering
3. agenda MobaSiFs feature
requirement
modules for mobile web applications
carrier, handset type/ID detector
pictograph
template engine
dispatcher / MVC controller
benchmark
conclusion
4. what is MobaSiF? = Mobile Simple Framework
released as an open source project today
developed since Nov, 2003
? brand-new architecture (somewhat legacy?)
used in
[Mar, 2004] Moba-oku (mobile auction)
[Jul, 2004] Pocket Affiliate
[Jan, 2005] au Auction
[Jan, 2006] Mobage-town
[Apr, 2006] Moba-kore (mobile collection)
5. what is MobaSiF? = Mobile Simple Framework
released as an open source project
developed since 2003-11
? brand-new architecture (somewhat legacy?)
used in
[Mar, 2004] Moba-oku (mobile auction)
[Jul, 2004] Pocket Affiliate
[Jan, 2005] au Auction
[Jan, 2006] Mobage-town
[Apr, 2006] Moba-kore (mobile collection)
= Moba* Simple Framework
6. feature modules commonly used in mobile web applications
pictograph converter
carrier, handset type / ID detector
template engine
simple, thin, easy-to-understand, light-weight
fast XS implementations for the better performance
used in large-scale mobile services for a long time
7. requirement Server
Linux (CentOS 4.x in DeNA)
Perl 5.8.0 or later
Apache (1.3.x in DeNA)
FastCGI or mod_perl (FastCGI in DeNA)
MySQL 5.0.x
Cellular Phone
NTT DoCoMo: FOMA
i-mode ID / HTTPS will be supported soon
au: WIN
Softbank Mobile: 3GC
8. modules for mobile web applications
9. MobileEnv.pm MB_CARRIER_IP: D, A, V, I, X, -
MB_MODEL_TYPE: DM, DF, AU, AH, VC, VP, VW, VG
MB_MODEL_NAME: ex. N905i
MB_SERV_LV: -1 = unsupported
MB_SERIAL, MB_SERIAL2: utn of NTT DoCoMo
MB_UID: i-mode ID, EZ number, Softbank UID
other
10. difficulty in pictograph compatibility
three carriers have their own pictograph set
DoCoMo: 252, au: 822, Softbank: 474
three carriers have their own encoding and code
only au handsets can display them from DoCoMo code
users among different carriers would like to communicate each other with pictographs
? converter needed
how to be stored in DB
11. pictograph in MobaSiF developers write only one template for three carriers with i ??? (= a pictograph input application for PCs, provided by NTT DoCoMo)
users can input pictograph in <FORM>
among users using a same common carrier
exactly same pictograph can be exchanged
among users using different carriers
similar pictograph can be exchanged
with our original mapping
own encoding for DB
12. i ??? input application
13. pictographs in MobaSiF
14. encoding for Softbank Mobile v-sjis-w: Softbanks official encoding: Web code
0x1B 0x24 {C1} {C2} 0x0F (= max 5 bytes)
v-sjis-u: MobaSiFs original encoding
0x0B {C1} {C2} (= 3 bytes)
15. MTemplate - feature developers write a template only once for three carriers
template compiler makes binary template
1 HTTP request ? 1 parse
XS / C implementation for the better performance
simple syntax
16. MTemplate - tags (1) variable replacement
$=OPTIONS:NAME$
h: html encode (ex. & ? &)
e: uri escape
b: bare
conditional clause (nest supported)
$ if (COND) { $
$ } elsif (COND1 || COND2) { $
$ } elsif (COND1 && COND2) { $
$ } else { $
$ } $
17. MTemplate tags (2) loop (nest and conditions supported)
Perl
my @fruits = (
{name => 'apple', price => '100'},
{name => 'orange', price => '120'},
{name => 'melon', price => '500'}, );
$rhData->{List} = \@fruits;
template
$ loop (List) { $
$=h:name$ ? $=h:price$ ?! <br>
$ } $
18. MTemplate tags (3) switch by the carrier
$DOM:d,v$
only for DoCoMo and SoftBank
$/DOM$
$DOM:a$ only for au $/DOM$
other
$INC:NAME$ ? include common element
$CON:NAME$ ? constant
$STY:NAME$ ? style definition
19. dispatcher / MVC controller
20. dispatcher / MVC Controller URL (http://example.com/_func)
? RewriteRule ? index.fcgi?f=func ? Main.pm
Main.pm
MobileEnv::set();
$_::F = new Request(); # conv pictographs
$_::U = new UserData();
...
callPage($func)
pages.conf
func => [user_st, uid_st, serv_st, module, sub],
pm/Page/*.pm
21. benchmark
22. benchmark (1) template engine (w/Benchmark::cmpthese)
user registration page (mbga.jp)
Template Toolkit: 2,812/s
MTemplate: 29,260/s (940%)
diary list page (mbga.jp, loop with 10 items)
Template Toolkit: 612/s
MTemplate: 14,312/s (2237%)
? TTs < 1-2 msec is enough fast
pictograph converter (mbga top page to Softbank?)
Encode::JP::Mobile: 464/s
Mcode: 1,916/s (313%)
23. benchmark (2) web application framework
(no DB access, hello, world!)
% ab c10 n10000 <url>
Apache (static file): 10460.25 [#/sec]
MobaSiF (FastCGI): 3297.07 [#/sec]
Catalyst (mod_perl): 566.12 [#/sec]
24. misc DA.pm
Daemon.pm
daemon_queue_send, daemon_queue_recv
MLog.pm
mobamail will be available (not now)
Artistic License or GPL v2
25. conclusion
26. conclusion MobaSiF = Moba/Mobile Simple Framework
modules commonly used in mobile web applications
pictograph converter
carrier, handset type / ID detector
template engine
simple, thin, easy-to-understand, light-weight
fast XS implementations for the better performance
used in large-scale mobile services for a long time
27. now available! http://sourceforge.jp/projects/moba/