当前位置:网站首页>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.
边栏推荐
- 三、依赖配置管理
- 2021 Shandong Province Network Construction and Application Test Questions
- MySQL installation error solution
- 小程序 wx.miniProgram.navigateTo 跳转地址不能是tabbar地址
- 字符串问题(下)
- MYSQL unique constraint
- 六、读取应用配置+日志配置
- Shi Xingguo, founder of Hyperchain, was interviewed by 21st Century Business Herald to interpret Shanghai's new NFT regulations and digital development
- The Complete Go Books - Beginner to Advanced and Web Development
- Machine Learning: Knowing the Dimensionality Reduction Process Through Low Variance Filtering
猜你喜欢
See you in shenzhen!Cloud native to accelerate the application building special: see cloud native FinOps, SRE, high-performance computing scenario best practices
2.6 Merge Sort
DAY17: weak password detection and test
Web page element parsing a tag
DAY17:弱口令的探测与测试
Code readability, pre-checks, comments and summaries
Shanxi group (enterprises) in the second network security skills competition part problem WP (7)
DAY17, CSRF vulnerability
Alibaba Cloud's EasyNLP Chinese text image generation model takes you to become an artist in seconds
VUX Datetime 组件compute-days-function动态设置日期列表
随机推荐
KubeMeet Registration | The complete agenda of the "Edge Native" Online Technology Salon has been announced!
Shi Xingguo, founder of Hyperchain, was interviewed by 21st Century Business Herald to interpret Shanghai's new NFT regulations and digital development
2021 Shandong Province Network Construction and Application Test Questions
The Double Pointer Problem (Part 2)
Introduction to database - MySQL simple introduction
Usage of EFR32 as sniffer for Zigbee/Thread
六、读取应用配置+日志配置
The VUX Datetime component compute-days-function dynamically sets the date list
The 2nd Shanxi Province Network Security Skills Competition (Enterprise Group) Partial WP (10)
webService接口
Weight line segment tree + line segment tree split/merge + CF1659D
Shanxi group (enterprises) in the second network security skills competition part problem WP (8)
Mini Program wx.miniProgram.navigateTo jump address cannot be tabbar address
山西省第二届网络安全技能大赛(企业组)部分赛题WP(十)
WPF study notes "WPF Layout Basics"
[C language] Program environment and preprocessing
2.6 Radix sort (bucket sort)
Alibaba Cloud's EasyNLP Chinese text image generation model takes you to become an artist in seconds
Chapter8 Support Vector Machines
A must see for software testers!Database knowledge MySQL query statement Daquan