Top Banner
1 media.netlogix.de October 2, 2010 Clemens Kalb, Lienhart Woitok, T3CON10
44

Building a large eCommerce application with Extbase, Fluid and Apache Solr

May 19, 2015

Download

Documents

netlogix
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building a large eCommerce application with Extbase, Fluid and Apache Solr

1

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 2: Building a large eCommerce application with Extbase, Fluid and Apache Solr

2

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 3: Building a large eCommerce application with Extbase, Fluid and Apache Solr

3

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

IBC SOLAR: Selling

everything from a

solar module to

complete solar plants

Working with retail

partners in Germany

and throughout the

world

857 million turnover

in 2009

4-figure number of

products x product

variants x retail

partners

Page 4: Building a large eCommerce application with Extbase, Fluid and Apache Solr

4

media.netlogix.de

„Build yet another Shop System for TYPO3 – are you

insane?“

All of us & the customer (before the start of the project)

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 5: Building a large eCommerce application with Extbase, Fluid and Apache Solr

5

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Previous system based on Commerce

• scalability issues

tt_products? Hell no! ;-)

Specialized functionality lacking in all systems

Magento looked fairly nice – but not integrated in

TYPO3

Page 6: Building a large eCommerce application with Extbase, Fluid and Apache Solr

6

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 7: Building a large eCommerce application with Extbase, Fluid and Apache Solr

7

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 8: Building a large eCommerce application with Extbase, Fluid and Apache Solr

8

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 9: Building a large eCommerce application with Extbase, Fluid and Apache Solr

9

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 10: Building a large eCommerce application with Extbase, Fluid and Apache Solr

10

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

All data comes from the company‘s ERP system

Custom import functionality for complete orders

Individual prices for customers

No need for retail functions like online payment

processing

Page 11: Building a large eCommerce application with Extbase, Fluid and Apache Solr

11

media.netlogix.de

standing on the shoulders of giants

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 12: Building a large eCommerce application with Extbase, Fluid and Apache Solr

12

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

How do you design a generic domain model for a

shop system?

Page 13: Building a large eCommerce application with Extbase, Fluid and Apache Solr

13

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

You don‘t …(unless you have too much time on your hands)

Page 14: Building a large eCommerce application with Extbase, Fluid and Apache Solr

14

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

…because it already exists:

Page 15: Building a large eCommerce application with Extbase, Fluid and Apache Solr

15

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

BMEcat

Page 16: Building a large eCommerce application with Extbase, Fluid and Apache Solr

16

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Proven & open standard for product catalogues

Very well documented (specification >600 pages)

Originally an XML data exchange format

Page 17: Building a large eCommerce application with Extbase, Fluid and Apache Solr

17

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

The Extbase kickstarter:

a great way to create lots of model objects

Page 18: Building a large eCommerce application with Extbase, Fluid and Apache Solr

18

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 19: Building a large eCommerce application with Extbase, Fluid and Apache Solr

19

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 20: Building a large eCommerce application with Extbase, Fluid and Apache Solr

20

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

The kickstarter is not an editor!

Page 21: Building a large eCommerce application with Extbase, Fluid and Apache Solr

21

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Using SCM to cherry-pick changes:

1. Save in kickstarter

2. svn revert <fileThatShouldNotBeTouched>

3. Eclipse diff view to manually merge files

Page 22: Building a large eCommerce application with Extbase, Fluid and Apache Solr

22

media.netlogix.de

Apache Solr as a Storage Backend

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 23: Building a large eCommerce application with Extbase, Fluid and Apache Solr

23

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Java based search

server

Searches millions of

documents (products,

text entries, prices…)

in very little time

Provides faceted

search facilities

Page 24: Building a large eCommerce application with Extbase, Fluid and Apache Solr

24

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

The naive way:

writing direct querys to the Solr server from the

application code

Page 25: Building a large eCommerce application with Extbase, Fluid and Apache Solr

25

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Repository QueryExtbase

