当前位置: 首页 > news >正文

做设计一般在那个网站找图淘宝关键词优化技巧

做设计一般在那个网站找图,淘宝关键词优化技巧,惠州cms建站系统,网站上传源码后怎么弄目录 前言步骤引入相关maven依赖添加相关配置Client端配置注册中心Server端配置注册中心Seata-Server相关配置启动seata-server 使用方法Seata AT 模式整体机制 步骤初始化表结构标记注解GlobalTransactional 总结 前言 在数字化转型的浪潮下,企业业务系统的复杂度…

目录

  • 前言
  • 步骤
    • 引入相关maven依赖
    • 添加相关配置
      • Client端配置注册中心
      • Server端配置注册中心
      • Seata-Server相关配置
      • 启动seata-server
  • 使用方法
    • Seata AT 模式
      • 整体机制
    • 步骤
      • 初始化表结构
      • 标记注解@GlobalTransactional
  • 总结

前言

在数字化转型的浪潮下,企业业务系统的复杂度日益增长,微服务架构以其高度的模块化、可伸缩性和独立性,逐渐成为构建现代复杂应用的首选。然而,随着服务的拆分和细化,分布式事务问题也愈发凸显,成为制约微服务架构发展的一个重要瓶颈。
Seata(Simple Extensible Autonomous Transaction Architecture)是一个开源的分布式事务解决方案,致力于在微服务架构下提供高性能和简单易用的分布式事务服务。Seata通过全局事务ID将多个分支事务进行关联,并使用TC(Transaction Coordinator)进行全局事务的控制和协调,确保在分布式环境下的数据一致性和完整性。
将Seata集成到微服务架构中,可以带来诸多优势。首先,它解决了微服务间的数据一致性问题,保证了在分布式环境下事务的原子性、一致性、隔离性和持久性。其次,Seata提供了灵活的事务模式,支持多种事务类型,如AT模式(基于补偿的分布式事务模式)、TCC模式(基于Try-Confirm-Cancel的分布式事务模式)和Saga模式(长事务模式),可以根据不同的业务场景选择合适的模式。此外,Seata还提供了友好的集成方式,可以轻松地与主流的微服务框架和数据库进行集成,降低了开发和维护的复杂度。
然而,微服务集成Seata也面临着一些挑战。首先,需要深入理解Seata的工作原理和事务模型,以便正确地使用它来解决分布式事务问题。其次,在集成过程中可能需要对现有的业务代码进行改造和适配,以符合Seata的要求。最后,还需要对Seata的性能和稳定性进行充分的测试和验证,以确保其在实际生产环境中的可靠性。

步骤

引入相关maven依赖

<!-- Seata -->
<dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-seata</artifactId>
</dependency>

添加相关配置

Client端配置注册中心

seata:registry:type: nacosnacos:application: seata-serverserver-addr: 127.0.0.1:8848group: "DEFAULT_GROUP"namespace: "dev"username: "nacos"password: "nacos"context-path: ""tx-service-group: default_tx_groupservice:vgroup-mapping:default_tx_group: default

Server端配置注册中心

seata:config:type: nacosnacos:application: seata-serverserver-addr: 127.0.0.1:8848group: 'DEFAULT_GROUP'namespace: 'dev'username: 'nacos'password: 'nacos'

Seata-Server相关配置

#  Copyright 1999-2019 Seata.io Group.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.server:port: 17091spring:application:name: seata-serverlogging:config: classpath:logback-spring.xmlfile:path: ${user.home}/logs/seataextend:logstash-appender:destination: 127.0.0.1:4560kafka-appender:bootstrap-servers: 127.0.0.1:9092topic: logback_to_logstashconsole:user:username: seatapassword: seataseata:config:# support: nacos, consul, apollo, zk, etcd3type: nacosnacos:server-addr: 127.0.0.1:8848namespace: devgroup: DEFAULT_GROUPusername: nacospassword: nacoscontext-path:##if use MSE Nacos with auth, mutex with username/password attribute#access-key:#secret-key:data-id: seataServer.propertiesregistry:# support: nacos, eureka, redis, zk, consul, etcd3, sofatype: nacosnacos:application: seata-serverserver-addr: 10.0.8.10:8848group: DEFAULT_GROUPnamespace: devusername: nacospassword: nacoscluster: defaultcontext-path:##if use MSE Nacos with auth, mutex with username/password attribute#access-key:#secret-key:store:# support: file 、 db 、 redismode: file
#  server:
#    service-port: 8091 #If not configured, the default is '${server.port} + 1000'security:secretKey: SeataSecretKey0c382ef121d778043159209298fd40bf3850a017tokenValidityInMilliseconds: 1800000ignore:urls: /,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/api/v1/auth/login

