Más contenido relacionado
La actualidad más candente (20)
Similar a AWS微服務時代-無伺服器時代的區塊鏈應用_Decore 馮彥文 (20)
Más de Amazon Web Services (20)
AWS微服務時代-無伺服器時代的區塊鏈應用_Decore 馮彥文
- 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1
- 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
區塊鏈資料分析公司
- 將鏈上與交易所交易整理為會計資料
- 幣安孵化器
2
馮彥文
- fb.me/tempofeng
- 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
從 Server 到 Serverless
Gamelet
Tomcat /
Colocation /
MySQL
3
2011 2014 2016
Cubie
WAR /
EC2 /
Cassandra
Komma Space
WAR /
Elastic Beanstalk /
DynamoDB
Decore
Java,Kotlin,Typescript /
Lambda /
DynamoDB
- 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Ethereum Blockchain Data > 200G
4
• 資料存取速度
• 帳戶資料多寡不平衡
• 架構越簡單越好
• DynamoDB
• Lambda
- 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
MySQL > NoSQL
5
- 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Gamelet:Facebook 平台遊戲
6
Colocation
從 MySQL 轉換到 NoSQL
- 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
因 Alter table 停機一天半
7
從 MySQL 轉換到 NoSQL
- 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
為什麼要用 DynamoDB (或是其他的 nosql 資料庫)?
1. 不需要設計 data schema
2. 可一直橫向擴充,不需 Sharding(分片)
3. 不管資料大小,讀取或寫入都是接近固定的時間
8
- 9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
用「需要事先規劃的 Query」換取「固定的存取速度」
9
可新增多筆
Global/Local
Secondary Index
- 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DynamoDB vs Relational Database
• DynamoDB 資料存取是固定時間
• RDBMS Transaction 比 DynamoDB Transaction 靈活
• DynamoDB Index 只能使用一組 Hash Key 與 Sort Key,一次 Query 只能使用一組
Index
10
Department Name Age {Name, Age}
Engineering Tom Lee 42 {Tom Lee, 42}
Engineering Ann Chen 27 {Ann Chen, 27}
Marketing May Wu 41 {May Wu, 41}
Engineering Jack Chen 42 {Jack Chen, 42}
- 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
rockset.com
• Smart Schema (Index) + Hadoop
• Query returns in MS
11
Streaming ingest
Rockset
Write API
Bulk ingest
Schemaless ingest
No pipelines or ETL needed
Real-time indexing
Apps
Dashboards
SQL
- 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dedicate Servers >
Elastic Beanstalks >
Lambda
12
- 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Beanstalk > Lambda
13
Komma Space
WAR /
Elastic Beanstalk /
DynamoDB
Decore
Java,Kotlin,Typescript /
Lambda /
DynamoDB
- 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Beanstalk > Lambda
14
Two people team ……
- 非常容易部署
- 對小服務相當便宜
- 可擴展的架構 - 15 分鐘限制
- 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda Deployment
• Javascript, Typescript
• https://serverless.com/
• Java, Kotlin
• https://github.com/classmethod/gradle-aws-plugin
• https://github.com/tempofeng/lambda-local
15
- 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Stacks in Decore
16
Rest, GraphQL
Lambda DynamoDB
Step Functions
Lambda Lambda
Lambda
Rockset
Client App
- 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Cold Start
17
- 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you
18