SlideShare a Scribd company logo
Hybrid Appand GAE DataStore 대표이사 장선진 @jangsunjin ,[object Object]
 E-Mail: jangsunjin@softwareinlife.com,[object Object]
CAP and ACID CAP  정합성(Consistency). The client perceives that a set of operations has occurred all at once. 가용성(Availability). Every operation must terminate in an intended response. 단절내성(Partition tolerance). Operations will complete, even if individual components are unavailable. ACID 원자성(Atomicity). All of the operations in the transaction will complete, or none will. 일관성(Consistency). The database will be in a consistent state when the transaction begins and ends. 고립성(Isolation). The transaction will behave as if it is the only operation being performed upon the database. 지속성(Durability). Upon completion of the transaction, the operation will not be reversed. http://queue.acm.org/detail.cfm?id=1394128
Google BigTable System BigTable Master Server Chubby Server Tablet Server #2 Tablet Server #1 MapReduce Worker #2 MapReduce Worker #1 GFS #2 GFS #1
Google BigTable Architecture GAE Application DataNucleus ORM (JDO or JPA Implementation) Low Level API Datastore Meta 0 tablet  Big Table Meta 1 tablet  Meta 1 tablet  Meta 1 tablet  Tab 1 Tab 2 Tab 3 Tab 4 Tab n GFS(Google File System)
Google BigTable Dynamic control over Data Layout and Format Not support a full Relational Model Dynamic control over serving data from memory or disk Column oriented The map is indexed by A row key A column name A timestamp BigTable Key TimeStamp / Version Columns Index
LDAP(Lightweight Directory Access Protocol) The Lightweight Directory Access Protocol (LDAP) is an application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. Directory services may provide any organized set of records, often with a hierarchical structure, such as a corporate electronic mail directory. Similarly, a telephone directory is a list of subscribers with an address and a phone number.
Google App Engine Product Roadmap Features on Deck App Engine out of Preview SSL access on custom domains Full-text search over Datastore Support for Python 2.7 Support for running MapReduce jobs across App Engine datasets Bulk Datastore Import and Export tool Improved monitoring and alerting of application serving Logging system improvements to remove limits on size and storage Integration with Google Storage for Developer
DataStore의 제약사항 Write가 느림 검색 가능한 Text 사이즈: 500 자 Entity 최대 사이즈: 1Mb 최대 Batch (save/delete) : 500 Entity SQL을 사용할 수 없음 데이터베이스의 제약조건을 적용할 수 없음 Aggregation 함수를 지원하지 않음 (count, avg) 쿼리가 최대 조회 레코드: 2000 쿼리에서 Equal 연산 이외의 조건은 1개만 추가 가능 트랜잭션의 단위는 Entity Group에 한정 됨
Datastore API and ORM API
Datastore API(Low Level API) 모든 Entity는 Kind가 지정 Entity는 하나이상의 Property를 포함 특정 Kind에포함된 Entity는 동일한 Property를 갖지 않음 Entity의 Property는 이름은 동일하지만 데이터 유형이 다를수 있음 Schemaless의 특성 ID는 지정하지 않을 경우 자동 할당 됨
Entity App Engine Datastore에서 관리하는 객체는 Entity Entity는 하나의 Key를 포함 모든 Entity 중 유일한 구분자 Key 의 구성 Path Parent Entity의  key Entity의 Kind Entity에 할당된 이름 App이 할당한 값 Datastore가 지정한 numeric ID 지원 데이터 타임 integers, floating point values, strings, dates, binary data 등 각 엔티티는 하나이상의 Property를 포함 하나의 Property에 복수의 데이터 타입 저장 가능 하나의 Property에는 복수의 값이 저장 가능 복수의 값들의 데이터 유형은 다를 수 있음
Entity Model Settings Kind : Table Key : Primary Key Entity Group : Partitioning Property : column
Entity Example(Create) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService();Entity employee = new Entity("Employee");employee.setProperty("firstName", "Antonio");employee.setProperty("lastName", "Salieri");Date hireDate = new Date();employee.setProperty("hireDate", hireDate);employee.setProperty("attendedHrTraining", true);datastore.put(employee);
Entity Example(Scheme Free) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService();Entity employee = new Entity("Employee");employee.setProperty("firstName", “Sun-Jin");datastore.put(employee);
Entity Group Entity Group는 부모 Entity를 갖는 Entity의 Group 하나의 트랜잭션에서 여러 Entity를 조회, 생성, 수정, 삭제 할 수 가능하지만 그 범위는 단일 Entity Group에 국한 부모 Entity 를 가지 않은 Entity 를 Root Entity라고 함 Entity Group은 하나의 Root Entity와 Child Entity로 구성 하나의 EntityGroup은 동일한 분산 네트웍 서버에 저장됨 (Tablet 서버)
Entity Group Entity Group Root Entity (xxxx) Child Entity (xxxxyyyy) Child Entity (xxxxyyyyzzzz)
Entity Example(Read) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Key rootKey = KeyFactory.createKey("Employee", “CEO"); Entity employee = datastore.get(rootKey);
Entity Example(Update) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Key rootKey = KeyFactory.createKey("Employee", “CEO"); Entity employee = datastore.get(rootKey); employee.setProperty("firstName", “Sun-Jin");employee.setProperty("lastName", “Jang");datastore.put(employee);
Entity Example(Delete) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Key rootKey = KeyFactory.createKey("Employee", “CEO"); Entity employee = datastore.get(rootKey);datastore.delete(employee);
Entity Example(Query) // ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Query q = new Query(”employee")  q.addFilter("lastName", Query.FilterOperator.EQUAL, lastNameParam);  q.addFilter("height", Query.FilterOperator.LESS_THAN, maxHeightParam);   PreparedQuerypq = datastore.prepare(q);   for (Entity result : pq.asIterable()) {        String firstName = (String) result.getProperty("firstName");        String lastName = (String) result.getProperty("lastName");        Long height = (Long) result.getProperty("height");    }
Java ORM API
DataNucleus DataNucleus attempts to make the whole process of persisting data a transparent process.  The idea revolves around the developer having a series of Java classes that need persisting.  http://www.datanucleus.org/products/accessplatform/development_process.html
JDO Model Define(Annotation) import javax.jdo.annotations.PersistenceCapable;@PersistenceCapablepublic class Employee {    @PrimaryKey    @Persistent(valueStrategy= IdGeneratorStrategy.IDENTITY)    private Key key;      @Persistent    private String firstName;    @Persistent    private String lastName;    @Persistent    private Date hireDate; }
JDO Model Define(Annotation) import javax.jdo.annotations.PersistenceCapable; // …@PersistenceCapablepublic class Employee {    @PrimaryKey    @Persistent(valueStrategy= IdGeneratorStrategy.IDENTITY)    private Key key;      @Persistent    private String firstName;    @Persistent    private String lastName;    @Persistent    private Date hireDate; }
JDO Model(Create)         PersistenceManager pm = PMF.get().getPersistenceManager();        Employee e = new Employee("Alfred", "Smith", new Date());        try {            pm.makePersistent(e);        } finally {            pm.close();        }
JDO Model(Update) public void updateEmployeeTitle(User user, String newTitle) {    PersistenceManager pm = PMF.get().getPersistenceManager();    try {        Employee e = pm.getObjectById(Employee.class, “Sun-Jin”);        if (titleChangeIsAuthorized(e, newTitle) {            e.setTitle(newTitle);        } else {            throw new UnauthorizedTitleChangeException(e, newTitle);        }    } finally {        pm.close();    }}
JDO Model(Delete) public void updateEmployeeTitle(User user, String newTitle) {    PersistenceManager pm = PMF.get().getPersistenceManager();    try {        Employee e = pm.getObjectById(Employee.class, “Sun-Jin”);         pm.deletePersistent(e);     } finally {        pm.close();    }}
JDO Model(Query) import java.util.List;import javax.jdo.Query;// ...    Query query = pm.newQuery(Employee.class);    query.setFilter("lastName == lastNameParam");    query.setOrdering("hireDatedesc");    query.declareParameters("String lastNameParam");    try {        List<Employee> results = (List<Employee>) query.execute("Smith");        if (!results.isEmpty()) {            for (Employee e : results) {                // ...            }        } else {            // ... no results ...        }    } finally {        query.closeAll();    }
Demo
감사합니다. http://code.google.com/p/devmento-gae-seminar

More Related Content

What's hot

Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
Bruno Borges
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your Graph
VMware Tanzu
 
Introduction to Vaadin
Introduction to VaadinIntroduction to Vaadin
Introduction to Vaadin
netomi
 
9 design factors for cloud applications
9 design factors for cloud applications9 design factors for cloud applications
9 design factors for cloud applications
uEngine Solutions
 
JavaFX Enterprise
JavaFX EnterpriseJavaFX Enterprise
JavaFX Enterprise
Hendrik Ebbers
 
Spring Mvc,Java, Spring
Spring Mvc,Java, SpringSpring Mvc,Java, Spring
Spring Mvc,Java, Spring
ifnu bima
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
Mohit Gupta
 
Building cloud native microservices
Building cloud native microservicesBuilding cloud native microservices
Building cloud native microservices
Emily Jiang
 
Surat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime FabricSurat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Jitendra Bafna
 
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011telestax
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
vinayiqbusiness
 
Spring jdbc dao
Spring jdbc daoSpring jdbc dao
Spring jdbc dao
Anuj Singh Rajput
 
Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012
Jared Ottley
 
성공적인 서비스로의 플랫폼 선택
성공적인 서비스로의 플랫폼 선택성공적인 서비스로의 플랫폼 선택
성공적인 서비스로의 플랫폼 선택
uEngine Solutions
 
Play with Angular JS
Play with Angular JSPlay with Angular JS
Play with Angular JS
Knoldus Inc.
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
Mallikarjuna G D
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
Emiliano Pecis
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
Oleg Tsal-Tsalko
 
Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)
Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)
Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)
Alexandre Dutra
 

What's hot (20)

Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7Building Java Desktop Apps with JavaFX 8 and Java EE 7
Building Java Desktop Apps with JavaFX 8 and Java EE 7
 
Spring Up Your Graph
Spring Up Your GraphSpring Up Your Graph
Spring Up Your Graph
 
Introduction to Vaadin
Introduction to VaadinIntroduction to Vaadin
Introduction to Vaadin
 
9 design factors for cloud applications
9 design factors for cloud applications9 design factors for cloud applications
9 design factors for cloud applications
 
JavaFX Enterprise
JavaFX EnterpriseJavaFX Enterprise
JavaFX Enterprise
 
Spring Mvc,Java, Spring
Spring Mvc,Java, SpringSpring Mvc,Java, Spring
Spring Mvc,Java, Spring
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Building cloud native microservices
Building cloud native microservicesBuilding cloud native microservices
Building cloud native microservices
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
Surat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime FabricSurat MuleSoft Meetup#2 - Anypoint Runtime Fabric
Surat MuleSoft Meetup#2 - Anypoint Runtime Fabric
 
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
Mobicents JSLEE progress and roadmap - Mobicents Summit 2011
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
 
Spring jdbc dao
Spring jdbc daoSpring jdbc dao
Spring jdbc dao
 
Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012Alfresco Integrations - Alfresco Devcon 2012
Alfresco Integrations - Alfresco Devcon 2012
 
성공적인 서비스로의 플랫폼 선택
성공적인 서비스로의 플랫폼 선택성공적인 서비스로의 플랫폼 선택
성공적인 서비스로의 플랫폼 선택
 
Play with Angular JS
Play with Angular JSPlay with Angular JS
Play with Angular JS
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
 
The RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with OracleThe RESTful Soa Datagrid with Oracle
The RESTful Soa Datagrid with Oracle
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
 
Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)
Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)
Staying Ahead of the Curve with Spring and Cassandra 4 (SpringOne 2020)
 

