当前位置:网站首页>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.
边栏推荐
- 【软件工程之美 - 专栏笔记】31 | 软件测试要为产品质量负责吗?
- How with Mexico Volkswagen VW EDI connection to Mexico
- A brief introduction to the SSM framework
- [MRCTF2020]Hello_ misc
- Discourse 自定义头部链接(Custom Header Links)
- 【线性表】- LeetCode力扣三道练习题详解
- [Redis Master Cultivation Road] Jedis - the basic use of Jedis
- Learning of redis_Basic part
- 山西省第二届网络安全技能大赛(企业组)部分赛题WP(九)
- - B + tree index and MySQL series 】 【 what is the difference between a HASH index
猜你喜欢

VUX Datetime 组件compute-days-function动态设置日期列表

动态规划问题(完结篇)

Solve the error SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb7 in position 0: invalid start b

Unity beginner 5 cameras follow, border control and simple particle control (2 d)

Xiamen SenseCore Technology MC3172(1): Introduction and Environment Construction
Go 学习笔记(84)— Go 项目目录结构

Protobuf compound data types, speaking, reading and writing

A must see for software testers!Database knowledge MySQL query statement Daquan

unity初学5 摄像机跟随,边界控制以及简单的粒子控制(2d)

How does MySql find out the latest data row that meets the conditions?
随机推荐
GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
webService接口
Boss Rush (two-point answer + DP)
QT(39)-vs development qt program prompts that the source file cannot be opened
BGP的简单实验
The 2nd Shanxi Province Network Security Skills Competition (Enterprise Group) Partial WP (10)
六、读取应用配置+日志配置
Solve the error SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xb7 in position 0: invalid start b
Discourse 自定义头部链接(Custom Header Links)
5. View parsing and template engine
斐波那契数列的递归优化《备忘录递归》
golang八股文整理(持续搬运)
2.6基数排序(桶排序)
A brief introduction to the SSM framework
DAY17, CSRF vulnerability
小程序使用npm包定制全局样式
(Problem practice) Conditional probability + weight line segment tree + FWT + suffix array
file system two
Xiamen SenseCore Technology MC3172(1): Introduction and Environment Construction
Solve the go environment can not compile exe