Tuesday, March 7, 2017

Choosing a HTML5 Web Toolkit for Flex 5

We just posted "Choosing a HTML5 Web Toolkit for Flex 5" blog post on our main corporate site. In this blog, I talk about how & why we choose the HTML5 toolkit that we did and our "mobile first" approach to Flex 5.

The link is below. Enjoy!

Choosing a HTML5 Web Toolkit for Flex 5

Flex 5: Everything you’ve been wanting to know

We posted our first Flex 5 blog post on our main corporate website the other month. I'm re-posting the blog link here so that folks following this blog will be aware of it.

We plan to post all the Flex 5 blog series on the main corporate blog, and repost the links here. We will still post engineering blogs here, but since Flex 5 is an important topic to our customers, we wanted to post the Flex 5 blog series on our main website.

Without any further ado, here is first Flex 5 blog post:

Flex 5: Everything you’ve been wanting to know

Friday, January 20, 2017

We are hiring Full Stack Engineers!

We are hiring full stack engineers to help us build out the new Flex 5 platform! The job description is posted below. While the job description states we are seeking candidates that are close enough to Carlisle, PA to commute to the office once a week, we will consider candidates from anywhere in the United States if you have industry experience (e.g. you have used Flex software, worked in the AV industry, etc).

If you are interested or know somebody that is, please go to our job post at Indeed and apply asap!

Regarding Flex 5 development, we are planning to start a blogging series soon to flush out all the exciting things we have been doing with Flex 5 over the last while! Stay tuned!


Job Description

We are looking for developers to join our growing engineering team.
We are looking for developers to help build out our exciting next generation SaaS platform. Our engineering office is located in Carlisle, PA. We are looking for local or semi remote candidates with the ability to commute to Carlisle once a week.

Our developers work up and down the stack. We have developers that prefer backend or frontend development. We think it’s awesome to have a forte, however, all of our developers are expected to be able to work anywhere in the stack to get things done.

We integrate our code regularly and ship often. We believe in short incremental development cycles so we expect our developers to be committing code at least daily. Our next generation platform is being driven by automated tests and a continuous deployment philosophy. We expect developers to work autonomously, and want candidates with an ability to identify, communicate, and solve problems.

Skills & Requirements

You are fluent with the JVM ecosystem. You will write code in Groovy, Java, JavaScript, & SQL but you are open minded about other languages & ecosystems. You know something about ORM’s such as Hibernate and the tricky tradeoffs that come along with them. It is normal for you to not use the ORM for everything and write pure SQL for complex queries. You know something about Spring Boot and have coded on Spring applications before.

You are an avid unit tester. You already practice test driven development, primarily with unit tests. It is normal for you to commit code with accompanying unit tests. You are able to articulate principles of unit testing to other team members.

You view yourself as a software craftsman. You are constantly improving your craft and know how to stay relevant in the changing technology landscape. You embrace failure as a learning opportunity. You love collaboration and transparency. You look for simple solutions to complex problems.

You are self motivated. At Flex, we won’t tell you when to work. We just expect that you’ll love coding and will naturally have a bias towards getting things done.

You value agile & lean development. At Flex, we don’t subscribe to dogmatic views on agile processes. We happen to use some elements of Scrum but really we just value fast feedback, collaboration, quick iterations, test driven development, continuous integration & deployment.

About Flex Rental Solutions

Our team of dedicated engineers develops rental and event management software for over 600 business customers from all over the world. Our customers are primarily within the Professional Audio Visual, Concert Touring, Live Event, Staging, and Production market segments. Flex offers a flexible and dynamic work environment, opportunity to work on interesting projects and technical challenges, paid company holidays, paid vacation, and health, dental, and vision insurance, along with other benefits.

Monday, November 7, 2016

Making Flex Faster

Speed is something that is one of the top engineering priorities at Flex even as we transition more and more effort towards the Flex 5 HTML5 rewrite effort. We recognize and understand that as awesome as it will be to one day be free from the old Flex 4 Flash-based platform, our users still need to get their work done between now and then.

Speed is something that we have been making small incremental improvements on most releases throughout this year, but it is something that is difficult to really move the needle on. We have also worked on memory leak issues, but those tend to be quite a bit easier. Normally with memory leaks you just take a memory snapshot of a customer who is struggling with memory leaks, and with a little detective work with a tool like YourKit, you can usually find what is hogging the memory and somewhat easily make a fix. Speed is completely different ballgame, as it's hard to get good visibility and the fixes are much more difficult and time consuming.

For us, our speed issues revolve almost entirely around database IO (input/output). Most of the time it's one of the following type of problems.

  • N+1 SQL queries. Queries in a loop, where you get one database trip per iteration in a loop.
  • Large SQL queries. Just sheer size, like many MB's of SQL output.
  • Bad SQL queries. E.g. lack of indexes, bad joins, etc