Similar to S03 hybrid app_and_gae_datastore_v1.0

Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
IMC Institute
 
Introduction to Datastore
Introduction to DatastoreIntroduction to Datastore
Introduction to Datastore
Software Park Thailand
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
PyCon India 2010 Building Scalable apps using appengine
PyCon India 2010 Building Scalable apps using appenginePyCon India 2010 Building Scalable apps using appengine
PyCon India 2010 Building Scalable apps using appengine
Pranav Prakash
 
JavaEE Spring Seam
JavaEE Spring SeamJavaEE Spring Seam
JavaEE Spring Seam
Carol McDonald
 
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
IndicThreads
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
RapidValue
 
Oleksandr Tolstykh
Oleksandr TolstykhOleksandr Tolstykh
Oleksandr Tolstykh
CodeFest
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi Style
Felix Meschberger
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleFelix Meschberger
 
RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...
RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...
RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...
jpalley
 
Easy ORMness with Objectify-Appengine
Easy ORMness with Objectify-AppengineEasy ORMness with Objectify-Appengine
Easy ORMness with Objectify-Appengine
Meetu Maltiar
 
Easy ORMness with Objectify-Appengine
Easy ORMness with Objectify-AppengineEasy ORMness with Objectify-Appengine
Easy ORMness with Objectify-Appengine
Inphina Technologies
 
