• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Moving complex enterprise ecommerce systems to the cloud
 

Moving complex enterprise ecommerce systems to the cloud

on

  • 795 views

Developing and operating an enterprise commerce ecosystem, with its complex integrations, can often be a significant challenge. Are you wondering if a migration to the cloud would be best for your ...

Developing and operating an enterprise commerce ecosystem, with its complex integrations, can often be a significant challenge. Are you wondering if a migration to the cloud would be best for your business, or if it is even possible for your specific applications? In this webinar we will discuss some of the advantages and disadvantages of working in a Platform-as-a-Service (PaaS) environment, such as dealing with restricted classes, leveraging automatic scalability, and migrating the persistence layer. Learn from our experiences, as we reveal what worked best as we moved our own multi-server enterprise application from traditional collocated hardware into the Google App Engine cloud environment.

Statistics

Views

Total Views
795
Views on SlideShare
795
Embed Views
0

Actions

Likes
0
Downloads
11
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Moving complex enterprise ecommerce systems to the cloud Moving complex enterprise ecommerce systems to the cloud Presentation Transcript

    • Moving Complex Enterprise Ecommerce Systems to the Cloud Eddie Chan Ronald ChenElastic Path™
    • Elastic Path Software• We help the worldʼs biggest brands sell digital goods and services• We provide a flexible Java ecommerce platform and expertise in ecommerce strategy and implementation• #1 ecommerce blog: www.getelastic.com• For more on-demand ecommerce resources: www.elasticpath.com/resources
    • The Elastic Path Platform Elastic Path Architecture Components Eclipse RCP SWT / JFace Financials ERP CMS Payment Legacy Custom / Web Browser Mobile Browser Commerce Manager Client System System Gateway Systems LOB Apps Store Front Server Commerce Manager Web Services Server XML Import/Export Spring Security Spring Security Spring Security Core Engine Apache Velocity Spring Remoting JAX-WS Spring MVC Quartz Scheduling Core Engine Data Sync Tool Drools Core Engine Core Engine Core Engine ETL Tools Search Server SOLR Search Server Quartz Scheduling Core Engine J2EE Application Server Database Server Ecommerce is complex. Enterprise ecommerce is complex-er.
    • Case Study• Since 2008, Elastic Path has been the ecommerce backbone of a few of Googleʼs online stores• For these stores, many customizations have been made to the Elastic Path platform.• One of the largest customizations thatʼs been made to the Elastic Path platform is migrating it to run on Google App Engine.
    • Migration to Google App EngineBefore: After:• EP running in the Colo • EP running on App Engine• Fixed Cluster • Dynamic instances
    • Google App Engine• Same system that powers many of Googleʼs own apps• GAE is a Platform as a Service (PaaS) • More restrictive than Infrastructure as a Service (IaaS) offerings (but for good reasons)• Supports Python, Go, and Java (& other JVM languages)• Free to get started; pay as you go pricing
    • Advantages of Google App Engine• Automatic Scalability• Well defined development environment• Secure• Easier deployments and operations• Reduced Cost• Built-in monitoring tools• Useful services
    • Topics• Challenges with Restricted Classes• How App Engine Automatically Scales• Performance, Performance, Performance• Migrating the Persistence Layer
    • Topics• Challenges with Restricted Classes• How App Engine Automatically Scales• Performance, Performance, Performance• Migrating the Persistence Layer
    • Challenges with Restricted Classes• App Engineʼs JRE Class White List: These JRE Classes work on App Engine. All other JRE Classes do not. The full list of white list classes can be found at: http://code.google.com/appengine/docs/java/jrewhitelist.html
    • File Restrictions • Not allowed: • Reading/writing to the filesystem (this should not be done anyway) • Writing to files inside the WAR • Allowed: • Reading from files inside the WAR
    • Example: File Restrictions • Problem: we were reading/writing to the filesystem • Solution: we moved the read-only files into the WAR and moved the read/write data to the DatastoreBefore: After:
    • Socket Restrictions • App Engine does not allow the use of raw sockets • Reason: security considerations • Workarounds may exist depending on the nature of the communication • e.g. HTTP sockets & App Engine URL Fetch Service
    • Example: Socket Restrictions • Problem: We used HttpClient, which uses sockets, for Spring HTTP Remoting • Solution: There is a custom connection manager for HttpClient 4 that uses App Engine URL Fetch Service instead of sockets Before: After:
    • Thread Restrictions • App Engine does not allow spawning of threads • Use Task Queues instead of threads for background jobs • Task Queues: • Like a Java Executor • Highly configurable • Accepts URLs instead of Runnables • Code that would have been in Runnable is bound to a URL • Fetching the URL is like running the task on another thread
    • Example: Thread Restrictions • Problem: Generating a file on a background thread • Solution: Migrate Runnable to Spring Controller and schedule with App Engine Task Queues instead of Executor Before: After:
    • Topics• Challenges with Restricted Classes• How App Engine Automatically Scales• Performance, Performance, Performance• Migrating the Persistence Layer
    • How App Engine Automatically Scales “App Engine apps are powered by any number of dynamic instances at any given time, depending on the volume of requests received by your application. As requests for your application increase, so do the number of dynamic instances powering it.” http://code.google.com/appengine/docs/adminconsole/instances.html Requests Instances Requests Instances
    • How App Engine Automatically Scales• A single instance handling requests• This instance, like all instances, has a request queue to hold incoming requests
    • How App Engine Automatically Scales• A new request comes in• Instance-1ʼs request queue is getting overloaded, so...
    • How App Engine Automatically Scales• App Engine spawns a new instance to handle request-5• request-5 is a loading request; request-5 must wait for instance-2 to fully initialize before being processed
    • How App Engine Automatically Scales• instance-2 finally finishes initializing and can now handle requests alongside instance-1
    • How App Engine Automatically ScalesLoading requests make users wait!Introducing warm-up requests:• Introduced in Google App Engine v1.4.0• Initialize instances ahead of time so that live requests do not initiate new instances• On by default• Not always called for every new instance (e.g. the very 1st instance)
    • How App Engine Automatically ScalesLetʼs replay the previous scenario with warm-up requests.• A single instance handling requests• App Engine sees that instance-1ʼs request queue is getting overloaded, so...
    • How App Engine Automatically Scales• Before any more requests arrive, App Engine sends a warm-up request to initialize a new instance
    • How App Engine Automatically Scales• instance-2 finishes initializing and is ready to handle requests alongside instance-1
    • How App Engine Automatically Scales• A new requests comes in• instance-2 is ready to handle request-5 right away• request-5 is not a loading request this time
    • How App Engine Automatically ScalesFast-forward a few seconds. request-1, 2, and 5 havebeen processed.• instance-2 is idle and instance-1ʼs queue is not full, so...
    • How App Engine Automatically Scales• App Engine scales down and drops instance-2 because it is no longer needed
    • How App Engine Automatically ScalesIntroducing Always-On Instances:• Always-On instances remain running even with no traffic• Minimizes impact of loading requests• A premium feature (i.e. costs a bit more)
    • Topics• Challenges with Restricted Classes• How App Engine Automatically Scales• Performance, Performance, Performance• Migrating the Persistence Layer
    • Performance Tools - AppStats• AppStats • A servlet filter that measures the performance of each request
    • Performance - Loading Deadline• Recall that any request has the potential to be a loading request
    • Performance - Request Deadline• Still need to handle actual request in the remaining time after loading application• After 60 seconds, a runtime exception will be thrown and the requests will be dropped
    • Performance - Optimizing• Loading Request time = Start-Up time + Request time• To thrive on App Engine, request performance and start- up performance must be optimized together Optimize Requests Optimize Start-Up
    • Performance - Optimizing Start-UpHow do you optimize start-up times?
    • Performance - Optimizing Start-UpHow do you optimize start-up times? Do Less
    • Performance - Optimizing Start-UpDo less at start-up:• In our application half the start up time was being consumed with classloading• Amount of classloading is application/framework specific• We were loading more classes than expected• Use -verbose:class• Classpath scanning is slow• Use static configuration instead of classpath scanning• Generate configuration at build
    • Performance - Optimizing Page Loads• Serve resources from the WAR statically Before: After:
    • Performance - Optimizing Page Loads• App Engine provides memcache service• Cache is shared across instances• Best effort cache• In our application we gained performance by caching Spring Remote calls
    • Topics• Challenges with Restricted Classes• How App Engine Automatically Scales• Performance, Performance, Performance• Migrating the Persistence Layer
    • Migrating the Persistence Layer• Google App Engineʼs persistence layer is Datastore• Datastore is a non-relational database• Most enterprise applications use a relational database• Non-relational databases donʼt have tables SQL Table: Datastore (abstract):
    • Migrating the Persistence Layer• Transaction boundary in Datastore is very different• Can only perform transaction around entity groups• Each entity has a parent entity• An entity group is a tree of entities
    • Migrating the Persistence Layer• Existing domain model unlikely to work in Datastore• Different storage structure• Different transaction model• Different tools/framework What do we do?
    • Migrating the Persistence Layer• Existing domain model unlikely to work in Datastore• Different storage structure• Different transaction model• Different tools/framework What do we do? Run Away?
    • Migrating the Persistence Layer• Datastore is designed to scale with the App Engine cloud • Entities are far easier to cache • Fetches are small and focused • No more fetch group hell• The data and transaction model force cleaner domain models • More flexible than tables • Can have different properties on the same “type” of entities • Focus on smaller transactions• Alternatively, use Google Cloud SQL
    • Letʼs Recap• Elastic Path is a flexible Java ecommerce platform• Google App Engine is a true cloud platform that supports Java web applications• App Engineʼs constraints can be liberating• JRE Class restrictions forced one to implement workarounds with App Engine services• Automatic scalability is achieved with dynamic instances• App Engine imposes strict performance requirements on your apps• The Datastore is a non-relational DB that forces one to untangle the domain model
    • Was the Migration Worth It?
    • Was the Migration Worth It? For us, yes!
    • Was the Migration Worth It? - Yes!• Automatic scalability• App Engineʼs restrictions forced us to rethink and improve our applicationʼs design• Deployments to App Engine are flexible and easy• Production environments are easy to replicate for testing• No more server configuration management• Reduced costs• Frequent Google App Engine releases continue to introduce cool, useful features
    • Thank you.Any Questions?For more information visit:Web www.elasticpath.comBlog www.getelastic.comTwitter @elasticpath
    • Additional Resources• Google App Engine homepage: http://code.google.com/appengine/• Maven plugin for Google App Engine: http://code.google.com/p/maven-gae-plugin/• Will It Play In App Engine - lists the level of compatibility of various Java technologies and App Engine: http://code.google.com/p/googleappengine/wiki/WillItPlayInJava• ESXX - Custom HttpClient 4 URLFetch connection manager: http://esxx.blogspot.com/ 2009/06/using-apaches-httpclient-on-google-app.html