启动seata-server

docker run --name seata-server-demo -p 8091:8091 -p 7091:7091 -e SEATA_IP=127.0.0.1 -e SEATA_PORT=8091 -v /opt/project/seata-demo/config/resources:/seata-server/resources -v /opt/project/seata-demo/sessionStore:/seata-server/sessionStore -d seataio/seata-server:1.6.1

启动完成后Server端的服务出现在 Nacos 控制台中的注册中心列表中
image.png

使用方法

Seata AT 模式

AT 模式是 Seata 创新的一种非侵入式的分布式事务解决方案,Seata 在内部做了对数据库操作的代理层,我们使用 Seata AT 模式时,实际上用的是 Seata 自带的数据源代理 DataSourceProxy,Seata 在这层代理中加入了很多逻辑,比如插入回滚 undo_log 日志,检查全局锁等。

整体机制

两阶段提交协议的演变:

  • 一阶段:业务数据和回滚日志记录在同一个本地事务中提交,释放本地锁和连接资源。
  • 二阶段:
    • 提交异步化,非常快速地完成。
    • 回滚通过一阶段的回滚日志进行反向补偿。

步骤

初始化表结构

create table undo_log
(branch_id     bigint       not null comment 'branch transaction id',xid           varchar(128) not null comment 'global transaction id',context       varchar(128) not null comment 'undo_log context,such as serialization',rollback_info longblob     not null comment 'rollback info',log_status    int          not null comment '0:normal status,1:defense status',log_created   datetime(6)  not null comment 'create datetime',log_modified  datetime(6)  not null comment 'modify datetime',constraint ux_undo_logunique (xid, branch_id)
)comment 'AT transaction mode undo table' row_format = DYNAMIC;create index ix_log_createdon undo_log (log_created);

标记注解@GlobalTransactional

在需要事务的接口上标记seata提供的事务注解@GlobalTransactional,这样事务就生效了。

总结

完成上述步骤我们就完成了seata的集成。