Android best practices
Android best practicesAndroid best practices
Android best practices
Jose Manuel Ortega Candel
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
Skills Matter
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
David Chandler
 
Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J) Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J)
Lars Vogel
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
Subin Sugunan
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
Mark Rees
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
Eyal Vardi
 

Similar to S03 hybrid app_and_gae_datastore_v1.0 (20)

Java Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : DatastoreJava Web Programming on Google Cloud Platform [2/3] : Datastore
Java Web Programming on Google Cloud Platform [2/3] : Datastore
 
Introduction to Datastore
Introduction to DatastoreIntroduction to Datastore
Introduction to Datastore
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
PyCon India 2010 Building Scalable apps using appengine
PyCon India 2010 Building Scalable apps using appenginePyCon India 2010 Building Scalable apps using appengine
PyCon India 2010 Building Scalable apps using appengine
 
JavaEE Spring Seam
JavaEE Spring SeamJavaEE Spring Seam
JavaEE Spring Seam
 
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
Easy ORM-ness with Objectify-Appengine - Indicthreads cloud computing confere...
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
 
Oleksandr Tolstykh
Oleksandr TolstykhOleksandr Tolstykh
Oleksandr Tolstykh
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi Style
 
Declarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi StyleDeclarative Services - Dependency Injection OSGi Style
Declarative Services - Dependency Injection OSGi Style
 
RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...
RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...
RailsConf 2010: From 1 to 30 - How to refactor one monolithic application int...
 
Easy ORMness with Objectify-Appengine
Easy ORMness with Objectify-AppengineEasy ORMness with Objectify-Appengine
Easy ORMness with Objectify-Appengine
 
Easy ORMness with Objectify-Appengine
Easy ORMness with Objectify-AppengineEasy ORMness with Objectify-Appengine
Easy ORMness with Objectify-Appengine
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
Apache Aries Blog Sample
Apache Aries Blog SampleApache Aries Blog Sample
Apache Aries Blog Sample
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
 
Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J) Google App Engine for Java (GAE/J)
Google App Engine for Java (GAE/J)
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
 
Wcf data services
Wcf data servicesWcf data services
Wcf data services
 

More from Sun-Jin Jang

S01 gae and_hybrid_app_v1.0
S01 gae and_hybrid_app_v1.0S01 gae and_hybrid_app_v1.0
S01 gae and_hybrid_app_v1.0
Sun-Jin Jang
 
S04 hybrid app_and_gae_management_v1.0
S04 hybrid app_and_gae_management_v1.0S04 hybrid app_and_gae_management_v1.0
S04 hybrid app_and_gae_management_v1.0
Sun-Jin Jang
 
N03 app engineseminar
N03 app engineseminarN03 app engineseminar
N03 app engineseminarSun-Jin Jang
 
N02 app engineseminar
N02 app engineseminarN02 app engineseminar
N02 app engineseminarSun-Jin Jang
 
N01 cloud computing_and_gae
N01 cloud computing_and_gaeN01 cloud computing_and_gae
N01 cloud computing_and_gaeSun-Jin Jang
 
N04 xmpp and_android
N04 xmpp and_androidN04 xmpp and_android
N04 xmpp and_androidSun-Jin Jang
 
Google App Engine의 이해
Google App Engine의 이해Google App Engine의 이해
Google App Engine의 이해
Sun-Jin Jang
 

More from Sun-Jin Jang (7)

S01 gae and_hybrid_app_v1.0
S01 gae and_hybrid_app_v1.0S01 gae and_hybrid_app_v1.0
S01 gae and_hybrid_app_v1.0
 
S04 hybrid app_and_gae_management_v1.0
S04 hybrid app_and_gae_management_v1.0S04 hybrid app_and_gae_management_v1.0
S04 hybrid app_and_gae_management_v1.0
 
N03 app engineseminar
N03 app engineseminarN03 app engineseminar
N03 app engineseminar
 
N02 app engineseminar
N02 app engineseminarN02 app engineseminar
N02 app engineseminar
 
N01 cloud computing_and_gae
N01 cloud computing_and_gaeN01 cloud computing_and_gae
N01 cloud computing_and_gae
 
N04 xmpp and_android
N04 xmpp and_androidN04 xmpp and_android
N04 xmpp and_android
 
Google App Engine의 이해
Google App Engine의 이해Google App Engine의 이해
Google App Engine의 이해
 

Recently uploaded

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 

