Apache Usergrid

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(RPC)
(图集)
 
(未显示1个用户的37个中间版本)
第1行: 第1行:
 
Apache Usergrid 是一个面向web和移动应用的多租户 [[Mobile Backend as a service|Backend-as-a-Service]] 堆栈,基于 RESTful APIs,使用 [[Apache Cassandra]] 做后端存储。
 
Apache Usergrid 是一个面向web和移动应用的多租户 [[Mobile Backend as a service|Backend-as-a-Service]] 堆栈,基于 RESTful APIs,使用 [[Apache Cassandra]] 做后端存储。
 +
 +
==简介==
 +
Apache Usergrid — the BaaS not made for Hipsters
 +
 +
==新闻==
 +
*[https://cloud.google.com/blog/products/apigee/we-are-sunsetting-apigee-api-baas Google is sunsetting the Apache Usergrid based API BaaS service] (May 18, 2018)
  
 
==版本==
 
==版本==
第8行: 第14行:
  
 
==应用对象==
 
==应用对象==
Usergrid提供了一组核心应用程序对象,主要实现了对用户的管理以及对交互性的增强、通过自由的数据存储系统存储数据、检索以及返回任何类型的内容和对象集合等。Usergrid也提供了对日志数据的支持,这使得实时事件分析和关键指标的跟踪成为可能,这块可考虑由[[OpenTSDB]]提供服务。
+
Usergrid提供了一组核心应用程序对象,主要实现了对用户的管理以及对交互性的增强、通过自由的数据存储系统存储数据、检索以及返回任何类型的内容和对象集合等。Usergrid也提供了对日志数据的支持,这使得实时事件分析和关键指标的跟踪成为可能,这块可考虑由[[KairosDB]]提供服务。
  
 
应用对象(Data Entity Types)包括:
 
应用对象(Data Entity Types)包括:
第27行: 第33行:
  
 
所提及的消息(message)概念是以notifier、notification、receipt数据实体类型体现。
 
所提及的消息(message)概念是以notifier、notification、receipt数据实体类型体现。
 +
 +
[https://usergrid.apache.org/docs/rest-endpoints/api-docs.html#models Usergrid 默认实体数据模型]
  
 
==Activity Streams==
 
==Activity Streams==
第47行: 第55行:
  
 
集成[[Apache Kafka]]
 
集成[[Apache Kafka]]
 +
 +
==Spring==
 +
[[Spring]]承担了[https://github.com/apache/usergrid/search?p=4&q=spring&unscoped_q=spring Usergrid核心框架]的重任。
  
 
==REST API==
 
==REST API==
 +
*[https://github.com/apache/usergrid/tree/master/stack/rest Usergrid REST API Web App]
 +
*[https://issues.apache.org/jira/browse/USERGRID-812 REST API v2]
 
*Usergrid REST API 构建在 [[Jersey]] 之上。
 
*Usergrid REST API 构建在 [[Jersey]] 之上。
 
*[http://code.huihoo.com/huihoo/mbaas/issues/17 Jersey @ Usergrid]
 
*[http://code.huihoo.com/huihoo/mbaas/issues/17 Jersey @ Usergrid]
 
*[[Jackson]] 处理 [[JSON]] 数据。
 
*[[Jackson]] 处理 [[JSON]] 数据。
 +
 +
==服务层==
 +
*[https://github.com/apache/usergrid/tree/master/stack/services Usergrid Services Layer]
 +
*用户和组权限建立在[[Apache Shiro]]之上。
  
 
==SDK==
 
==SDK==
 +
===Dart & Flutter===
 +
 
===iOS===
 
===iOS===
目前基于[[Objective-C]],希望以后提供[[Swift]]SDK。
+
*[https://github.com/apache/usergrid/tree/master/sdks/swift Swift SDK]
 +
*[https://github.com/apache/usergrid/tree/master/sdks/ios Objective-C SDK]
  
 
===Android===
 
===Android===
 +
[https://github.com/apache/usergrid-android Android SDK]
  
 
===H5/JS===
 
===H5/JS===
 +
[https://github.com/apache/usergrid-javascript JavaScript SDK]
  
 
===Node.js===
 
===Node.js===
 +
[https://github.com/apache/usergrid-nodejs usergrid-nodejs]
  
 
==Go==
 
==Go==
第67行: 第90行:
 
* 集成 Go 提供的高并发处理基础设施。
 
* 集成 Go 提供的高并发处理基础设施。
  
==权限==
+
==Scala==
*用户和组权限建立在[[Apache Shiro]]之上。
+
集成 [[Scala]]
 +
 
 +
==Clojure==
 +
集成 [[Clojure]]
  
 
==安装==
 
==安装==
 +
*[https://usergrid.apache.org/docs/installation/deployment-guide.html Usergrid 2.1.0 Deployment Guide]
 +
*[https://usergrid.apache.org/docs/installation/ug1-deploy-to-tomcat.html Usergrid 1.x Deployment Guide]
 
*[http://code.huihoo.com/huihoo/mbaas/issues/3 Usergrid安装部署]
 
*[http://code.huihoo.com/huihoo/mbaas/issues/3 Usergrid安装部署]
  
 
==指南==
 
==指南==
确保已正确安装 [[Apache Cassandra]],[https://github.com/apache/usergrid/releases 下载usergrid包并解压]
+
* [https://github.com/apache/usergrid/releases/tag/usergrid-2.1.0 Usergrid 2.x]
 +
* [https://github.com/apache/usergrid/releases/tag/usergrid-1.0.2 Usergrid 1.x] 
 +
确保已正确安装 [[Apache Cassandra]],[https://github.com/apache/usergrid/releases 下载usergrid包并解压] 或[http://mirror.bit.edu.cn/apache/usergrid/usergrid-2/v2.1.0/ 直接下载二进制压缩包],[https://usergrid.apache.org/docs/installation/deployment-guide.html 参考Usergrid 2.1.0安装部署]。此外,[https://usergrid.apache.org/docs/installation/ug1-deploy-to-tomcat.html Usergrid 1.x安装部署]。
 +
cd sdks/java
 +
mvn clean install
 
  cd stack
 
  cd stack
 
  mvn clean package -DskipTests=true
 
  mvn clean package -DskipTests=true
  cd launcher; java -jar target/usergrid-launcher-*.jar
+
  //cd launcher; java -jar target/usergrid-launcher-*.jar // Usergrid 1.x 版本
 +
cp stack/rest/target/ROOT.war 到 tomcat7/webapps 然后完成下面配置并重启。
 
  curl http://localhost:8080/status  
 
  curl http://localhost:8080/status  
 
  curl -X POST  \
 
  curl -X POST  \
第97行: 第130行:
 
数据库设置
 
数据库设置
 
  http://localhost:8080/system/database/setup
 
  http://localhost:8080/system/database/setup
 +
curl -X PUT http://localhost:8080/system/database/setup    -u superuser:test
 +
curl -X PUT http://localhost:8080/system/database/bootstrap -u superuser:test
 +
curl -X GET http://localhost:8080/system/superuser/setup    -u superuser:test
 
管理员设置
 
管理员设置
 
  http://localhost:8080/system/superuser/setup
 
  http://localhost:8080/system/superuser/setup
 
控制台, 配置文件 usergrid-custom.properties  
 
控制台, 配置文件 usergrid-custom.properties  
 
  http://localhost:8080/usergrid-portal
 
  http://localhost:8080/usergrid-portal
 +
单独运行一个轻量server
 +
cd portal
 +
./build.sh dev
 +
http://localhost:3000/index-debug.html
 +
http://localhost:3000/
  
 
==部署方式==
 
==部署方式==
 +
*[https://github.com/apache/usergrid/tree/master/deployment/aws AWS Cluster]
 
*Apache HTTPD, [https://usergrid.apache.org/docs/installation/deployment-guide.html?highlight=tomcat Tomcat]
 
*Apache HTTPD, [https://usergrid.apache.org/docs/installation/deployment-guide.html?highlight=tomcat Tomcat]
 
*[[Nginx]] + [[Jetty]]
 
*[[Nginx]] + [[Jetty]]
第110行: 第152行:
  
 
==Cassandra==
 
==Cassandra==
[[Apache Cassandra]] 提供[https://usergrid.apache.org/docs/search.html?q=cassandra&check_keywords=yes&area=default 存储服务]
+
*[[Apache Cassandra]] 提供[https://usergrid.apache.org/docs/search.html?q=cassandra&check_keywords=yes&area=default 存储服务]
 +
*使用[https://github.com/netflix/astyanax Netflix Astyanax] Cassandra Java Client
 +
 
 +
==集群==
 +
*[[Hazelcast]]
  
 
==性能==
 
==性能==
 
*[https://blogs.apache.org/usergrid/entry/usergrid_10k_part1 Scaling Usergrid to over 10,000 requests/second - Part 1] 10,268 Requests Per Second with 35 c3.xlarge Usergrid servers and 9 c3.4xlarge Cassandra nodes.  
 
*[https://blogs.apache.org/usergrid/entry/usergrid_10k_part1 Scaling Usergrid to over 10,000 requests/second - Part 1] 10,268 Requests Per Second with 35 c3.xlarge Usergrid servers and 9 c3.4xlarge Cassandra nodes.  
 
*引入[[Akka]]高并发框架。
 
*引入[[Akka]]高并发框架。
 +
 +
==Akka==
 +
[https://github.com/apache/usergrid/tree/release-2.1.1 Apache Usergrid 2.1.1]在[https://github.com/apache/usergrid/tree/9b12299cc46a0143bd9a646ee7031c61669b1718/stack/corepersistence corepersistence持久化框架]中引入[[Akka]] actorsystem
  
 
==RPC==
 
==RPC==
第123行: 第172行:
  
 
==开发者==
 
==开发者==
*Usergrid Creator, [http://anuff.com Ed Anuff]
+
*Usergrid Creator, [http://anuff.com Ed Anuff], [http://docs.huihoo.com/apache/usergrid/Open-Source-Mobile-Backend-on-Cassandra.pdf Open Source Mobile Backend on Cassandra] [https://github.com/edanuff @GitHub]
 +
*[[Apache Usergrid/developer|开发者]]
  
 
==用户==
 
==用户==
第137行: 第187行:
 
*[http://docs.huihoo.com/apache/usergrid/Apache-Usergrid-Internals.pdf Apache Usergrid Internals]
 
*[http://docs.huihoo.com/apache/usergrid/Apache-Usergrid-Internals.pdf Apache Usergrid Internals]
 
*[http://docs.huihoo.com/apache/usergrid/Open-Source-Mobile-Backend-on-Cassandra.pdf Open Source Mobile Backend on Cassandra]
 
*[http://docs.huihoo.com/apache/usergrid/Open-Source-Mobile-Backend-on-Cassandra.pdf Open Source Mobile Backend on Cassandra]
 +
*[http://docs.huihoo.com/apache/cassandra/Cassandra-Data-Modeling-Best-Practices-at-eBay.pdf Cassandra Data Modeling Best Practices at eBay] [http://docs.huihoo.com/apache/cassandra/Cassandra-at-eBay.pdf Cassandra at eBay] [http://docs.huihoo.com/apache/cassandra/planetcassandra/Cassandra-at-eBay-Scale.pdf Cassandra Scale at eBay]
  
 
==图集==
 
==图集==
 
<gallery>
 
<gallery>
image:mbaas-architecture.png|架构
+
image:mbaas-architecture.png|容器架构
 
image:mbaas-multi-tenancy-on-cassandra.png|Cassandra
 
image:mbaas-multi-tenancy-on-cassandra.png|Cassandra
 
image:usergrid-launcher.png|Launcher
 
image:usergrid-launcher.png|Launcher
 
image:apache-usergrid-service.png|Service架构
 
image:apache-usergrid-service.png|Service架构
 +
image:Apache-Usergrid-iOS-App.png|iOS App
 
image:apache-usergrid-core.png|Core架构
 
image:apache-usergrid-core.png|Core架构
 
image:apache-usergrid-portal.jpg|控制台
 
image:apache-usergrid-portal.jpg|控制台
第152行: 第204行:
 
==链接==
 
==链接==
 
*[https://usergrid.apache.org Apache Usergrid官网]
 
*[https://usergrid.apache.org Apache Usergrid官网]
 +
*[https://github.com/apache/usergrid Apache Usergrid @ GitHub]
 
*[http://docs.huihoo.com/apache/usergrid Apache Usergrid文档]
 
*[http://docs.huihoo.com/apache/usergrid Apache Usergrid文档]
  
第157行: 第210行:
 
[[category:REST]]
 
[[category:REST]]
 
[[category:apache]]
 
[[category:apache]]
 +
[[category:spring]]
 
[[category:huihoo]]
 
[[category:huihoo]]

2021年1月30日 (六) 02:19的最后版本

Apache Usergrid 是一个面向web和移动应用的多租户 Backend-as-a-Service 堆栈,基于 RESTful APIs,使用 Apache Cassandra 做后端存储。

目录

[编辑] 简介

Apache Usergrid — the BaaS not made for Hipsters

[编辑] 新闻

[编辑] 版本

new "core persistence" engine in Usegrid 2.1 has been under development for two years now. Internally, this new engine provides a set of new modules for Entity Collections, Graph database, Maps, Query-Index, Queues and Caching. The core persistence design favors simple and composable operations that can be made asynchronous via RxJava, uses Multi-Version Concurrency Control (MVCC) to avoid use of locks and the Query-Index module relies on Elasticsearch.

  • 2.0
  • 1.0

[编辑] 应用对象

Usergrid提供了一组核心应用程序对象,主要实现了对用户的管理以及对交互性的增强、通过自由的数据存储系统存储数据、检索以及返回任何类型的内容和对象集合等。Usergrid也提供了对日志数据的支持,这使得实时事件分析和关键指标的跟踪成为可能,这块可考虑由KairosDB提供服务。

应用对象(Data Entity Types)包括:

  • 用户(user)
  • 用户组(group)
  • 角色(role)
  • 应用(application)
  • 行为(activity)
  • 设备(device)
  • 资源(asset)
  • 目录(folder)
  • 事件(event)
  • 通知(notifier)
  • 通告(notification)
  • 收到(receipt)

每个对象都被保存在其各自的集合中(/users,/groups……)。Usergrid也允许创建用户想要的任何类型的动态(自定义的)实体。动态实体会被自动保存在以实体类型复数为名称的集合中。

所提及的消息(message)概念是以notifier、notification、receipt数据实体类型体现。

Usergrid 默认实体数据模型

[编辑] Activity Streams

Activity是一个代表Activity Stream actions的实体类型。

Activity Streams 用来描述一个社交网络中的个体的一系列活动。比如 Facebook 的 News Feed(新鲜事)就是一条 Activity Streams 消息。目前 Activity Streams 已经成了 OpenSocial 的标准数据格式并被广泛地支持。Activity Streams entry 元素总是包含三个主元素,它们分别是:actor,即执行动作的人,例如:DoctorWang;verb,即执行的动作类型,例如:admit;object,即动作所针对的对象,例如用户 John。

JSON Activity Streams 1.0

[编辑] 授权

Usergrid的API实现了OAuth 2.0的授权模型,所有的请求都需要带有有效的访问令牌。

[编辑] 消息

Usergrid提供了一个消息队列服务,该服务为保证高扩展性的同时向应用中分发消息所设计。此外为了使消息队列服务具备一定的灵活性,还将会增加客户通知、社交收件箱、内容源、评论功能以及其他一些常见的消息队列操作。该框架支持使用Websocket来进行实时处理。

集成RabbitMQ

集成Apache Kafka

[编辑] Spring

Spring承担了Usergrid核心框架的重任。

[编辑] REST API

[编辑] 服务层

[编辑] SDK

[编辑] Dart & Flutter

[编辑] iOS

[编辑] Android

Android SDK

[编辑] H5/JS

JavaScript SDK

[编辑] Node.js

usergrid-nodejs

[编辑] Go

  • 基于REST API,支持 Go 语言,提供 Go SDK。
  • 集成 Go 提供的高并发处理基础设施。

[编辑] Scala

集成 Scala

[编辑] Clojure

集成 Clojure

[编辑] 安装

[编辑] 指南

确保已正确安装 Apache Cassandra下载usergrid包并解压直接下载二进制压缩包参考Usergrid 2.1.0安装部署。此外,Usergrid 1.x安装部署

cd sdks/java
mvn clean install
cd stack
mvn clean package -DskipTests=true
//cd launcher; java -jar target/usergrid-launcher-*.jar // Usergrid 1.x 版本
cp stack/rest/target/ROOT.war 到 tomcat7/webapps 然后完成下面配置并重启。
curl http://localhost:8080/status 
curl -X POST  \
        -d 'organization=myfirstorg&username=myadmin&name=Admin&[email protected]&password=password' \
        http://localhost:8080/management/organizations
curl 'http://localhost:8080/management/token?grant_type=password&username=myadmin&password=password' 

你也能以 tomcat webapp 的方式运行, 移除 tomcat/webapps/ROOT 下的内容,将 usergird/rest/ROOT.war 拷贝到这

cd tomcat/lib 创建 ____usergrid-custom.properties____

usergrid.sysadmin.login.allowed=true
usergrid.sysadmin.login.name=superuser
usergrid.sysadmin.login.password=pw123
[email protected]
[email protected]
usergrid.management.mailer=Myself<[email protected]>
[email protected]
usergrid.test-account.admin-user.password=test

数据库设置

http://localhost:8080/system/database/setup
curl -X PUT http://localhost:8080/system/database/setup     -u superuser:test
curl -X PUT http://localhost:8080/system/database/bootstrap -u superuser:test
curl -X GET http://localhost:8080/system/superuser/setup    -u superuser:test

管理员设置

http://localhost:8080/system/superuser/setup

控制台, 配置文件 usergrid-custom.properties

http://localhost:8080/usergrid-portal

单独运行一个轻量server

cd portal
./build.sh dev
http://localhost:3000/index-debug.html
http://localhost:3000/

[编辑] 部署方式

[编辑] Elasticsearch

Elasticsearch 提供查询服务

[编辑] Cassandra

[编辑] 集群

[编辑] 性能

[编辑] Akka

Apache Usergrid 2.1.1corepersistence持久化框架中引入Akka actorsystem

[编辑] RPC

[编辑] 开发者

[编辑] 用户

[编辑] 文档

[编辑] 图集

[编辑] 链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