persistencelayer

Storage Backend

Background storage

(DB, Solr…)

NO

FACETED

QUERIES

Faceted

Query

Solr storage

backend

Page 26: Building a large eCommerce application with Extbase, Fluid and Apache Solr

26

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Tx_Extbase_Persistence_Query

$query->equals(‘foobar’, $foobar)

$query->logicalAnd($statement1,

$statement2)

$query->in(‘foobar’, array($item1,

$item2))

Page 27: Building a large eCommerce application with Extbase, Fluid and Apache Solr

27

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Tx_Nxsolrbackend_Persistence_Backend_

SolrBackend

foobar:$foobar

($statement1 AND $statement2)

foobar:($item1 $item2)

Page 28: Building a large eCommerce application with Extbase, Fluid and Apache Solr

28

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Tx_Nxsolrbackend_Persistence_FacetedQuery

extends Tx_Extbase_Persistence_Query

$query->facet($facetConfiguration)

$query->execute(): Tx_Nxsolrbackend_Persistence_

FacetedQueryResult

$facetedQueryResult->getObjects()

$facetedQueryResult->getFacets()

Page 29: Building a large eCommerce application with Extbase, Fluid and Apache Solr

29

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Structural differences: database vs. index

Data duplication: database and Solr index

Extbase knows only one StorageBackend

Page 30: Building a large eCommerce application with Extbase, Fluid and Apache Solr

30

media.netlogix.de

Pentaho Data Integration

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 31: Building a large eCommerce application with Extbase, Fluid and Apache Solr

31

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

How to feed data into the database

from external sources?

Page 32: Building a large eCommerce application with Extbase, Fluid and Apache Solr

32

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

(Photo courtesy of trenttsd/flickr)

Page 33: Building a large eCommerce application with Extbase, Fluid and Apache Solr

33

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Looking for the right tool:

Integrate different data sources homogenously

Source data from Microsoft Dynamics NAV

(MSSQL)

CSV file to specify additional files for products

like datasheets and the like

Need to understand it 3 years later

Page 34: Building a large eCommerce application with Extbase, Fluid and Apache Solr

34

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Pentaho Data Integration

Extract, Transform and Load

JDBC + plugins for different data sources/targets

Page 35: Building a large eCommerce application with Extbase, Fluid and Apache Solr

35

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Configurability: import into different sysfolders,

configure parameters and default values

Where needed: Use JS and external code for

special transformations

Page 36: Building a large eCommerce application with Extbase, Fluid and Apache Solr

36

media.netlogix.de

How fast is Extbase?

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 37: Building a large eCommerce application with Extbase, Fluid and Apache Solr

37

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

First implementations were painfully slow due to…

Working with thousands of objects

Bug in Extbase: most objects considered dirty at

any time

Page 38: Building a large eCommerce application with Extbase, Fluid and Apache Solr

38

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Build first, optimize later!(Might be scary at times, but the approach does actually work…)

Page 39: Building a large eCommerce application with Extbase, Fluid and Apache Solr

39

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Optimization #1:

Make heavy use of lazy loading, load objects only

when needed

Page 40: Building a large eCommerce application with Extbase, Fluid and Apache Solr

40

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Optimization #2:

Fix Extbase: Objects no longer dirty ;-)

Page 41: Building a large eCommerce application with Extbase, Fluid and Apache Solr

41

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Optimization #3:

Not everything needs to be an object:

If you don‘t need domain logic,

you might just render raw query results

Page 42: Building a large eCommerce application with Extbase, Fluid and Apache Solr

42

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Optimization #4:

Use the good old TYPO3 caching mechanisms,

but be especially careful

Page 43: Building a large eCommerce application with Extbase, Fluid and Apache Solr

43

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10

Page 44: Building a large eCommerce application with Extbase, Fluid and Apache Solr

44

media.netlogix.de

October 2, 2010

Clemens Kalb, Lienhart Woitok, T3CON10