This was a talk presented at AnDevCon in Washington DC, July 2017.
For products that are delivered on the Web, iOS and Android, there have been myriad approaches to reducing development time and the duplication of work. Sharing code between major platforms has, in some ways, felt like the search for the holy grail - hope remains, but as of today, has yet to be found. As long as there have been multiple platforms, there has been a desire to write once, deploy everywhere.
In this class, we will look at accelerating cross-platform development by harnessing serverless microservices. At Hootsuite, our serverless experiment uses AWS Lambda functions. This class will cover the motivations of using AWS Lambda compared with other mobile cross-platform solutions. We will also examine the benefits and drawbacks of this approach to cross-platform development. Lastly, you will learn how Hootsuite worked to automate the deployment and versioning of its AWS Lambda function, including its integration it into our existing continuous integration pipeline.
We also share the lessons learned after having an AWS Lambda deployment on iOS and Android running for many months as well as the experimentation with Amazon API Gateway to create an endpoint which invokes the Lambda function, enabling the function to be used by our web-based products as well.
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Put iOS and Android on the same Wavelength with Serverless Microservices
1. Put iOS and Android on the
same Wavelength with
Serverless Microservices
AnDevCon - July 2017
Neil Power @neilpower (and Paul Cowles @paulrc)
https://github.com/neil-power-hs/aws-lambda-sample
10. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
● Core Mobile team facilitates mobile development at
Hootsuite.
● Dedicated iOS, Android, API and Services, Automation
teams.
● Continuous integration and delivery pipeline.
● iOS and Android teams focus on native
implementations (Swift/Obj-C and Java/Kotlin).
Our Team
27. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
What Should We Try Next?
● Service oriented architecture (SOA), microservices
inspired
● Focus lower down the stack, away from the interface
● Develop and debug local, run in the cloud
● Cross Platform - Android first, iOS second, Web third
29. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
Improved Twitter Search
● Hootsuite enables users to search Instagram and
Twitter and save those as streams for future use
○ One of our most popular stream types
● Twitter in particular provides an extensive search API
○ Unless you’re a developer, search syntax is arcane
34. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
Why Keep it Out of the Client?
● Twitter could change search syntax.
○ We don’t want to redeploy the apps after such a
change.
● We want to avoid computation the app side.
● We want to avoid embedded ANTLR runtime in the
app.
35. (((Social OR socialmedia OR #SocialMedia) AND (monitoring OR
analytics OR “management tool" OR compliance OR listening OR
monitoring OR publishing OR engagement OR infrastructure OR
intelligence OR "Social Media Management")) AND
(recommendation OR recommendations OR suggestion OR
suggestions OR ideas OR thoughts OR suggest OR recommend OR
promote OR advice OR "Should use" OR anyone OR Friends OR
(What's AND Favorite))) AND -RT -http -from:FiftySocialMedia
Real Customer Search
41. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
Terraform, AWS CLI, boto
● Terraform: a tool for Infrastructure as code. Build,
change, version infrastructure.
○ Terraform allows the testing and reproduction of
infrastructure changes.
● AWS CLI: tool for managing AWS resources through a
terminal.
● boto: Python wrapper for AWS CLI.
97. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
Development Experience
● The Good
○ Android developers immediately productive in Java.
○ Android developers finally get to use Java 8.
○ Much easier to manage Lambda than virtual server.
● The Challenges
○ Many different technologies (polyglot development).
○ Rather than compilation, Lambda code must be deployed.
98. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
The Sweet Spot
● Works well for complex “business logic”
● Adds safety when aggregating or integrating third party services
● Requires network availability, not a fit for offline experiences
● User experience that allows hiding latency by prefetching
● Cross platform requirement
100. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
Benefits
● Sharing across Web and mobile
● If you’re already aligned with microservices, natural mental model
● No servers sitting idle costing you money
● Lambda ideal for low, uncertain or sporadically used services due
to pay per use however also endlessly scalable
● Sane way of versioning client server
● Low burden to support MANY versions at the same time
● Encourages encapsulation
● Easy to empower distributed teams
102. https://github.com/neil-power-hs/aws-lambda-sample @NeilPower
Summary
● Download the sample repo yourself and run through front to
back, we use it as a workshop.
● The cross platform opportunity will continue to be a dream goal
and hotly contested in terms of how much it is worth chasing and
how to best achieve it.
● Physical servers -> Virtual Servers -> Containers -> Serverless is
an interesting journey.
● Cloud functions are a powerful enabler.
● Embrace experimentation as part of your culture.
● Share what you are doing #workoutloud!