Java Multi-User Marketplace system source code

Source: Internet
Author: User

Recently the company to engage in shopping malls, let me consult, finally read a lot, or code, table field comments are not complete, or is a bug, or the document is missing, finally decided to develop a set of Mall.

The following is the development of some experience, right vote record down, to make a record of their own.

I qq:4407509, have a problem can contact me

has been engaged in e-commerce-related and Internet financial development, the processing of billions of data volume, so the current company Value.

Because Java is open source, in recent years, Hadoop and other open source products more and more mature, and is based on java, so finally choose Java Final Background development language, now the front end is his front-end engineer to write js, later prepared to change to the front end is php, the middle is the go language, Background server is java, because PHP writing front-end is very powerful, but this is also Late.

Control Layer: These years SPRINGMVC development of the very fire, and development efficiency is relatively high, struts series has completely declined, so at this stage choose Srpingmvc.

View Layer: There have been a lot of tests on the internet jsp, freemarkder, velocity, etc., results performance: velocity>freemarker>jsp, Development speed:velocity>freemarker> Jsp

Database design:

1, The key is absolutely cannot have foreign key strong association , I see similar with hibernate products of some companies, all are strong association, then you want to delete some data later, that is really nightmare, this also needless to say, query performance impact is also huge.

2, Sub-database sub-table, This must be supported, do the Internet data volume is very huge, if the beginning can not support the Sub-database sub-table, then the late will at least spend tens of millions to do this, the best example is dangdang, many things library, to now also did not realize the sub-library sub-table, they can only use some The partition table itself has a lot of problems, such as scalability, data volume over billion are problems!!!!

Database selection: best or myslq,1, lightweight, 2, Open source (ali's alisql is MySQL changed name), 3, function to meet the needs of E-commerce

Search: Choose Lucene better, The reason is that he encapsulated better, the authority for the E-commerce should not be designed too complex, I think the main two tables is enough, one is the role of the table, a resource resources table, and then the user and role through the Intermediate Table Association is ok, the role has resources , very simple logic, security, Shiro This two of the authority framework can make this Requirement.

Cache: currently using redis, I see some companies using memcache, this 10 years ago, so, The function is very humble not to say, the main problem is that there will be dead cache, is how the cache can not be emptied, this you think you know how tragic, the merchant changed the price, how also can not change, finally, The machine restart can only be turned off. Still some companies use or hibernate provide ehcache, this everyone understand can, the key is he do cluster has problems, electric business can not be a stand-alone, just on-line at least 2 Servers.

Static: currently using velocity static, you can achieve full station 60% is a static page, data from the cluster Redis cache Read.

Service: at present, the use of dubbo, Ali of the things are still withstand a great test, the real-time foreigner's things again good, there is no such scene to test, so are still theoretical stage, this let the people pretty proud!

Picture Server: This is also very important link, at present we test system has 5 g of pictures!!!! The online estimate is calculated as t, and it is thought to be a standalone image server.

cluster, load, distributed: The front of the sub-database sub-table, service, picture server is for the cluster, load, distributed to prepare, the cluster needs to do dynamic switching based on cdn, server with Nginx to do complex, business layer with Dubbo do distributed Services.

Let's organize the whole structure below:

Presentation Layer/control layer : springmvc, read/write separation in spring

Persistence Layer: MyBatis

Database: mysql/oracle, support Master-slave replication, read/write separation, multi-machine backup, support Sub-database sub-table

Caching mechanism: REDIS,CDN image cache, also supports hot backup, high concurrency

static mechanism: Velocity

Image Server: purchase occupy server, use Nginx to do load

Security Framework Springsecurity
Search Engine: Lucene
Chinese word breaker: Ikanalyzer

Server: Linux

Middleware: tomcat, nginx, and other n-more installed indirect software to support cluster deployment, do not enumerate

Image Server: via nginx, sftp Unified upload

Cluster solution: multi-machine tomcat,seesion Unified management, Picture Unified Management. These require a set of solutions.

Server requirements: linux/windows,4g memory, space 20G or more

finally, the Java Domain Mall development, in fact, in php,. NET language, There have been a lot of mature similar products, such as shopnc, ecshop and so on, but the logic of PHP is written in the foreground file, this is the logic in Java is written in the same jsp, this is easy to develop, but later two times development, maintenance is Inconvenient. Other than that. NET language we all know, it is not open source, this I do not dare to use, which day you encounter a fatal bug, can not be cleared from the bottom, this is why banks, finance, e-commerce Many industries do not use this language Reason.

In addition to Java development, in fact, if there is a good architecture, Java programmer only write logic, front-end only the front-end, database DBAs only focus on the dba, so that the development will be very convenient. Our team has also spent a long time, but also borrowed a lot of mature framework, developed a set of architecture suitable for the development of the Mall. Wait until later have the opportunity to open source to Everybody.

Website: www.redpigmall.net, i qq:4407509, have a problem can contact me

Java Multi-User Marketplace system source code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.