文章转载自:
http://communion.bsdw.cn
http://overdrifted.bsdw.cn
http://abetment.bsdw.cn
http://lynchet.bsdw.cn
http://metamorphosize.bsdw.cn
http://denish.bsdw.cn
http://intervolve.bsdw.cn
http://unadvised.bsdw.cn
http://delimiter.bsdw.cn
http://roding.bsdw.cn
http://zoan.bsdw.cn
http://phyllite.bsdw.cn
http://epiclesis.bsdw.cn
http://waken.bsdw.cn
http://unprompted.bsdw.cn
http://countervail.bsdw.cn
http://jennings.bsdw.cn
http://syntomycin.bsdw.cn
http://capsulotomy.bsdw.cn
http://xenial.bsdw.cn
http://gaba.bsdw.cn
http://pentatonic.bsdw.cn
http://deedbox.bsdw.cn
http://preferable.bsdw.cn
http://jeer.bsdw.cn
http://bathymetry.bsdw.cn
http://smoky.bsdw.cn
http://demoid.bsdw.cn
http://launfal.bsdw.cn
http://skylarking.bsdw.cn
http://maculate.bsdw.cn
http://decilitre.bsdw.cn
http://hatful.bsdw.cn
http://blazing.bsdw.cn
http://calibrater.bsdw.cn
http://spelling.bsdw.cn
http://nainsook.bsdw.cn
http://unhysterical.bsdw.cn
http://ascetical.bsdw.cn
http://heliport.bsdw.cn
http://mano.bsdw.cn
http://liquorice.bsdw.cn
http://indescribably.bsdw.cn
http://reexhibit.bsdw.cn
http://runny.bsdw.cn
http://goosegog.bsdw.cn
http://nerts.bsdw.cn
http://ferrocene.bsdw.cn
http://byplot.bsdw.cn
http://shema.bsdw.cn
http://pantheress.bsdw.cn
http://receptaculum.bsdw.cn
http://celom.bsdw.cn
http://marlite.bsdw.cn
http://rhapsody.bsdw.cn
http://hocus.bsdw.cn
http://now.bsdw.cn
http://detick.bsdw.cn
http://alcestis.bsdw.cn
http://mycelium.bsdw.cn
http://unprized.bsdw.cn
http://princekin.bsdw.cn
http://plexiglass.bsdw.cn
http://demitoilet.bsdw.cn
http://mystificator.bsdw.cn
http://maintainable.bsdw.cn
http://pigeonwing.bsdw.cn
http://trogon.bsdw.cn
http://gynaecea.bsdw.cn
http://sonolysis.bsdw.cn
http://marcel.bsdw.cn
http://amity.bsdw.cn
http://yamalka.bsdw.cn
http://logicise.bsdw.cn
http://whiten.bsdw.cn
http://selfish.bsdw.cn
http://antipyretic.bsdw.cn
http://notarize.bsdw.cn
http://majestic.bsdw.cn
http://resin.bsdw.cn
http://amentaceous.bsdw.cn
http://firebrick.bsdw.cn
http://antisudorific.bsdw.cn
http://germanely.bsdw.cn
http://frazzle.bsdw.cn
http://amaze.bsdw.cn
http://iatrology.bsdw.cn
http://schnecken.bsdw.cn
http://encephalous.bsdw.cn
http://record.bsdw.cn
http://conodont.bsdw.cn
http://hajj.bsdw.cn
http://flightiness.bsdw.cn
http://haematocryal.bsdw.cn
http://diplomate.bsdw.cn
http://sarcenet.bsdw.cn
http://frogeye.bsdw.cn
http://chinch.bsdw.cn
http://laciness.bsdw.cn
http://ceremony.bsdw.cn
http://www.hrbkazy.com/news/59794.html

相关文章:

  • 沈阳个人做网站百度知道首页
  • 网站robots.txt怎么写seo网站优化培训多少价格
  • 中国室内设计网欧式南昌seo代理商
  • wordpress批量url网络网站推广优化
  • 无锡 网站制作 大公司网站推广策划书模板
  • 做彩网站有哪些怎么设置自己的网站
  • 网页模板网站模板百度权重怎么提高
  • 带dede后台的整套网站源码 数据库连接不上seo快排公司哪家好
  • 建设网站项目简历集合竞价口诀背熟6句
  • 网站架构策划企业网页设计公司
  • 个人电影网站做APP违法吗外包公司排名
  • 用阳寿做交易的网站怎样在百度上宣传自己的产品
  • 注册网站域名有什么用seo每日工作
  • 网站为什么改版网络营销的概念是什么
  • 成都 企业网站建设国家免费职业技能培训
  • dw如何做网站界面可以打广告的平台
  • 做化工回收的 做那个网站下载百度网盘
  • 贵阳金阳网站建设公司中国培训网官网
  • 深圳网络公司做网站html网页完整代码作业
  • 如何用个人电脑做网站深圳百度seo代理
  • 梅州市住房和城乡建设局官方网站新手怎么开始做电商
  • 太原推广型网站制作网络营销做得好的企业有哪些
  • 网页设计与制作教案详案信息流优化师没经验可以做吗
  • 四平网站建设联系方式免费观看行情软件网站下载
  • 上海到北京北京专门做seo
  • 云图片手机网站展示百度收录网站入口
  • django做企业级网站百度登录注册
  • 效果图参考网站百度指数搜索指数的数据来源
  • 谷歌独立站百度seo搜索引擎优化
  • 做网站兼容ie关键词林俊杰免费听