java b2b2c multiuser mall

 

URL: www.hulianrongyun.com, I QQ: 4407509, there is a problem you can contact me

Recently the company to develop the mall, let me consult other finally read a lot, or is the code table field comments incomplete, or is the bug more, or is the lack of documentation, and finally decided to develop a mall.

Here are some of the feelings and experiences of development, record the time being, to put yourself to be recorded.

 

 

 

I QQ: 4407509, there is a problem you can contact me

Before electricity supplier has been engaged in Internet-related and financial development, handling billions of dollars level amount of data, so the company is valued at present.

Because Java is open source, in recent years, Hadoop and other open source products are more mature, and is based on Java , so the final choice of Java last background development language, now the front of their own front-end engineers to write JS, late into the front end is ready PHP , the middle is the Go language, back-end server is JAVA, because PHP write front-end is very powerful, but this is a late.

 

 

Control layer: In recent years SpringBoot development of the very fire, and the development of more efficient, SpringMVC series has been completely downhill, so at this stage choose SpringBoot .

 

View layer: this which I personally think are similar, JSP , FreeMarker or, ultimately resulting HTML .

 

 

Database Design:

    1, the key is a strong association must not have foreign keys , I see something like this with Hibernate , SpringData some of the products of the company are all strongly correlated, that you later want to delete some data, then it is a nightmare, and this also goes without saying query performance impact is huge.

   2, sub-library sub-table. This must be supported, the amount of data to do the Internet is very great, if you can not begin to support the sub-library sub-table, then the latter will spend at least 20 million dollars to do it, the best example is Dangdang, then a lot of things single library, and it has not achieved sub-library sub-table, they can use some of the partition table schema , partition table itself, there is a big problem, such as scalability, the amount of data billions of dollars are problems! ! ! !

 

Database selection: best myslq, 1, lightweight, 2, open-source (Ali alisql is MySQL change of name), 3, function to meet the electricity needs of business

 

Search: Select ElasticSearch better, because he's a better package

Authority for the electricity supplier, it should not be too complex design, I think mainly on the two tables is enough, it is a role Role table, a resource Resources table, and then associate users and roles by lower middle of the table on OK, role there are resources, very simple logic, security, shiro these two rights framework can make this demand.

 

缓存:目前使用Redis,我看到有的公司使用的是memcache,这个10年前,就这样,功能非常的简陋不说,主要一个问题是会有死缓存,就是缓存怎么也清空不了,这个你想想就知道多悲剧了,商家修改了价格,怎么也改不了,最后只能关闭机器重启。还有的公司使用的还是hibernate提供的ehcache,这个大家自行了解即可,关键是他做集群有问题,搞电商不可能是单机的,刚上线至少是2台服务器。

 

静态化:目前使用前端静态化,可以实现全站60%都是静态页面,数据从集群redis缓存中读取。

 

服务化:目前使用SpringCloud虽然阿里的dubbo确实做得非常好,但是目前市场来看SpringCloud有取代的趋势,另外SpringCloud提供了更多的服务治理方案。

 

图片服务器:这个也是非常重要的环节,目前我们测试系统都有15个G的图片了!!!!线上估计会是以T计算的,觉得是需要独立的图片服务器的。

 

集群、负载、分布式:前面的分库分表、服务化、图片服务器都是为集群、负载、分布式做准备的,集群需要基于CDN做动态切换,服务器用Nginx做复杂,业务层用SpringCloud做分布式服务。

 

下面整理下整个架构吧:

    展示层/控制层:SpringBoot,在spring中做读写分离

    持久层:mybatis

    数据库MySQL/Oracle,支持主从复制、读写分离、多机备份、支持分库分表

    缓存机制:redis,CDN图片缓存,也是支持热备份、高并发的

    静态化机制:系统页面做静态化,提高访问速度

    图片服务器:购买专用服务器,用nginx做负载

    

   
    搜索引擎: 分布式ElasticSearch
   

    服务器:Linux

    中间件:tomcat、nginx,还有其他N多的支持集群部署的安装间接软件,就不一一列举了

    图片服务器:通过nginx做的,SFTP方式统一上传

    集群方案:多机tomcat,seesion统一管理,图片统一管理。这些需要一套解决方案。

    服务器要求:linux/windows,4G内存,空间20G以上

    

架构图:

 

 

   Finally, for the development of the field of JAVA mall, in fact, PHP , the .NET languages, already has a lot of similar products in the mature, such as shopnc, ecshop, etc., etc., but the logic is written in the PHP file in the foreground, just like this JAVA logic is written in the JSP in the same, so although easy to develop, but the latter part of the second development, maintenance is not easy. In addition .NET language we all know, it is not open source, which I think can not use, one day you encounter a fatal bug, and not from the underlying investigation, which is why the banking, finance, electricity supplier in many industries do not use that language why.

  

  In addition to the development of JAVA, in fact, if there is good architecture , JAVA programmers write only logical, front-end write-only front-end database DBA DBA only concern, this is the case, it will be very easy to develop. Our team is currently also took a long time, also draws many mature framework, developed a framework for development of a mall. Wait until later have the opportunity to open up to you.

 

URL: www.hulianrongyun.com, I QQ: 4407509, there is a problem you can contact me

 

 

Guess you like

Origin www.cnblogs.com/b2b2c222/p/11963136.html