开发者

Designing a Scalable Application

开发者 https://www.devze.com 2023-03-19 17:25 出处:网络
Starting a new project an e-commerce, that basically consists of two, main separated projects: a core application and a web client.

Starting a new project an e-commerce, that basically consists of two, main separated projects: a core application and a web client.

  1. Core app would act as a service provider, the back-end for the web client (or other clients), exposing all its functionality in REST-ful web service/JSON.

  2. Web client would act as a front-end and a service consumer for the core app.

Both project are mainly based on: Spring, Apache CXF, Maven, and either Tomcat or Jetty. Git as VCS. CouchDB as the DB. Also a distributed caching system like Memcached.

The principle is to design the project (both core and web) in a way to be scalable and dis开发者_如何学JAVAtributable on several nodes on the internet.

Perhaps the subject is too big and complex to discuss in one topic; the idea is to put the main headlines that would assist on making the right decisions before going on with the implementation.

The questions:

  1. Based on the technology stack above, what could possibly be missing or worth adding?
  2. Any books, materials or case studies recommendation that touch on the subject?


On the server side, you should structure your URLs and application state in such a way that they can either be generated statically and served via a web server like apache, or dynamically generated and served by the app server. Static content generation can be a pretty effective, reasonably straightforward way to improve performance. Having your API points to be implementation agnostic is generally a good practice anyways.

High Performance Websites has some great stuff. Also, check out Squid for HTTP caching.


Take a look at CQRS principles. Even though great scalability is only side effect of applying CQRS, it ideally fits for cloud computing which main goal is to provide elastic scalability. Here is a awesome video from Greg Young's class.

PS. Despite most of materials are based on .NET stack, these principles are cross-platform.


@Ellead:Go through Tomcat clustering (session replication) :http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html

Just take care of singleton objects in spring (keep in mind singleton is per JVM)


You did not mentioned performance and load testing - you should measure performance of your application and scalability too:

  • How is a single node coping wih high load ?
  • What performance gainyou get by adding a single node ?

Do no expect or guess anything and start as soon as possible - that alone will save you fortune.

For REST-based solution look at Apache httpd and mod_jk for load-balancing.

0

精彩评论

暂无评论...
验证码 换一张
取 消