Date post: | 12-Jan-2015 |
Category: |
Documents |
Upload: | dc-web-api-user-group |
View: | 1,231 times |
Download: | 0 times |
America’s Economy
Alec Permison, ADIT/ASDPaul Milbourne, ADIT/ASDGustavo Torrico, ADEP/EPD
The Making of the Census Bureau’s First Official Mobile App
America’s Economy
Agenda• Overview
• Front-end Architecture
• Back-end Architecture
• Project Challenges
• Lessons Learned
America’s Economy
Overview• First Census Bureau mobile app
for Android/iOS both phone & tablet
• Developed as part of ongoing Web Transformation effort
• Displays 16 economic indicators
• 13 from Census Bureau Central Indicators Database Repository
• 2 from Bureau of Economic Analysis
• 1 from Bureau of Labor Statistics
America’s Economy
Overview• Collaborative team effort
• Communications Directorate – product owner & manager
• Contractor – front-end development
• Economics Directorate – data experts and back-end development
• IT Directorate – technical guidance, back-end development, and technical support
America’s Economy
Overview• Mobile app front-end displays data
• Three back-end API’s supply data at startup, refresh, and indicator release
• CIDR Private API developed by Econ
• BLS Private API developed by IT
• BEA Public API
• Config file on server queried at
startup
App
CIDR BLS BEA
BoC Private
America’s Economy
Front End Architecture• Adobe Flex 4.6
• Adobe AIR 3.3
• SWIZ 1.4
• iOS 4+
• Android 2.2+
• Skills Required
– ActionScript
– CSS
– XML
America’s Economy
Front End Architecture• Tools Required
– Adobe Flash Builder 4.6– Xcode and Eclipse for some
native components
• Pros of Adobe Flex
– Device agnostic from a single code base
– Easier than native development
– Broad developer community
• Cons of Adobe Flex
– Larger footprint (especially on iOS)
– Android support varies by device
– Slower performance
– Requires AIR runtime
America’s Economy
Front End Architecture
• LAMP stack:– RHEL 5.8
– Apache 2.2.3
– Mysql 5.0.95
– PHP 5.1.6
• Zend Framework 1.6– Simple, loosely-coupled
component library for web applications
• JSON-based :– Economic dashboard data
– Historical economic indicator data
– Simple format derived from mobile application mockups.
– Private through hash based “authentication”
– Text-based, easily parse-able.
– Data available as soon as upload process is completed on internal Census servers.
America’s Economy
Back End Architecture (CIDR)
category
display_cell
data_type
error_typegeo_level
time_slot
dashboard_data
America’s Economy
Back End Architecture (CIDR)
• Historical data available in CIDR database (display_cell table)
America’s Economy
Back End Architecture (CIDR)
• Basic hash-key based authentication
• Example URL:
– http://www.census.gov/econ/currentdata/api/dashboard?id=sapient&hash=89704299208e7e9d16380e4384861396f3398cb0
• Calculating hash:
– sha1(secret key + time stamp + path requested)
1. Secret key – a 40 character alpha-numeric string
2. Time stamp – in the format YYYY-MM-DD 24HH (e.g. ‘2012-05-14 17’) using UTC timestamp.
3. Path requested – excluding id and hash parameters. ‘/econ/currentdata/api/dashboard’
America’s Economy
Back End Architecture (CIDR)
• Skills Required
– LAMP web dev
– Enterprise-scale development experience (not for newbie’s)
– REST interface design
America’s Economy
Back End Architecture• Tools Required
– Dev/test environment– IDE
• Pros of Private API
– Fast performance for database on our server
– Customized to need of front-end developer
– Access more data than public API
– Under your control
• Cons of Private API
– Additional skilled resources required
– Additional application to support
– Dependent on your infrastructure
America’s Economy
Back End Architecture
Project Challenges
• Limited insight into technical design and code at handoff (25,000+ LOC, few comments or technical docs initially)
• Security framework still under development
• Lack of dev/test tools & environment for mobile
• Standardizing data formats from 3 API’s (e.g. timestamps)
• Timely technical support from other agencies
• Coordination with external contractor (e.g. config updates)
America’s Economy