当前位置:网站首页>Three Solutions for SaaS Multi-tenant Data Isolation
Three Solutions for SaaS Multi-tenant Data Isolation
2022-07-30 04:45:00 【Technology experts, Felix】
Is zookeeper data stored in memory?
ZooKeeper allows distributed processes to coordinate with each other through a shared hierarchical namespace, which is organized like a standard file system.Namespaces consist of data registers - called znodes in ZooKeeper parlance - which are similar to files and directories.Unlike typical file systems designed for storage, ZooKeeper data is kept in memory, which means ZooKeeper can achieve high throughput and low latency numbers.
Which business scenarios use distributed locks?
Most Common Inventory Deductions
Deduction Inventory Steps:
- Check Inventory
- Determine whether it is out of stock
- Start deduction
The above three steps have thread safety problems in the case of high concurrency, so atomicity must be guaranteed
Cache breakdown/cache avalanche (distributed locks can also be used)
In high concurrency scenarios, prevent traffic from hitting the back, etc.
How to choose zk distributed lock and redis distributed lock?
Redis
In cluster redis, set the expiration time of the lock through setnx and expire, or setnx and getset to realize distributed lock;
- Advantages: Effectively solve single point problems, high performance, more convenient to implement;
- Disadvantages: setnx and expire cannot ensure transactions, a client is blocked for a long time and expires automatically,
Redlock: a distributed lock scheme designed by the author of redis
- Advantages: • High availability, most nodes are normal.• Distributed locks of a single Redis node no longer have the problem of lock failure during
failover. - Disadvantages: The design is more complicated, the personal implementation is more troublesome, it is best to borrow the library that has been implemented
(Redission...)
Zookeeper
- Advantages: Effectively solve single-point problems, non-reentrant problems, non-blocking problems and problems that locks cannot be released
The implementation is relatively simple - Disadvantages: The performance is not as good as the distributed lock implemented by using the cache, because every time in the process of creating and releasing the lock, it is necessary to dynamically create and destroy the temporary node to realize the lock function. It is necessary to understand the principle of Zookeeper
The choice of redis and zookeeper to implement distributed locks depends on the business, and neither method can be perfectly implemented.Just like CAP, complexity, reliability, performance, etc. cannot be satisfied at the same time. Therefore, it is the kingly way to choose the most suitable one according to different application scenarios.
- In terms of ease of understanding (low to high)
Database>Cache>Zookeeper - From an implementation complexity perspective (low to high)
Zookeeper >= cache> database - Performance Perspective (High to Low)
Cache> Zookeeper >= Database - From a reliability perspective (high to low)
Zookeeper > Cache > Database
Does adding distributed locks reduce inventory affect concurrency?How to ensure the success rate and oversold problems of virtual inventory?
Affects concurrency, the purpose of locks is to reduce concurrency to single-threaded access to inventory.
Oversold problem: Seckill solution
What does SaaSization mean?What do you need to consider when building a saas system?
Compared with traditional software, SaaS services rely on software and the Internet, and are different from traditional software from both technical and business perspectives.It is manifested in the following aspects:
Timeliness
SaaS services provide users with services in the form of Internet browser program connections, which make SaaS applications have the characteristics of typical Internet technologies and greatly shorten the time and space between users and SaaS providers.
Multi-tenancy
SaaS services typically serve hundreds of different customers (aka tenants) based on a standard software system.This requires SaaS services to be able to support the isolation of data and configuration between different tenants, so as to ensure the security and privacy of each tenant's data, as well as users' personalized requirements such as interface, business logic, and data structure.Since SaaS supports multiple tenants at the same time, each tenant may contain multiple users, which has high requirements on the performance, stability and scalability of the infrastructure platform supporting the software.
Services
SaaS enables software to be used by customers in the form of Internet-based services, so it is necessary to fully consider the signing of service contracts, the measurement of service usage, the guarantee of online service quality, and the collection of service fees.
SaaS is a business model for the delivery and use of software as a service over the Internet.Under the SaaS model, software users do not need to purchase additional hardware equipment, software licenses, and install and maintain software systems. They can easily use the software at any time and anywhere through an Internet browser and pay regularly according to usage.
- Multi-tenant data isolation?
The multi-tenancy problem, in simple terms, is an architectural design method, that is, a saas system running on one or a group of servers can provide services for multiple tenants (customers), in order to allow multiple tenantsUse the same set of programs in the Internet environment and ensure data isolation between tenants.From this pattern of architectural design, it is not difficult to see that the focus of multi-tenant architecture is the isolation of data from multiple tenants under the same set of programs.Since tenant data is stored centrally, the security of data depends on whether the isolation of tenant data can be achieved to prevent tenant data from being acquired and tampered with inadvertently or maliciously by others.
边栏推荐
- 【周周有奖】云原生编程挑战赛“边缘容器”赛道邀你来战!
- Discourse 自定义头部链接(Custom Header Links)
- QT(39)-vs development qt program prompts that the source file cannot be opened
- C. Qualification Rounds
- 解决报错SyntaxError: (unicode error) ‘utf-8‘ codec can‘t decode byte 0xb7 in position 0: invalid start b
- Get the local IP and Request's IP
- SaaS多租户数据隔离的三种解决方案
- Code open source design and implementation ideas
- Android Studio implements login registration - source code (connecting to MySql database)
- Perspective transformation matrix of image perspective correction should be matrix (single)/findHomography with getPerspectiveTransformd difference
猜你喜欢
![[Redis Master Cultivation Road] Jedis - the basic use of Jedis](/img/e3/0c6efd03432a01f857796f0bf648ef.png)
[Redis Master Cultivation Road] Jedis - the basic use of Jedis

解决报错SyntaxError: (unicode error) ‘utf-8‘ codec can‘t decode byte 0xb7 in position 0: invalid start b

Introduction to Thymeleaf

DAY17, CSRF vulnerability

BGP的简单实验

nSoftware.PowerShell.Server.2020

2.6 Merge Sort

Stimulsoft ReportsJS and DashboardsJS. 2022.3.3

A brief introduction to the SSM framework

Machine Learning: Knowing the Dimensionality Reduction Process Through Low Variance Filtering
随机推荐
Go study notes (84) - Go project directory structure
DAY17:弱口令的探测与测试
Shanxi group (enterprises) in the second network security skills competition part problem WP (8)
Shi Xingguo, founder of Hyperchain, was interviewed by 21st Century Business Herald to interpret Shanghai's new NFT regulations and digital development
[C language] Program environment and preprocessing
小程序 wx.miniProgram.navigateTo 跳转地址不能是tabbar地址
Solve the go environment can not compile exe
Stimulsoft ReportsJS and DashboardsJS. 2022.3.3
双指针问题(中)
山西省第二届网络安全技能大赛(企业组)部分赛题WP(八)
复现XXL-JOB 任务调度中心后台任意命令执行漏洞
《构建之法》笔记---第十章 典型用户和场景
六、读取应用配置+日志配置
2.5 Quick Sort
KubeMeet 报名 | 「边缘原生」线上技术沙龙完整议程公布!
How to use labelme
3. Dependency configuration management
[Awards every week] The "Edge Containers" track of the Cloud Native Programming Challenge invites you to fight!
POJ1321 棋盘问题(详解)
[MRCTF2020]Hello_misc