Recently uploaded (20)

Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 

S03 hybrid app_and_gae_datastore_v1.0

  • 1.
  • 2.
  • 3. CAP and ACID CAP  정합성(Consistency). The client perceives that a set of operations has occurred all at once. 가용성(Availability). Every operation must terminate in an intended response. 단절내성(Partition tolerance). Operations will complete, even if individual components are unavailable. ACID 원자성(Atomicity). All of the operations in the transaction will complete, or none will. 일관성(Consistency). The database will be in a consistent state when the transaction begins and ends. 고립성(Isolation). The transaction will behave as if it is the only operation being performed upon the database. 지속성(Durability). Upon completion of the transaction, the operation will not be reversed. http://queue.acm.org/detail.cfm?id=1394128
  • 4. Google BigTable System BigTable Master Server Chubby Server Tablet Server #2 Tablet Server #1 MapReduce Worker #2 MapReduce Worker #1 GFS #2 GFS #1
  • 5. Google BigTable Architecture GAE Application DataNucleus ORM (JDO or JPA Implementation) Low Level API Datastore Meta 0 tablet Big Table Meta 1 tablet Meta 1 tablet Meta 1 tablet Tab 1 Tab 2 Tab 3 Tab 4 Tab n GFS(Google File System)
  • 6. Google BigTable Dynamic control over Data Layout and Format Not support a full Relational Model Dynamic control over serving data from memory or disk Column oriented The map is indexed by A row key A column name A timestamp BigTable Key TimeStamp / Version Columns Index
  • 7. LDAP(Lightweight Directory Access Protocol) The Lightweight Directory Access Protocol (LDAP) is an application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. Directory services may provide any organized set of records, often with a hierarchical structure, such as a corporate electronic mail directory. Similarly, a telephone directory is a list of subscribers with an address and a phone number.
  • 8. Google App Engine Product Roadmap Features on Deck App Engine out of Preview SSL access on custom domains Full-text search over Datastore Support for Python 2.7 Support for running MapReduce jobs across App Engine datasets Bulk Datastore Import and Export tool Improved monitoring and alerting of application serving Logging system improvements to remove limits on size and storage Integration with Google Storage for Developer
  • 9. DataStore의 제약사항 Write가 느림 검색 가능한 Text 사이즈: 500 자 Entity 최대 사이즈: 1Mb 최대 Batch (save/delete) : 500 Entity SQL을 사용할 수 없음 데이터베이스의 제약조건을 적용할 수 없음 Aggregation 함수를 지원하지 않음 (count, avg) 쿼리가 최대 조회 레코드: 2000 쿼리에서 Equal 연산 이외의 조건은 1개만 추가 가능 트랜잭션의 단위는 Entity Group에 한정 됨
  • 10. Datastore API and ORM API
  • 11. Datastore API(Low Level API) 모든 Entity는 Kind가 지정 Entity는 하나이상의 Property를 포함 특정 Kind에포함된 Entity는 동일한 Property를 갖지 않음 Entity의 Property는 이름은 동일하지만 데이터 유형이 다를수 있음 Schemaless의 특성 ID는 지정하지 않을 경우 자동 할당 됨
  • 12. Entity App Engine Datastore에서 관리하는 객체는 Entity Entity는 하나의 Key를 포함 모든 Entity 중 유일한 구분자 Key 의 구성 Path Parent Entity의 key Entity의 Kind Entity에 할당된 이름 App이 할당한 값 Datastore가 지정한 numeric ID 지원 데이터 타임 integers, floating point values, strings, dates, binary data 등 각 엔티티는 하나이상의 Property를 포함 하나의 Property에 복수의 데이터 타입 저장 가능 하나의 Property에는 복수의 값이 저장 가능 복수의 값들의 데이터 유형은 다를 수 있음
  • 13. Entity Model Settings Kind : Table Key : Primary Key Entity Group : Partitioning Property : column
  • 14. Entity Example(Create) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService();Entity employee = new Entity("Employee");employee.setProperty("firstName", "Antonio");employee.setProperty("lastName", "Salieri");Date hireDate = new Date();employee.setProperty("hireDate", hireDate);employee.setProperty("attendedHrTraining", true);datastore.put(employee);
  • 15. Entity Example(Scheme Free) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService();Entity employee = new Entity("Employee");employee.setProperty("firstName", “Sun-Jin");datastore.put(employee);
  • 16. Entity Group Entity Group는 부모 Entity를 갖는 Entity의 Group 하나의 트랜잭션에서 여러 Entity를 조회, 생성, 수정, 삭제 할 수 가능하지만 그 범위는 단일 Entity Group에 국한 부모 Entity 를 가지 않은 Entity 를 Root Entity라고 함 Entity Group은 하나의 Root Entity와 Child Entity로 구성 하나의 EntityGroup은 동일한 분산 네트웍 서버에 저장됨 (Tablet 서버)
  • 17. Entity Group Entity Group Root Entity (xxxx) Child Entity (xxxxyyyy) Child Entity (xxxxyyyyzzzz)
  • 18. Entity Example(Read) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Key rootKey = KeyFactory.createKey("Employee", “CEO"); Entity employee = datastore.get(rootKey);
  • 19. Entity Example(Update) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Key rootKey = KeyFactory.createKey("Employee", “CEO"); Entity employee = datastore.get(rootKey); employee.setProperty("firstName", “Sun-Jin");employee.setProperty("lastName", “Jang");datastore.put(employee);
  • 20. Entity Example(Delete) import java.util.Date;import com.google.appengine.api.datastore.DatastoreService;import com.google.appengine.api.datastore.DatastoreServiceFactory;import com.google.appengine.api.datastore.Entity;// ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Key rootKey = KeyFactory.createKey("Employee", “CEO"); Entity employee = datastore.get(rootKey);datastore.delete(employee);
  • 21. Entity Example(Query) // ...DatastoreServicedatastore = DatastoreServiceFactory.getDatastoreService(); Query q = new Query(”employee") q.addFilter("lastName", Query.FilterOperator.EQUAL, lastNameParam); q.addFilter("height", Query.FilterOperator.LESS_THAN, maxHeightParam); PreparedQuerypq = datastore.prepare(q); for (Entity result : pq.asIterable()) { String firstName = (String) result.getProperty("firstName"); String lastName = (String) result.getProperty("lastName"); Long height = (Long) result.getProperty("height"); }
  • 23. DataNucleus DataNucleus attempts to make the whole process of persisting data a transparent process. The idea revolves around the developer having a series of Java classes that need persisting. http://www.datanucleus.org/products/accessplatform/development_process.html
  • 24. JDO Model Define(Annotation) import javax.jdo.annotations.PersistenceCapable;@PersistenceCapablepublic class Employee {    @PrimaryKey    @Persistent(valueStrategy= IdGeneratorStrategy.IDENTITY)    private Key key;     @Persistent    private String firstName;    @Persistent    private String lastName;    @Persistent    private Date hireDate; }
  • 25. JDO Model Define(Annotation) import javax.jdo.annotations.PersistenceCapable; // …@PersistenceCapablepublic class Employee {    @PrimaryKey    @Persistent(valueStrategy= IdGeneratorStrategy.IDENTITY)    private Key key;     @Persistent    private String firstName;    @Persistent    private String lastName;    @Persistent    private Date hireDate; }
  • 26. JDO Model(Create)         PersistenceManager pm = PMF.get().getPersistenceManager();        Employee e = new Employee("Alfred", "Smith", new Date());        try {            pm.makePersistent(e);        } finally {            pm.close();        }
  • 27. JDO Model(Update) public void updateEmployeeTitle(User user, String newTitle) {    PersistenceManager pm = PMF.get().getPersistenceManager();    try {        Employee e = pm.getObjectById(Employee.class, “Sun-Jin”);        if (titleChangeIsAuthorized(e, newTitle) {            e.setTitle(newTitle);        } else {            throw new UnauthorizedTitleChangeException(e, newTitle);        }    } finally {        pm.close();    }}
  • 28. JDO Model(Delete) public void updateEmployeeTitle(User user, String newTitle) {    PersistenceManager pm = PMF.get().getPersistenceManager();    try {        Employee e = pm.getObjectById(Employee.class, “Sun-Jin”);         pm.deletePersistent(e);     } finally {        pm.close();    }}
  • 29. JDO Model(Query) import java.util.List;import javax.jdo.Query;// ...    Query query = pm.newQuery(Employee.class);    query.setFilter("lastName == lastNameParam");    query.setOrdering("hireDatedesc");    query.declareParameters("String lastNameParam");    try {        List<Employee> results = (List<Employee>) query.execute("Smith");        if (!results.isEmpty()) {            for (Employee e : results) {                // ...            }        } else {            // ... no results ...        }    } finally {        query.closeAll();    }
  • 30. Demo