MongoDB at Agilysys: A Case Study

20
TECHNOLOGY | INNOVATION | SOLUTIONS Larry Steinberg (CTO) & Alessandro Muti (EA)

description

When Agilysys, a leading provider of software solutions for the hospitality industry, decided to architect the next generation platform for their software to unify lines of business it choose MongoDB as the data store at the heart of the system. The Agilysys suite of hospitality products spans lodging and food & beverage; providing solutions for point of sale, property management, workforce management, and inventory and procurement, perfect for use with the flexible JSON document model in MongoDB. Agilysys solutions now use a single store with related data from otherwise disconnected applications, allowing each application and line of business to operate independently. Simultaneously, the Agilysys rGuest suite of hospitality products has the capability to correlate and analyze patterns and behavior of guests across systems to improve their experience when staying in property.

Transcript of MongoDB at Agilysys: A Case Study

Page 1: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

Larry Steinberg (CTO) & Alessandro Muti (EA)

Page 2: MongoDB at Agilysys: A Case Study

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

Page 3: MongoDB at Agilysys: A Case Study

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

Page 4: MongoDB at Agilysys: A Case Study

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

Page 5: MongoDB at Agilysys: A Case Study

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

Page 6: MongoDB at Agilysys: A Case Study

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

Page 7: MongoDB at Agilysys: A Case Study

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

Page 8: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The simple case - 1 Class = 1 Document

Page 9: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The simple case - 1 Class = 1 Document

Page 10: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The simple case - 1 Class = 1 Document

Page 11: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The simple case - 1 Class = 1 Document

Page 12: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The simple case - 1 Class = 1 Document

Page 13: MongoDB at Agilysys: A Case Study

The Flexible Document ModelMany Classes = 1 document

?

Page 14: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The Flexible Document ModelMany Classes = 1 document

Page 15: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The Flexible Document ModelMany Classes = 1 document

Page 16: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The Flexible Document ModelMany Classes = 1 document

Page 17: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

The Flexible Document ModelMany Classes = 1 document

Page 18: MongoDB at Agilysys: A Case Study

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

Page 19: MongoDB at Agilysys: A Case Study

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

Page 20: MongoDB at Agilysys: A Case Study

TECHNOLOGY | INNOVATION | SOLUTIONS

Questions?

?