SlideShare a Scribd company logo
1 of 30
Download to read offline
Copyright Edmunds Inc. (the “Company”). All rights reserved.
Edmunds®, Edmunds.com®, the Edmunds.com car design, Inside Linesm , CarSpacesm and AutoObserver® are proprietary trademarks of the Company.
This document contains proprietary and/or confidential information of the Company. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any
purpose other than advancing the best interests of the Company, and any such disclosure requires the express approval of the Company.
Best Practices for Architecting High Volume, High
Performance Publishing for Data Intensive Web Site
October 23th 2010
Greg Rokita
Director, Sr. Architect
Edmunds.com
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Assumptions
o Knowledge of Java
o Basic understanding of Spring
o Basic knowledge of JMS
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Agenda
o Common Enterprise Problems
o Layered Architecture
o ActiveMQ and Virtual Topics
o Camel
o Thrift & Versioning
o Retry and Throttling mechanism
o Monitoring
o Q&A
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Common Enterprise Problems
o Multiple:
o Environments (Prod, Test, Dev, etc)
o Data Centers (Los Angeles, New York, Amazon EC2, etc)
o Sites
o Applications (Solr, Coherence, etc)
o Data Sets (inventory, user data, pricing data, etc)
o Data Format Changes
o Components Fail
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
What evolved from the efforts
o Message
o Delivery
o Routing
o Persistence
o Durability
o Retries
o Throttling
o Versioning
o Monitoring
ActiveMQ
Camel
Thrift
6
ActiveMq Broker
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Publish Subscribe
o Producers decoupled from consumers –– cool idea
o JMS durable topics suck
o message consumer is created with a JMS client ID and
durable subscriber name
o only one consumer can be active for a client ID and
subscriber name
o CAN’’T failover of the subscriber if that one process running
that one consumer thread dies
o CAN’’T load balancing of messages.
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Virtual Topics
Virtual Topic:
VirtualTopic.Vehicle
Queues:
Consumer.Queue1.VirtualTopic.Vehicle
Consumer.Queue2.VirtualTopic.Vehicle
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Virtual Topics
public class QueueDestinationInterceptor implements DestinationInterceptor {
public synchronized Destination intercept(final Destination destination) {
return new DestinationFilter(destination) {
public void send(ProducerBrokerExchange context, Message message) throws Exception {
if (applyFilterBasedOnMessageProperties(destination)) {
return;
}
destination.send(context, message);
}
};
}
}
o Message is always send to ALL the queues
o Solution: Destination Interceptor ActiveMQ plug in
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Camel
from(A).filter(header(““type").isEqualTo(““Widget")).to(B)
Endpoint A Endpoint B
Filter
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Camel Cont.
activemq.queue.A activemq.queue.B
Filter
RouteBuilder builder = new RouteBuilder() {
public void configure() {
from(“activemq.queue.A”)
.filter(header(“type”).isEqualTo(“Widget”))
.to(“activemq.queue.B”);
}
};
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Camel Cont.
activemq.queue.A activemq.queue.B
Filter
<camelContext errorHandlerRef="errorHandler“
xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri=“activemq.queue.A"/>
<filter>
<xpath>/foo:person[@name='James']</xpath>
<to uri="activemq.queue.B"/>
</filter>
</route>
</camelContext>
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Camel Cont.
<route>
<from uri="timer://foo?fixedRate=true&amp;period=1000"/>
<to uri="bean:myBean?method=someMethodName"/>
</route>
o Example endpoints
o Queue
o Topic
o Timer
o Email
o Log
o Javabean
o FTP
o HDFS
o HTTP
o XSLT
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Source/Target Selectors
14
Field Example Values Purpose
Environment PROD, TEST, DEV The staging environment in the
promotional cycle
Data Center LAX, EC2 The data center where the
environment is located
Site Edmunds, InsideLine Defines the site as a set of
services
Application Digital Asset Manager,
Inventory Application
Deployment Unit
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Topic Selectors
15
Field Example Values Purpose
Type Publish, Audit, Control Defines the type of the message
Service Inventory, Pricing Type of data being send
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Producer / Consumer matching
Producer Consumer
Prod
Lax
Edmunds
Inventory
I am
Prod, Test
Lax, EC2
Edmunds
Dealer
Send To Prod
Lax, EC2
Edmunds
Inventory
I am
Test
EC2
Edmunds
Dealer
Receive From
Broker
Destination
Interceptor
Publish
Inventory
Publish
Inventory
Virtual
Topic
Name
Queue
Name
Match!
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Thrift: Data+Service+Strong Typing+
Versioning
namespace java com.edmunds.inventory.thrift.gen
struct Product {
1: string productType = "NCI",
2: map<string, string> vehicleDisplayInfo,
}
struct Inventory {
1: string id,
2: string vin,
3: string franchiseId,
4: map<string, string> edmundsAttributes,
5: list<Product> products,
}
service InventoryService {
oneway void removeInventory(1:Inventory inventory),
oneway void updateInventory(1:Inventory inventory),
}
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Thrift –– Camel Integration
Camel
Thrift
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Thrift –– Camel Integration: Sender
import org.apache.thrift.transport.TTransport;
public class ClientTransportImpl extends TTransport {
private SenderInternal senderInternal;
public void flush() throws TTransportException {
byte[] buf = writeBuffer.toByteArray();
writeBuffer.reset();
senderInternal.sendThrift(buf);
}
public class SenderImpl extends AbstractEndpoint implements Sender, SenderInternal,
InitializingBean {
public void sendThrift(Object object) throws Exception {
Map<String, Object> headers = initializeMessageHeaders();
headers.put("CamelBeanMethodName", "executeThrift");
headers.put("CamelJmsMessageType", getContext().getProtocol().getJmsMessageType());
doSend(object, headers, ReceiverImpl.getEntryEndpointName(getTopicSelectors().topicName()));
}
private void doSend(Object object, Map<String, Object> headers, String entryPointName) {
producerTemplate
.sendBodyAndHeaders(entryPointName, ExchangePattern.InOnly, object, headers);
}
}
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Thrift –– Camel Integration: Receiver
public class ReceiverService {
public void executeThrift(@Body byte[] byteArray, @Headers Map<String, String> headers)
{
enterMessageDeck.addHeaders(headers);
ReceiverInternal receiverInternal = (ReceiverInternal) callable.getReceiver();
receiverInternal.getContext().initialize(headers);
ProcessorTransportImpl processorTransport = new ProcessorTransportImpl();
TProcessor processor = findProcessor();
processorTransport.messageReceived(byteArray, processor, receiverInternal
}
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Creating Consumer
@Component(“inventoryConsumer")
public class InventoryConsumer extends AbstractDataHandler implements
InventoryService.Iface {
@Override
public void updateInventory(com.edmunds.inventory.thrift.gen.Inventory inventory) {
// perform your business logic here
}
<bean id="receiver" class="com.edmunds.eps.endpoint.impl.ReceiverImpl">
<property name="service" value=“inventory"/>
<property name="messageType" value=“publish"/>
<property name=“dataCenter" value=“lax"/>
<property name=“environment" value=“prod"/>
<property name=“site" value=“Edmunds"/>
<property name="application" value=“Search"/>
</bean>
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Creating Producer
// Inventory.Client is generated by Thrift
Inventory.Client inventoryClient = new Inventory.Client(sender.getProtocol());
inventoryClient.updateInventory( /*inventory object generated by Thrift*/ );
<bean id=“sender" class=“com.edmunds.eps.endpoint.impl.SenderImpl ">
<property name="service" value=“inventory"/>
<property name="messageType" value=“publish"/>
<property name=“dataCenter" value=“lax"/>
<property name=“environment" value=“prod"/>
<property name=“site" value=“Edmunds"/>
<property name="application" value=“Inventory-Source"/>
</bean>
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Throttling
getReceiver().getThrottler().setEnabled(true);
getReceiver().getThrottler().setMaximumRequestsPerPeriod(10);
getReceiver().getThrottler().setTimePeriodInMilliseconds(2000);
Camel:
Dynamically in Java:
receiver.throttler.enabled=true
receiver.throttler.maximumRequestsPerPeriod=10
receiver.throttler.timePeriodInMilliseconds=2000
Statically in property file using Spring PropertyOverrideConfigurer:
from(…).throttle(10).timePeriodMillis(2000).to(…)
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Retries / Error Handling:
free gift from Camel
getReceiver().getErrorHandler().setUseCollisionAvoidance(true);
getReceiver().getErrorHandler().setUseExponentialBackOff(true);
getReceiver().getErrorHandler().setDelayPattern("5:1000;10:5000;20:20000");
getReceiver().getErrorHandler().setUri("jms:queue:dead");
ExceptionHandler exceptionHandler = new ExceptionHandlerImpl(RegionException.class);
exceptionHandler.setHandled(true);
exceptionHandler.addException(ExceptionA.class);
exceptionHandler.setStop(true);
getReceiver().addExceptionHandler(exceptionHandler);
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Control System
25
Topic
Producer A
Producer B
Producer C
Control Message
o Control Message
o Initiates producer activity
o Bulk, Single and Multiple loads
o Indicates targets systems for publishing
o Decouples Producer logic form Clients of the publishing system
o Allows to initiate all publishing activity form a single point
o Can be sent from JMX or HTTP
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Heartbeat
26
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
High Level View
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Summary
o Simple to develop producers and consumers (library takes care of the
plumbing)
o Can deploy producers and consumers “anywhere”
o Can match producers and consumers at any level
o Handle error conditions, throttling
o Type safety
o Versioning
o HA & scalability
o Consumers: Virtual Topics, Queues
o Producers: Control System
o Broker: Network of Brokers
o Monitoring
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
We are hiring!
http://www.edmunds.com/help/about/jobs
No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such
disclosure requires the express approval of Edmunds Inc.
Q&A
Greg Rokita
grokita@edmunds.com

More Related Content

Similar to Best Practices for Architecting High Volume, High Performance Publishing for Data Intensive Website

Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...
Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...
Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...RowdMap has joined Cotiviti
 
Watson data platform_sofia_20171017
Watson data platform_sofia_20171017Watson data platform_sofia_20171017
Watson data platform_sofia_20171017Mladen Jovanovski
 
Globalization and VPEC-T
Globalization and VPEC-TGlobalization and VPEC-T
Globalization and VPEC-TRichard Veryard
 
PPL presentation 2010
PPL presentation 2010PPL presentation 2010
PPL presentation 2010SlimTrabelsi
 
PPL presentation 2010
PPL presentation 2010PPL presentation 2010
PPL presentation 2010SlimTrabelsi
 
Ppl presentation 2010
Ppl presentation 2010Ppl presentation 2010
Ppl presentation 2010SlimTrabelsi
 
Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...
Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...
Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...CA Technologies
 
Complex Analytics using Open Source Technologies
Complex Analytics using Open Source TechnologiesComplex Analytics using Open Source Technologies
Complex Analytics using Open Source TechnologiesDataWorks Summit
 
GDPR, ePrivacy Regulation, consent, and online media
GDPR, ePrivacy Regulation, consent, and online media GDPR, ePrivacy Regulation, consent, and online media
GDPR, ePrivacy Regulation, consent, and online media Johnny Ryan
 
Opening Keynote: Why Elastic?
Opening Keynote: Why Elastic?Opening Keynote: Why Elastic?
Opening Keynote: Why Elastic?Elasticsearch
 
1 3Financial Service Security EngagementLearning Team .docx
1     3Financial Service Security EngagementLearning Team .docx1     3Financial Service Security EngagementLearning Team .docx
1 3Financial Service Security EngagementLearning Team .docxoswald1horne84988
 
55 Must-Haves in Every Affiliate Manager's Toolbox
55 Must-Haves in Every Affiliate Manager's Toolbox55 Must-Haves in Every Affiliate Manager's Toolbox
55 Must-Haves in Every Affiliate Manager's ToolboxAffiliate Summit
 
DataOps @ Scale: A Modern Framework for Data Management in the Public Sector
DataOps @ Scale: A Modern Framework for Data Management in the Public SectorDataOps @ Scale: A Modern Framework for Data Management in the Public Sector
DataOps @ Scale: A Modern Framework for Data Management in the Public SectorTamrMarketing
 
OSCon 2011 Talk: The implications of open source technologies in safety criti...
OSCon 2011 Talk: The implications of open source technologies in safety criti...OSCon 2011 Talk: The implications of open source technologies in safety criti...
OSCon 2011 Talk: The implications of open source technologies in safety criti...Shahid Shah
 
Slide share cloudx_counsel ppt
Slide share cloudx_counsel pptSlide share cloudx_counsel ppt
Slide share cloudx_counsel pptMark Sanders
 
SecureDroid: An Android Security Framework Extension for Context-Aware policy...
SecureDroid: An Android Security Framework Extension for Context-Aware policy...SecureDroid: An Android Security Framework Extension for Context-Aware policy...
SecureDroid: An Android Security Framework Extension for Context-Aware policy...Giuseppe La Torre
 
Personium - Open Source PDS envisioning the Web of MyData
Personium - Open Source PDS envisioning the Web of MyDataPersonium - Open Source PDS envisioning the Web of MyData
Personium - Open Source PDS envisioning the Web of MyData暁生 下野
 
SIEM, malware protection, deep data visibility — for free
SIEM, malware protection, deep data visibility — for freeSIEM, malware protection, deep data visibility — for free
SIEM, malware protection, deep data visibility — for freeElasticsearch
 

Similar to Best Practices for Architecting High Volume, High Performance Publishing for Data Intensive Website (20)

Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...
Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...
Capturing Your Hidden Value: Using Newly Released Government Benchmark Data t...
 
Watson data platform_sofia_20171017
Watson data platform_sofia_20171017Watson data platform_sofia_20171017
Watson data platform_sofia_20171017
 
Globalization and VPEC-T
Globalization and VPEC-TGlobalization and VPEC-T
Globalization and VPEC-T
 
PPL presentation 2010
PPL presentation 2010PPL presentation 2010
PPL presentation 2010
 
PPL presentation 2010
PPL presentation 2010PPL presentation 2010
PPL presentation 2010
 
Ppl presentation 2010
Ppl presentation 2010Ppl presentation 2010
Ppl presentation 2010
 
Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...
Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...
Fines in the Millions Levied Every Year Coming Soon! The Business Case for ...
 
Complex Analytics using Open Source Technologies
Complex Analytics using Open Source TechnologiesComplex Analytics using Open Source Technologies
Complex Analytics using Open Source Technologies
 
GDPR, ePrivacy Regulation, consent, and online media
GDPR, ePrivacy Regulation, consent, and online media GDPR, ePrivacy Regulation, consent, and online media
GDPR, ePrivacy Regulation, consent, and online media
 
Opening Keynote: Why Elastic?
Opening Keynote: Why Elastic?Opening Keynote: Why Elastic?
Opening Keynote: Why Elastic?
 
Ftk install guide
Ftk install guideFtk install guide
Ftk install guide
 
1 3Financial Service Security EngagementLearning Team .docx
1     3Financial Service Security EngagementLearning Team .docx1     3Financial Service Security EngagementLearning Team .docx
1 3Financial Service Security EngagementLearning Team .docx
 
55 Must-Haves in Every Affiliate Manager's Toolbox
55 Must-Haves in Every Affiliate Manager's Toolbox55 Must-Haves in Every Affiliate Manager's Toolbox
55 Must-Haves in Every Affiliate Manager's Toolbox
 
DataOps @ Scale: A Modern Framework for Data Management in the Public Sector
DataOps @ Scale: A Modern Framework for Data Management in the Public SectorDataOps @ Scale: A Modern Framework for Data Management in the Public Sector
DataOps @ Scale: A Modern Framework for Data Management in the Public Sector
 
RowdMap Providers as Keys to Success
RowdMap Providers as Keys to SuccessRowdMap Providers as Keys to Success
RowdMap Providers as Keys to Success
 
OSCon 2011 Talk: The implications of open source technologies in safety criti...
OSCon 2011 Talk: The implications of open source technologies in safety criti...OSCon 2011 Talk: The implications of open source technologies in safety criti...
OSCon 2011 Talk: The implications of open source technologies in safety criti...
 
Slide share cloudx_counsel ppt
Slide share cloudx_counsel pptSlide share cloudx_counsel ppt
Slide share cloudx_counsel ppt
 
SecureDroid: An Android Security Framework Extension for Context-Aware policy...
SecureDroid: An Android Security Framework Extension for Context-Aware policy...SecureDroid: An Android Security Framework Extension for Context-Aware policy...
SecureDroid: An Android Security Framework Extension for Context-Aware policy...
 
Personium - Open Source PDS envisioning the Web of MyData
Personium - Open Source PDS envisioning the Web of MyDataPersonium - Open Source PDS envisioning the Web of MyData
Personium - Open Source PDS envisioning the Web of MyData
 
SIEM, malware protection, deep data visibility — for free
SIEM, malware protection, deep data visibility — for freeSIEM, malware protection, deep data visibility — for free
SIEM, malware protection, deep data visibility — for free
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Best Practices for Architecting High Volume, High Performance Publishing for Data Intensive Website

  • 1. Copyright Edmunds Inc. (the “Company”). All rights reserved. Edmunds®, Edmunds.com®, the Edmunds.com car design, Inside Linesm , CarSpacesm and AutoObserver® are proprietary trademarks of the Company. This document contains proprietary and/or confidential information of the Company. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Company, and any such disclosure requires the express approval of the Company. Best Practices for Architecting High Volume, High Performance Publishing for Data Intensive Web Site October 23th 2010 Greg Rokita Director, Sr. Architect Edmunds.com
  • 2. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Assumptions o Knowledge of Java o Basic understanding of Spring o Basic knowledge of JMS
  • 3. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Agenda o Common Enterprise Problems o Layered Architecture o ActiveMQ and Virtual Topics o Camel o Thrift & Versioning o Retry and Throttling mechanism o Monitoring o Q&A
  • 4. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Common Enterprise Problems o Multiple: o Environments (Prod, Test, Dev, etc) o Data Centers (Los Angeles, New York, Amazon EC2, etc) o Sites o Applications (Solr, Coherence, etc) o Data Sets (inventory, user data, pricing data, etc) o Data Format Changes o Components Fail
  • 5. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. What evolved from the efforts o Message o Delivery o Routing o Persistence o Durability o Retries o Throttling o Versioning o Monitoring ActiveMQ Camel Thrift
  • 7. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Publish Subscribe o Producers decoupled from consumers –– cool idea o JMS durable topics suck o message consumer is created with a JMS client ID and durable subscriber name o only one consumer can be active for a client ID and subscriber name o CAN’’T failover of the subscriber if that one process running that one consumer thread dies o CAN’’T load balancing of messages.
  • 8. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Virtual Topics Virtual Topic: VirtualTopic.Vehicle Queues: Consumer.Queue1.VirtualTopic.Vehicle Consumer.Queue2.VirtualTopic.Vehicle
  • 9. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Virtual Topics public class QueueDestinationInterceptor implements DestinationInterceptor { public synchronized Destination intercept(final Destination destination) { return new DestinationFilter(destination) { public void send(ProducerBrokerExchange context, Message message) throws Exception { if (applyFilterBasedOnMessageProperties(destination)) { return; } destination.send(context, message); } }; } } o Message is always send to ALL the queues o Solution: Destination Interceptor ActiveMQ plug in
  • 10. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Camel from(A).filter(header(““type").isEqualTo(““Widget")).to(B) Endpoint A Endpoint B Filter
  • 11. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Camel Cont. activemq.queue.A activemq.queue.B Filter RouteBuilder builder = new RouteBuilder() { public void configure() { from(“activemq.queue.A”) .filter(header(“type”).isEqualTo(“Widget”)) .to(“activemq.queue.B”); } };
  • 12. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Camel Cont. activemq.queue.A activemq.queue.B Filter <camelContext errorHandlerRef="errorHandler“ xmlns="http://camel.apache.org/schema/spring"> <route> <from uri=“activemq.queue.A"/> <filter> <xpath>/foo:person[@name='James']</xpath> <to uri="activemq.queue.B"/> </filter> </route> </camelContext>
  • 13. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Camel Cont. <route> <from uri="timer://foo?fixedRate=true&amp;period=1000"/> <to uri="bean:myBean?method=someMethodName"/> </route> o Example endpoints o Queue o Topic o Timer o Email o Log o Javabean o FTP o HDFS o HTTP o XSLT
  • 14. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Source/Target Selectors 14 Field Example Values Purpose Environment PROD, TEST, DEV The staging environment in the promotional cycle Data Center LAX, EC2 The data center where the environment is located Site Edmunds, InsideLine Defines the site as a set of services Application Digital Asset Manager, Inventory Application Deployment Unit
  • 15. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Topic Selectors 15 Field Example Values Purpose Type Publish, Audit, Control Defines the type of the message Service Inventory, Pricing Type of data being send
  • 16. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Producer / Consumer matching Producer Consumer Prod Lax Edmunds Inventory I am Prod, Test Lax, EC2 Edmunds Dealer Send To Prod Lax, EC2 Edmunds Inventory I am Test EC2 Edmunds Dealer Receive From Broker Destination Interceptor Publish Inventory Publish Inventory Virtual Topic Name Queue Name Match!
  • 17. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Thrift: Data+Service+Strong Typing+ Versioning namespace java com.edmunds.inventory.thrift.gen struct Product { 1: string productType = "NCI", 2: map<string, string> vehicleDisplayInfo, } struct Inventory { 1: string id, 2: string vin, 3: string franchiseId, 4: map<string, string> edmundsAttributes, 5: list<Product> products, } service InventoryService { oneway void removeInventory(1:Inventory inventory), oneway void updateInventory(1:Inventory inventory), }
  • 18. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Thrift –– Camel Integration Camel Thrift
  • 19. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Thrift –– Camel Integration: Sender import org.apache.thrift.transport.TTransport; public class ClientTransportImpl extends TTransport { private SenderInternal senderInternal; public void flush() throws TTransportException { byte[] buf = writeBuffer.toByteArray(); writeBuffer.reset(); senderInternal.sendThrift(buf); } public class SenderImpl extends AbstractEndpoint implements Sender, SenderInternal, InitializingBean { public void sendThrift(Object object) throws Exception { Map<String, Object> headers = initializeMessageHeaders(); headers.put("CamelBeanMethodName", "executeThrift"); headers.put("CamelJmsMessageType", getContext().getProtocol().getJmsMessageType()); doSend(object, headers, ReceiverImpl.getEntryEndpointName(getTopicSelectors().topicName())); } private void doSend(Object object, Map<String, Object> headers, String entryPointName) { producerTemplate .sendBodyAndHeaders(entryPointName, ExchangePattern.InOnly, object, headers); } }
  • 20. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Thrift –– Camel Integration: Receiver public class ReceiverService { public void executeThrift(@Body byte[] byteArray, @Headers Map<String, String> headers) { enterMessageDeck.addHeaders(headers); ReceiverInternal receiverInternal = (ReceiverInternal) callable.getReceiver(); receiverInternal.getContext().initialize(headers); ProcessorTransportImpl processorTransport = new ProcessorTransportImpl(); TProcessor processor = findProcessor(); processorTransport.messageReceived(byteArray, processor, receiverInternal }
  • 21. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Creating Consumer @Component(“inventoryConsumer") public class InventoryConsumer extends AbstractDataHandler implements InventoryService.Iface { @Override public void updateInventory(com.edmunds.inventory.thrift.gen.Inventory inventory) { // perform your business logic here } <bean id="receiver" class="com.edmunds.eps.endpoint.impl.ReceiverImpl"> <property name="service" value=“inventory"/> <property name="messageType" value=“publish"/> <property name=“dataCenter" value=“lax"/> <property name=“environment" value=“prod"/> <property name=“site" value=“Edmunds"/> <property name="application" value=“Search"/> </bean>
  • 22. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Creating Producer // Inventory.Client is generated by Thrift Inventory.Client inventoryClient = new Inventory.Client(sender.getProtocol()); inventoryClient.updateInventory( /*inventory object generated by Thrift*/ ); <bean id=“sender" class=“com.edmunds.eps.endpoint.impl.SenderImpl "> <property name="service" value=“inventory"/> <property name="messageType" value=“publish"/> <property name=“dataCenter" value=“lax"/> <property name=“environment" value=“prod"/> <property name=“site" value=“Edmunds"/> <property name="application" value=“Inventory-Source"/> </bean>
  • 23. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Throttling getReceiver().getThrottler().setEnabled(true); getReceiver().getThrottler().setMaximumRequestsPerPeriod(10); getReceiver().getThrottler().setTimePeriodInMilliseconds(2000); Camel: Dynamically in Java: receiver.throttler.enabled=true receiver.throttler.maximumRequestsPerPeriod=10 receiver.throttler.timePeriodInMilliseconds=2000 Statically in property file using Spring PropertyOverrideConfigurer: from(…).throttle(10).timePeriodMillis(2000).to(…)
  • 24. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Retries / Error Handling: free gift from Camel getReceiver().getErrorHandler().setUseCollisionAvoidance(true); getReceiver().getErrorHandler().setUseExponentialBackOff(true); getReceiver().getErrorHandler().setDelayPattern("5:1000;10:5000;20:20000"); getReceiver().getErrorHandler().setUri("jms:queue:dead"); ExceptionHandler exceptionHandler = new ExceptionHandlerImpl(RegionException.class); exceptionHandler.setHandled(true); exceptionHandler.addException(ExceptionA.class); exceptionHandler.setStop(true); getReceiver().addExceptionHandler(exceptionHandler);
  • 25. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Control System 25 Topic Producer A Producer B Producer C Control Message o Control Message o Initiates producer activity o Bulk, Single and Multiple loads o Indicates targets systems for publishing o Decouples Producer logic form Clients of the publishing system o Allows to initiate all publishing activity form a single point o Can be sent from JMX or HTTP
  • 26. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Heartbeat 26
  • 27. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. High Level View
  • 28. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Summary o Simple to develop producers and consumers (library takes care of the plumbing) o Can deploy producers and consumers “anywhere” o Can match producers and consumers at any level o Handle error conditions, throttling o Type safety o Versioning o HA & scalability o Consumers: Virtual Topics, Queues o Producers: Control System o Broker: Network of Brokers o Monitoring
  • 29. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. We are hiring! http://www.edmunds.com/help/about/jobs
  • 30. No part of this document or the information it contains may be used, or disclosed to any person or entity, for any purpose other than advancing the best interests of the Edmunds Inc., and any such disclosure requires the express approval of Edmunds Inc. Q&A Greg Rokita grokita@edmunds.com