当前位置:网站首页>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.
边栏推荐
- 复现XXL-JOB 任务调度中心后台任意命令执行漏洞
- unity初学5 摄像机跟随,边界控制以及简单的粒子控制(2d)
- 五、视图解析与模板引擎
- 需求设计文档和产品经理的角色改变
- 如何与墨西哥大众VW Mexico建立EDI连接
- [Linear table] - Detailed explanation of three practice questions of LeetCode
- 5. View parsing and template engine
- @ WebServlet annotations (Servlet annotations)
- Image stitching (registration) case based on OpenCV
- A brief introduction to the SSM framework
猜你喜欢
软件测试员必看!数据库知识mysql查询语句大全
unity初学5 摄像机跟随,边界控制以及简单的粒子控制(2d)
Unity beginner 5 cameras follow, border control and simple particle control (2 d)
Discourse Custom Header Links
[C language] Program environment and preprocessing
五、视图解析与模板引擎
全流程调度——Azkaban入门与进阶
Discourse 自定义头部链接(Custom Header Links)
protobuf 中复合数据类型的读写
Machine Learning: Knowing the Dimensionality Reduction Process Through Low Variance Filtering
随机推荐
小程序npm包--API Promise化
MySQL String Concatenation - Various String Concatenation Practical Cases
Introduction to Thymeleaf
How does MySql find out the latest data row that meets the conditions?
gnss rtcm rtklib Ntrip...
C. Qualification Rounds
Android Studio implements login registration - source code (connecting to MySql database)
My first experience of Go+ language——Blessing message system, so that she can also feel your blessings
POJ1321 chessboard problem (detailed explanation)
Plan for many situations in the processing chain
webService interface
js operation to add or subtract from the current date (day, week, month, year)
5. View parsing and template engine
Become a qualified cybersecurity, do you know this?
Shi Xingguo, founder of Hyperchain, was interviewed by 21st Century Business Herald to interpret Shanghai's new NFT regulations and digital development
2.4希尔排序
1315_使用LOOPBACK模拟模式pyserial安装是否成功的测试
全流程调度——Azkaban入门与进阶
protobuf 中复合数据类型的读写
How to use labelme