下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Mongodb 在互联网金融的应用AgendaAbout KoalaWhy ? RequirementsHow ? ArchitectureProblemsSolutionsFutureWhat is P2PWhat is a P2P?P2P PlatformBorrowerLenderLenderLenderSingle LoanNoteNoteNoteLender :有钱人/投资人, Borrower:缺钱人/借款人 Note: 投资(凭证) Loan:借款标的(需求)Investing in multiple P2P?P2P PlatformBorrowerLenderLenderLen
2、derP2P PlatformBorrowerP2P PlatformBorrowerMultiple Loans Multiple Loans Multiple Loans Lender :有钱人/投资人, Borrower:缺钱人/借款人 Note: 投资(凭证) Loan:借款标的(需求)What is a P2P fund?P2P PlatformBorrowerLenderLenderLenderP2P PlatformBorrowerP2P PlatformBorrowerP2PFundMultiple LoansMultiple LoansMultiple LoansLender
3、 :有钱人/投资人, Borrower:缺钱人/借款人 Note: 投资(凭证) Loan:借款标的(需求) Fund:基金What is a P2P fund?P2P PlatformBorrowerLenderLenderLenderP2P PlatformBorrowerP2P PlatformBorrower考拉 理财Multiple LoansMultiple LoansMultiple LoansLender :有钱人/投资人, Borrower:缺钱人/借款人 Note: 投资(凭证) Loan:借款标的(需求) Fund:基金About KoalaTags: Finance ,
4、 P2P mashup,懒人 -通过极致的分散理财,达到风险&收益的平衡 正式上线:2015/5交易额:51+亿¥AUM:8+亿¥documents count: 千万 亿用户量:75万,同时在线: 1002,000About Koala投资策略 和管理系统风险监控模型和管理系统资产配置模型(源于高盛)基金财务系统用户管理系统System architectureTech StackMongodb(core) + Hadoop MySQLNodejs(Typescript), Python, R, Sql, Java(non core)Mongodb supports most of our
5、core systemsWhy? - Requirements for the marketLoans 稀疏多变Borrower 征信信息P2P platforms 稀疏多变市场需求(哪有不多变的需求)数据量多、N多维度统计要响应快Why? - Requirements for finance修改历史需要被保留 (不允许删除操作)操作要提供反操作,而不仅仅是简单的update备份,备份,备份安全演练Mongodb deploy architectureV1Mongodb deploy architectureV2Mongodb deploy architectureV3Mongodb depl
6、oy architectureV4Mongodb deploy architectureV5坑s:Ops & DevIssues ever met in opsIndex 不中,扫描过多比较耗内存Dev误操作程序连错db篡改数据误操作误删数据Issues ever solvedIndex 不中,扫描过多 - explain it + 慢查询分析: ensureindex比较耗内存 - 加内存吧,便宜的解决方案Dev误操作程序连错db篡改数据 - VPC & 区别开环境 & 做好权限控制误操作误删数据 - 延时节点!Oplog 恢复Security Summary角色限制: Administra
7、tor/Monitor/Read Write/Read Only不要用默认端口设置password给不同的password 区分开prod & dev env开发环境不允许连prod envBackup SummaryOplog 演练恢复到指定时间点Full backup Every 6 hoursDaily Backup within Recently 30 DaysDelay instance (1 hour) - 防止 replica set 实时污染第二个 DataCenter instanceIssues ever met in dev读写没分离压力 primary过大离线计算ETL
8、导致压力过大嵌套文档的数组长度过大“Schemaless”Issue ever solved in dev读写没分离压力 primary过大 - 读写分离离线计算ETL导致压力过大 - 读写分离 & 同步多一个DB用于计算嵌套文档的数组长度过大 - 设计注意考虑是否是不断增长、变化应用层or DB层限制Schema坑 s:part 2 Problems about TradingCrash while processingTransfer exampleA account 1000transfer 500¥B account 100Transfer example简单场景: account &
9、 trade are in the same DB system复杂场景: account & trade are in different service & DB System实际场景: Different Banks/SystemNeed Transaction?强一致性弱一致性Mongodb SolutionsEmbed documents优: Sometimes it works & make query faster缺: Sometimes it just doesnt workTwo phase commitMake code looks complicatedOther Sol
10、utionsMySQLMySQL (trade + account service) + Mongodb (other)PostgreSQLCassandraSequoiaDBHybrid alreadyRedis + MongodbRedis + MySQLHybrid Solution for Mysql & MongodbHybrid Solution ProblemsMaintainability: More ComplexForeign KeyJoin TablesSyncOthers Mongodb Only Solution: Events SourcingEvents Sour
11、cing : record every events and replay them after crashTrade offOur Solutions基于Embed docs 设计应用层(ORM) level:dev造了个轮子:mongoose-transact/mongoose-transtion-plugin/waterline-transactHow Transaction Is ImplementHow Transaction Is Implement in CodeUsage Sample CodeBest Practise for Account Trading(Common)可重入函数掉单检测:定时检查&重试单元测试注:支付异步回调会发生多次直到处理成功(限
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- GB/T 33391-2026鞋类化学试验方法多环芳烃(PAHs)的测定
- 2026年中学初二物理试题及答案
- 深度解析(2026)《GBT 30239-2013陶质文物彩绘保护修复技术要求》
- 2026年物理试题天体运动及答案
- DB4401-T 146.2-2022 食品快速检测工作规范 第2部分:日常检测
- 2026年中考语文总复习训练专题-病句
- 《DLT 1238-2013 1000kV交流系统用静电防护服装》(2026年)合规红线与避坑实操手册
- 2026年生鲜电商冷链仓储协议
- 2025北京朝阳区高三(上)期中英语试题及答案
- 纺织工程职业方向
- 2026年滁州凤阳大明旅游发展(集团)有限公司招聘导游员(讲解员)15名笔试备考题库及答案详解
- T∕SZSSIA 019-2026 反恐怖防范管理规范 总则
- 24J113-1 内隔墙-轻质条板(一)
- 药食同源食品管理办法实施细则
- 律师事务所内部惩戒制度
- 政治监督培训课件模板
- 桥架培训课件
- JT-T-760-2009浮标技术条件
- 陕西省西安市长安区2023-2024学年八年级下学期期中数学试题(含答案)
- 行政的使命目的和价值概述
- 人工智能改变网络支付方式
评论
0/150
提交评论