Upload
idc-frontier
View
1.067
Download
0
Embed Size (px)
DESCRIPTION
本スライドの全てまたは部分的な引用はご遠慮ください。
Citation preview
Dripcast
Server-less programming framework for ANDROID
Ikuo Nakagawa Dripcast Project
Dec., 2011
between concentration and distribution, local and in-house toward global and scalable, we focus in cloud-full computing model, data store and data process on a cloud, and
server-less programming model, e.g., transparent method call without thought of servers
Changes of computer models
Dec., 2011 © Dripcast Project 2
global
local
distribute
concentrate
10 : 1 1K : 10 1M : 100 1B : 10K 1T : 1M # of devices and processing nodes
3 layer model (client-server-database) Host server-less Programming model
biz. trend is here.
Host computer client and server PC + Web smartphone + cloud device + cloud Computing model
tech. trend touches here.
Our computing model, is...
Dec., 2011 © Dripcast Project 3
Today, device + cloud communication style is ready for new applications. Computing model is "cloud-full" and Programming model is "server-less". Cloud platform technologies change the concept of "network" application.
computer resources on a cloud with
unlimited data space unlimited processing space
server-less programming
model
Today's topic
cloud-full computing
model
Server-less programming
Dec., 2011 © Dripcast Project 4
"Bibbidi-Bobbidi-Boo"
(also called "The Magic Song")
is a novelty song, written in 1948 by Al Hoffman, Mack David, and Jerry Livingston.
It was introduced in the 1950 Disney film Cinderella, performed by actress Verna Felton.
Bibbidi-Bobbidi-Boo
Dec., 2011 © Dripcast Project 5
// an instance we want to handle. Gadget a = new GadgetImpl();
// store out value to the object, at first. a.setValue(31);
// now, verify input against our value. String s = in.readLine(); if (Integer.parseInt(s) == a.getValue()) { System.out.println("Great! Lucky guess!"); } else { System.out.println("No match. Sorry."); }
interface Gadget { void setValue(int val); int getValue(); }
class GadgetImpl implements Gadget { private int value = 0; public void setValue(int val) { value = val; } public int getValue() { return value; } }
defining "how to access"
your data object.
defining "what to do"
when you call it.
write your code via interface.
it's Java ! Try, 3 minutes hacking...
Let's make an object to be cloud-enabled.
Bibbidi-Bobbidi-Boo
Dec., 2011 © Dripcast Project 6
// an instance we want to handle. Gadget a = new GadgetImpl();
// store out value to the object, at first. a.setValue(31);
// now, verify input against our value. String s = in.readLine(); if (Integer.parseInt(s) == a.getValue()) { System.out.println("Great! Lucky guess!"); } else { System.out.println("No match. Sorry."); }
interface Gadget { void setValue(int val); int getValue(); }
class GadgetImpl implements Gadget { private int value = 0; public void setValue(int val) { value = val; } public int getValue() { return value; } }
defining "how to access"
your data object.
defining "what to do"
when you call it.
write your code via interface.
it's Java !
// Biddidi-Bobbidi-Boo. a = B3.setAndAttachInstance( key, Gadget.class, a);
creating your data object on a cloud.
executing your method (request)
on a cloud, as well.
What you need to do, is only casting a spell "Bibbidi-Babbidi-Boo" !
Android device (application)
Cloud (platform)
your data object
Try, 3 minutes hacking...
Changes
So, what's happen in Android application world ?
Example of "sharing GPS location" application
Dec., 2011 © Dripcast Project 8
public class YourActivity implements Activity, LocationListener { UUID key = UUID.fromString("your-group-UUID"); // to share an object between group members. NavigableMap map; // will be associated with a cloud object, e.g., cloud-enabled. String id; // to store my phone number.
public void onCreate() { map = B3.createOrAttachInstance(key, NavigableMap.class, "java.util.TreeMap"); id = ((TelephonyManager)getSystemService(TELEPHONY_SERVICE)).getLine1Number(); ((LocationManager)getSystemService(LOCATION_SERVICE)).requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, this); }
public void onLocationChanged(Location location) { int x = (int)(location.getLatitude() * 1E6); int y = (int)(location.getLongitue() * 1E6) map.put (id, x + "," + y);
// show, your members positions.... Entry entry = map.firstEntry (); while (entry != null) { // show id and location : entry.getValue() entry = map.higherEntry (entry.getKey()); } } }
getting GPS info of your party members
GPS info
It takes only 3 minutes to implement an application to share GPS info via the cloud. You only need to define class to hold location information (in Java), and share an instance.
No SQL/table definition nor REST/HTTP implementation would be required.
your-group-UUID
unique object on a cloud
store your GPS info
our models are ;
cloud-full computing and
server-less programming
Existing Develop. model
Cloud style Develop. model
GUI / Design tables (RDB)
Application logic
server side (Servlet)
GUI / Design
Application logic
processing and storing on the cloud, automatically.
client-server communication
server-RDB communication
Write as easy as local. NO skill is required for
SQL/database nor even REST/HTTP.
There is NO need to develop server side processing nor database programming. Our "Spell" delivers Java object into the cloud, both of for storing and processing.
You need only to develop application logic. It's very simple and efficient.
Server-less programming – forget about server side
It's 10 times easier to develop an application. Focus on application logic. That's all.
Application logic
Dec., 2011 9 © Dripcast Project
Cloud Platform
No more servers nor back-end systems for developers
Dec., 2011 © Dripcast Project 10
Of course, there is no need to use SQL/RDB, Servlet nor REST/HTTP. that means, we don't have to learn more about,...
Oracle, MySQL, PostgreSQL, Ruby, python, php, apache or others.
No more server side technologies
Feel it
See, more examples...
Write your own classes #1 - Mailbox
Dec., 2011 © Dripcast Project 12
// CREATE a mail box. d.newInstance(mboxId, MailboxImpl.class);
// POST a message. Mailbox mb = d.attachInstance(mboxId, Mailbox.class); mb.post("hello world!");
// LIST messages. Mailbox mb = d.attachInstance(mboxId, Mailbox.class); int total = mb.size(); System.out.println("total " + total + " messages in mail box."); for (int i = 0; i < total; i++) { System.out.println("No." + i + ": " + mb.get(i); }
public interface Mailbox { int size(); String get(int index); void post(String msg); }
interface definition usage example
public class MailboxImpl implements Mailbox { private Map<Integer,String> mails = new TreeMap<Integer,String>(); private int tail = 0; public int size() { return tail; } public String get(int index) { if (index < 0 || index >= tail) throw new IllegalArgumentException(); return mails.get(index); } public void post(String msg) { mails.put(tail, msg); tail++; } }
implementation class
Write your codes, as easy as local, with server-less style.
Write your own classes #1 - Mailbox
Dec., 2011 © Dripcast Project 13
// SEARCH messages for a given keyword. SearchableMailbox mb = d.attachInstance(id, SearchableMailbox.class); List<Integer> list = mb.search("Japan"); System.out.println("total " + list.size() + " messages found."); for (int i : list) { System.out.println("No." + i + ": " + mb.get(i); }
public interface SearchableMailbox extends Mailbox { List<Integer> search(String keyword) throws IOException; }
interface definition usage example
use huge amount of computer resources, for your process !
public class SearchableMailboxImpl extends MailboxImpl implements SearchableMailbox { public List<Integer> search(String keyword) throws IOException { int total = size(); List<Integer> ret = new LinkedList<Integer>(); for (i = 0; i < total; i++) { if (get(i).indexOf(keyword) >= 0) { list.add(i); } } return list; } }
implementation class
execute your request on the cloud
Inside Dripcast
basic architecture of Dripcast mechanism
Configuration of the cloud #1
Dec., 2011 © Dripcast Project 15
Smartphone
Dripcast client Dripcast engine EXAGE / Storage
Process space Storage space
In a typical configuration, Smartphone works with Dripcast client, and a cloud have Dripcast engine with scale-out style storage, EXAGE / Storage by Intec.
both of processing space and storage space are scalable.
Very simple application framework for
ANDROID/Java. it's server-less programming
Engine of the framework, provides interfaces for
storing and processing data. it's Platform (aka PaaS)
Scale-out style storage (by Intec, Inc.)
provides unlimited scalable storage space.
Dripcast cloud
Configuration of the cloud #2
Dec., 2011 © Dripcast Project 16
Smartphone
Dripcast client Dripcast engine
Process space Storage space
In a typical configuration, Smartphone works with Dripcast client, and a cloud have Dripcast engine with scale-out style NoSQL, Cassandra,
both of processing space and storage space are scalable.
Very simple application framework for
ANDROID/Java. it's server-less programming
Engine of the framework, provides interfaces for
storing and processing data. it's Platform (aka PaaS)
Scale-out style NoSQL (open source software)
provides unlimited scalable data space.
Dripcast cloud
Cassandra is available as back-end store
F.Y.I. Configuration on the NOAH cloud
Dec., 2011 © Dripcast Project 17
We have 4 relay servers and 16 engines on the NOAH cloud for multi-tenant services. It's easy to configure and setup Dripcast systems on the NOAH cloud.
Just start a new server with Dripcast template.
parallel & distributed processing
storage & processing
distribution + auth.
application features application
We appreciate to
for our cloud style computer resources on
If you'd like to have your account on the Dripcast cloud, please contact to the Dripcast project.
Service sites for Dripcast
Dec., 2011 © Dripcast Project 18
Dripcast may have lots of services in its architecture, based on "service name". A client simply selects "service name" when it initializes the Dripcast.
Services may have completely separated operational domains and hardwares.
Dripcast.openConnection("noahcloud");
Dripcast.openConnection("your-cloud"); your own Dripcast cloud
NOAHCLOUD
default site
If you'd like to have your own Dripcast cloud, please contact to the Dripcast project.
Activity
Research project started in academic + industrial organizations
F.Y.I. - Research project started for Dripcast
Dec., 2011 © Dripcast Project 20
"live on cloud, play on device"
1. Research a new development style of "device + cloud". optimize data model & processing model of direct access to cloud objects.
2. Deploy and standardize very easy and simple development model. For several languages and environments. "dripcast" is one of such impl. for Java.
3. Evaluate and feedback of new style cloud platform service. Application (providers, developers) and Platform (network, IDC, cloud operators).
Our goal is :
Research project for server-less programming model
Thanks for participating our project. Smart Technologies, A.T.Works,
NOAH Cloud (IDCF), and many organizations will join us !
Demonstration site available, soon. Visit http://dripcast.org
for more details.
Dec., 2011 © Dripcast Project 21
To feel "server-less" programming, visit
http://dripcast.org
download and put the SDK (dripcast-lib-x.y.z.jar)
into you CLASSPATH
try your sample code,
with Bibbidi-Bobbidi-Boo.
Demonstration site is available
Fin
Please contact to Ikuo Nakagawa, for more information.
Thank you.