DogWatch® Mobile App

Context:

Our client, DogWatch®, provides a full line of pet fences and dog training products, such as hidden fence systems for dogs.  In order to provide their customers with real-time access to their SmartFence® systems and to improve user experience, they wanted to replace their legacy system with a cloud-based application, supporting Android, iOS and web platforms, with a specific focus on mobile. 

In addition, our customer was confronted with reduced reliability and increasing maintenance costs, as the volume of users on their legacy system grew.  This was a result of a system that evolved over time, as it was constructed by a number of disparate programmers and used several different technologies.  In order to reduce overall maintenance costs, they wanted to consolidate their systems to a single backend using a consistent set of technologies.

Why did DogWatch® choose BCA?  BCA offers full-stack software development, supported by a permanent staff of skilled engineers. Our collaborative environment ensures that our team’s expertise and experiences are continually shared, not only among ourselves but also with our valued clients.  This unified approach streamlines communication, enhances efficiency, and fosters a cohesive development process. By choosing BCA, DogWatch® gains the advantage of a dedicated team working seamlessly together, providing a holistic solution and ensuring a smooth and integrated development experience.

Initially, DogWatch® engaged us to help maintain an existing system that was approaching the end of its useful life.  During our initial engagement, DogWatch® recognized our engineering approach to finding the root cause of issues and architecting solutions, making us the perfect design group to replace their legacy system.  We collaborated closely with their team to understand their requirements, enabling us to present an elegant and cost-effective solution.

Solution:

To meet our customer’s requirements, we developed a system that leverages Amazon Web Services (AWS) for the backend infrastructure. The frontend user interface was built using Flutter, an open-source framework created by Google. Flutter allows us to create natively compiled applications that run seamlessly across mobile, web, and desktop platforms, all from a single codebase.

Why did BCA choose a cross-platform framework for this application rather than native environments?  While we design native mobile applications for customers, such as the use of Android Studio IDE with Java or Kotlin for Android apps or Xcode IDE with Swift for iOS apps, we chose a cross-platform solution for DogWatch®.  Our engineers have experience with various programming languages and technologies.  In the field of engineering, it’s common for a single problem to have multiple potential solutions. During the early stages of development, our role is to explore these solutions and carefully evaluate their pros and cons. In this case, our customer’s requirement was clear: they needed the application to reach a broad audience across multiple platforms, including Android, iOS, and web. While native environments offer unique advantages, such as platform-specific features and highly optimized performance, these capabilities were not required for this application, as the capabilities and performance provided by Flutter were more than sufficient. Therefore, opting for a cross-platform framework for this project turned out to be an excellent decision. It not only saved them time and development money but also ensured a consistent and seamless user experience for their end-customers.

Database Design

The application’s design aimed for adaptability and future-proofing. To achieve this, we meticulously integrated DynamoDB, a NoSQL database known for its scalability and flexibility. Given the absence of rigid schema requirements, opting for a non-relational database enabled us to anticipate and accommodate attribute changes over time. Cleverly designed NoSQL databases, like DynamoDB, effortlessly adapt to changes over time, sparing you from extensive maintenance. BCA’s expertise ensures you enjoy this flexibility without compromising data access efficiency. Our careful design approach ensures that DynamoDB effectively aligns with the dynamic needs of the application, providing a robust foundation for seamless scalability and efficient data management.

Real-Time Data Management

The application captures real-time data from field devices, storing event data in an AWS Timestream database. A time series database like Timestream was ideal for this use case, as it could handle the high volume of transactions and allowed performing efficient queries on data within a given time range. This proved valuable in generating graphs within the front-end application that display the activity data recorded from the devices.

Scalability

The application connects to REST services written in JavaScript, deployed on a NodeJS environment under Elastic Beanstalk (EBS). Anticipating and embracing the expectation for growth, EBS is configured for auto-scaling, dynamically adjusting the number of server instances to handle varying server loads. This not only ensures optimal performance for requests from the app but also positions our infrastructure to seamlessly scale as our user base expands. EBS’s flexibility, automated management, and integration with AWS services contribute to a robust and adaptable foundation, essential for accommodating the evolving needs and anticipated growth of our customers’ application over time.

Handling Device Messages

Also, the system must receive device status communications from SmartFence devices configured in the field.  These communications are received from the devices via an HTTP request.  In order to process device communications and scale to handle increased communication volume, our solution uses AWS Lambda, which provides serverless functions that are initiated based on some defined event. Along with being triggered by HTTP requests, the application also makes use of Lambda functions that are triggered by modifications to DynamoDB tables.

The Lambda functions (written in JavaScript) handle requests and notify users if there are any problems with their SmartFence devices.  Lambda functions are ideal for handling this use case. Each incoming request will initiate its own instance of the Lambda function and terminate when processing is complete.  This provides a scalable approach to handling concurrent requests because each request will initiate its own instance of the function.

Push Notifications

The legacy system could send alerts via SMS and email, but not as push notifications since there was no mobile application. The application supports push notifications on Android and iOS devices through AWS Simple Notification Service (SNS), integrated with Google’s Firebase Cloud Messaging (FCM) for real-time updates and alerts. FCM is a popular choice, and it integrates well with both SNS and Flutter. Since the push notifications allowed for users to get alerts straight to their phones, it was determined that the more expensive SMS notifications were no longer needed, which reduced costs for DogWatch®.

File Storage

Amazon Simple Storage Service (S3) was used to store both user-generated files and static resources associated with the application. The user- generated files consist of images that can be uploaded and associated with a user’s pets, while the static resources are public and displayed in alert emails.

Conclusion:

In the final stages, we successfully launched the cloud-based application on Android, iOS, and web platforms, expanding user access. Leveraging our full-stack expertise and cloud infrastructure, we seamlessly migrated customers and their data from the legacy system. By consolidating DogWatch®’s systems to a single backend using a consistent set of technologies, the new system not only reduces maintenance costs by 60% but also positions DogWatch® for future growth and enhancements.

At BCA, our design group’s engineering thought process and cohesive design methodology played a pivotal role in crafting a system that is not only highly maintainable, resulting in lower ongoing costs, but also allows for seamless expansion in both user base and features. This approach ensures an excellent user experience across various phone platforms. The success of this project speaks to the benefits of our holistic design approach. As a testament to our ongoing commitment, we continue to support DogWatch® with feature updates to their new system, providing long-term value and adaptability to their evolving needs.

DogWatch

When I joined DogWatch a few years ago, BCA had picked up support for an older project originally done by a disparate group of developers that spanned embedded code through web backends. BCA was able to dig into the system and keep it afloat until we were able to settle on a whole new backend strategy using AWS and a mobile app. Rollout of the new system has been smooth, due to their careful work and testing.

During the development of that system, we had a difficult embedded project requiring signal processing in an ultra-low power real-time system. Given their ongoing success, I decided to have them work on that embedded code as well, handing them piece after piece as they proved that they could deliver quality solutions.

BCA is a valued partner in our development projects!

Mark DesMarais | Director of Engineering | DogWatch