mongodb at agilysys: a case study
Post on 01-Nov-2014
199 Views
Preview:
DESCRIPTION
TRANSCRIPT
TECHNOLOGY | INNOVATION | SOLUTIONS
Larry Steinberg (CTO) & Alessandro Muti (EA)
TECHNOLOGY | INNOVATION | SOLUTIONS
Premier Hospitality Software Provider
• Nasdaq: AGYS
• Agilysys is a leading pure-play provider of software-enabled solutions for the hospitality industry
• Offering includes a full suite of hospitality products, including point-of-sale (POS) and property management systems (PMS)
• Base of 3,000+ customers with 95% retention rate
• 490+ employees world wide
• Engineering headquarters in Bellevue WA with 75 engineers; growing to 100+
• Aggressively investing in next generation solutions
TECHNOLOGY | INNOVATION | SOLUTIONS
Guest Lifecycle Driving Vision
Discover
Customer Lifecycle
Reserve
Pay
Suggest
Order
Analyze
Procure
Staff
Market
Arrive
Current Offering Future Offering
Experience
Pre-Visit
Reserve
Discover
Book
Staff
Procure
Staff Order Pay
OrderStaff
Analyze Procure Order Pay
Arrive Experience
Reserve
Analyze Procure
ExperienceArrive
Order Pay Order Pay
Staff Suggest
Suggest
Suggest
Pay
Market
SPABACK OFFICE RESTAURANT
CASINOFRONT DESKBACK OFFICE
TECHNOLOGY | INNOVATION | SOLUTIONS
Hospitality Technology Drives the Guest Experience
Integrated Guest Experience
Point-of-SaleProperty
ManagementInventory and Procurement
Workforce Management
Next Gen Tenets
SaaS delivery
Multi tenant &
High density
Common platform
Native Product
Integration
Centralized data store
Technology Stack
Linux
Java/Spring
Scala
MongoDB
Apache CXF
OptaPlanner
Drools
TECHNOLOGY | INNOVATION | SOLUTIONS
Why MongoDB – the Business view
The Business Problem • Building a Platform
• Requirements coming at different points in the lifecycle
• Schema less approach better enables change over ti
Flexibility • Licensing
• Deployment – on premise, cloud, appliance
• Supported with our standard devops toolset – ansible
Distributed architecture
• Hybrid – Cloud offering + On Site Appliance
• Geographically dispersed
• Scale
TECHNOLOGY | INNOVATION | SOLUTIONS
Why MongoDB – the Technical View
• Document based repository• The document paradigm fits well with the logical aggregation of our
modular components• Great integration between user interface and services
• JSON is a great data interchange format • For services that don't have business logic allows us to go directly
from the backend to the front end with minimal time spent converting into intermediate objects
• De-normalization of data allows us to group relevant information in document that require little manipulation
• High Performance and High Availability• Replica sets and automatic failover
• Scalability• Sharding provide easy way to scale data load
TECHNOLOGY | INNOVATION | SOLUTIONS
The simple case
• Using Spring Data Framework to write to MongoDB• 1 Class = 1 document
• MongoTemplate is the Spring wrapper to the Mongo Java driver• Awesome Helper Classes
• Aggregation, Criteria, Query, Update• Lots of pre-build repositories implementations
• CRUD Repositories, PagingAndSortingRepository, …• Annotations to decorate your class
• Indexed, Field, Value, Id, DBRef,…• Lifecycle management• Automatic Query Builder
TECHNOLOGY | INNOVATION | SOLUTIONS
The simple case - 1 Class = 1 Document
TECHNOLOGY | INNOVATION | SOLUTIONS
The simple case - 1 Class = 1 Document
TECHNOLOGY | INNOVATION | SOLUTIONS
The simple case - 1 Class = 1 Document
TECHNOLOGY | INNOVATION | SOLUTIONS
The simple case - 1 Class = 1 Document
TECHNOLOGY | INNOVATION | SOLUTIONS
The simple case - 1 Class = 1 Document
The Flexible Document ModelMany Classes = 1 document
?
TECHNOLOGY | INNOVATION | SOLUTIONS
The Flexible Document ModelMany Classes = 1 document
TECHNOLOGY | INNOVATION | SOLUTIONS
The Flexible Document ModelMany Classes = 1 document
TECHNOLOGY | INNOVATION | SOLUTIONS
The Flexible Document ModelMany Classes = 1 document
TECHNOLOGY | INNOVATION | SOLUTIONS
The Flexible Document ModelMany Classes = 1 document
TECHNOLOGY | INNOVATION | SOLUTIONS
Agilysys Data Access Layer
• Extended Spring Data MongoTemplate• added methods to deal with updates to arrays• wrapped multiple calls to the database into a single atomic method• Helper functions to map Model to Domain
• Most calls to the database show a pattern• Query to find the document with the data• Morph the document and transform to match the domain object• Map the resulting JSON back to the appropriate Class
• Use JSONPath to find values in subDocuments
TECHNOLOGY | INNOVATION | SOLUTIONS
Lesson Learned
• Understanding the pattern for data access is very important• Look at your data and don't think about it in terms of relations,
de-normalization and duplication are not as bad of an issue as generally thought
• In the flexible document model the hardest objects to deal with are arrays, at least for now, use them carefully
• TextSearch is not yet strong enough for flexible documents, JSONPath can help
• For the cases where a data redesign was not enough to ensure that all the atomic elements of an update are in the same collection, then a strategy like 2 phase commit and application managed states are necessary. Think hard about the problem before deciding on a document design
TECHNOLOGY | INNOVATION | SOLUTIONS
Questions?
?
top related