Focused Speed Work

In light of all this, back in late September we spent at least a week of focused developer time to try to get some speed relief on some targeted high use areas of Flex. We started by having the support team compile a list of top slow areas from customers. Development then took that detailed information and began the process of trying to understand what was really happening in those slow areas.

So even while we have known about these problems for some time, the fixes are not so straightforward. The reasons for this is a bit hard to explain, but the short answer is we have a huge domain model (think all the many tables & fields in the database) and use an ORM (Object Relation Mapper) tool called Hibernate inside our Java application that maps database tables & columns to Java objects.

Hibernate is a "great" tool when you start because it allows a developer to rapidly add new tables & fields and the SQL for them will automatically be generated when you ask the database for something (such as a Quote or Inventory Item). However this really accumulates over time and gets completely out of hand. You might just be after one or two fields from a table for your business logic, but Hibernate will fetch everything because it has no idea what we are really after. 

In the end, you just end up with tons of overhead with the database getting absolutely hammered with sheer amounts of SQL (e.g, I've seen 30MB or greater of SQL generated for a single line item edit action) which in the end is mostly of no use and just gets garbage collected inside the Java application.

So again, we've known for awhile what the general problems are. The problem is getting the right kind of visibility and even knowing what to change to help it.

The Breakthrough

The breakthrough back in September was bringing in a tool called P6Spy. It's an open source tool you can plugin without the application even knowing about it. Basically it intercepts all of the raw SQL that is being sent to the database. It has many configuration options, but one of the coolest settings you can enable is the application stack trace. With that enabled, in addition to being able to see the raw SQL output, you can see the exact line of code inside of the application that generated the SQL!

With this in place, it was like we suddenly had eyes into what was going on. We rapidly discovered some obvious issues, like some unexpected N+1 select issues that were going on. Usually these fixes involved some caching tweaks so that a database hit wasn't needed or moving find by id fetches into some kind of one time batch fetch.

Collection Batching

We fixed those obvious ones and then moved onto other improvements. Specifically, we started doing "collection batching". Let me explain... in the application you can have a Java domain object with a collection hanging off of it (e.g. an Inventory Item has a collection of Serial Numbers) and with Hibernate those are always lazily loaded by default. That means you could pull that item from the database, but the serial numbers won't load from the database until you actually call getSerialNumbers() on the item object.

This is fine sometimes, but what if you were looping over 1000 inventory items? Yeah, you'd be hitting the database every time you call getSerialNumbers() on an inventory item. That is what we call an N+1 select issue, and they are an absolute performance hog.

The nice thing is we discovered a little known Hibernate setting known as "collection batching". What this means, is say you have the serial number collection as above, but you set the collection batching size on the collection to say 100, when you call getSerialNumbers() it will fetch up to 100 other serial number collections (that are already in the Hibernate session) in a single call. This means for the 1000 inventory items, you might only get 10 hits to get all the serial numbers. See https://docs.jboss.org/hibernate/orm/3.3/reference/en-US/html/performance.html#performance-fetching-batch for more info on this batch size setting. 

That is a factor of 100 reduction in database trips, instead of 1000 individual hits it might be as low as 10 trips for all the serial number collections. This was a huge breakthrough and we implemented this strategy in key document editing areas.

We rolled out out these multiple speed fixes in version 4.18.2 in mid-October. We have have heard directly that it is faster, specifically with document editing, which is exactly what we were after.

Where do we go from here?

Monitoring is our next big step. We have set up a tool stack with InfluxDB, Grafana, and Telegraf that will collect metrics sent from Flex. We have version 4.19.0 queued up for deployment this week. With that release, Flex will begin shipping metrics to this new tool stack. We will be able to setup dashboards that will get us all kinds of different types of visibility into the application. We will use this info to make more targeted fixes. 

So we intend to rinse & repeat with targeted fixes, until we get Flex 4 to reasonable speed levels in the "day to day" high use areas. With the Flex 5 rewrite, we are contemplating a whole new way of database access which will be fast and be the ultimate solution to Flex 4's speed woes.

Hopefully we'll have a blog post here in the future on the new monitoring/metric tool stack and the results we get from that! Stay tuned!

Saturday, September 24, 2016

The Engineering Blog is Back!

We are bringing back this engineering blog as a dedicated place to talk about some of the behind the scenes engineering at Flex. We have a lot of exciting things to post about in the coming weeks and months! First up is a post on Flex speed and what we are doing to make Flex faster! Stay tuned!

Monday, May 5, 2014

New QuickBooks Online Integration is here

With the Flex 4.8 version that was recently deployed, comes the new QBO (QuickBooks Online) integration. If you have been using the QBO integration, you can start using this right away. However, switching over is not automatic, there is a bit of effort required on your part to switch over. If you are not currently using QBO integration, contact support to get started.

Here is a basic "getting switched over" video: http://www.screencast.com/t/AJKeatxHF4

The basic steps for switching over are this:
  1. Go to Financials > Accounting Integration 
  2. Basic Settings tab > Enabled Accounting Systems: Change selection from "QuickBooks Online Legacy" to "QuickBooks Online". Click Update to Save.
  3. QuickBooks Settings tab in QuickBooks Online area, click the "Connect to QuickBooks" button
  4. Follow prompts to sign in & authorize
  5. At this point, the QuickBooks Settings tab should show that you are connected
Once connected, you will continue to push documents as you did before. There are a few things that you need to be aware of:


Your Flex tax rule name now needs to precisely match a QuickBooks Online Tax Code. For a United States example, you may have a tax code called "PA Sales Tax". For international, you might have a tax code called "HST". You need to name your Flex tax rule name the exact same name as the tax code. 

Flex will not (actually it can not) create or update any tax settings in QuickBooks Online. This means you must take care to make sure your Flex tax rates & QuickBooks Online tax rates mirror each other & keep them in sync if they change.

Updating Documents

Previously it was not possible to actually update documents. So, for a re-export, we had to actually delete the document, and then recreate it. We now have the ability for documents to be updated which happens automatically if you've already pushed the document before. This is a great enhancement because now any links that are created in QBO between documents will not be erased when you re-export an document.

Integration Errors

If you push a document and it does not show in QBO, be sure to first check Systems Settings > Integration Bus > Integration Bus Error Screen. It will show you any errors that have happened in the Integration Process. Sometimes the error message can be a little cryptic so if you can't figure it out, ask support for help.

More to Come

The previous integration did not support Purchase Order's at an API level. The new integration supports PO's but we have not implemented it yet due to the fact we were focused replacing what we had first. We should be rolling that out sometime this year.

GL Account sync has NOT been re-implemented for the new QBO integration yet but we will be bring that back as well sometime this year.

We know there are more features that customer's will need but we are happy that we are back on the right path for integrating with QBO. As important features come to our attention we will implement them. This new API is much more feature rich which will allow us to create a much better integration.

Old Integration Cutoff

As of this writing the cutoff for the old API is May 15, 2014. However, I believe that is contingent on you upgrading to the new "harmony" QuickBooks Online. Once you upgrade to "harmony",  the old API will no longer work.

If you have any questions or concerns, contact support@flexrentalsolutions.com. Happy Integrating!

Saturday, March 29, 2014

New Faces at Flex

Last summer Flex opened its first physical office in Richland, Washington.  Intended primarily to house our engineering and software development efforts, our decision to open it up to the local tech community for coworking and speaking events has brought us into contact with some amazing local people we wouldn't have known about otherwise.

Here's a rundown of some people that have recently joined our team.

Erik Ralston

Late last year we hired Erik Ralston and since then he's been working full time on our IOS applications, both for the iPhone and the iPad.  He'll be at Infocomm in just a few months to unveil what we have so far.

Maria Barker

With four full time developers cranking out code and with IOS apps and Label Ninja on the way, we felt it was high time we gave Courtney a little help with QA.  To fill this role, we hired Maria Barker, whose accounting background has made it possible to have an accounting specialist testing our financial module and accounting system integration.  She's also taken over as Controller and has whipped our books into shape in short order.

Becca Lingley

Our number one problem right now is coping with and managing growth.  We need to formalize some of our processes, increase consistency of the customer experience, and just step our game up in general.  After consulting with us for a few months, we decided to bring Becca on permanently as Director of Operations.  She brings a deep business background to the table with an MBA under her belt and just a dissertation away from a PhD.  We need to get better at everything we do while managing a high level of growth and it will be Becca's job to help guide us through that.

Branden Rosenlof

A long running complaint of Flex customers is the lack of documentation  It's a perfectly legitimate complaint and we've finally done something about it by bringing on a dedicated Technical Writer.  Branden has already done a great job on our Starter Kit and is currently working on a full documentation set for Flex.  He'll also be heavily involved over the next few months as Flex revamps and improves our training offerings.

Coping With Growth

We've brought on all these new faces because we still have a lot of unfinished business and plenty of challenges that come with growth.  We need to improve the quality and consistency of everything from the software itself to the sales process to training and support.  We also need to prepare ourselves for the next wave of hiring and ensure that we're ready to bring new people on and get them up to speed quickly when they arrive.

We're also updating our web site for Infocomm, launching IOS applications and working on a ground breaking barcode label design and printing solution, Label Ninja.  To that add multi-session event support, in system credit card processing, recurring billing, major improvements to Quickbooks integration, a new high availability fault tolerant architecture - and most of all, making Flex fast.

We'll publish a formal roadmap in the next few months so customers can keep tabs on exactly what we're working on and when, but the take away is that we have a lot left to do and are staffing up to do it.