MemSQL Meets the Microservices Architecture
See what MemSQL has been up to in the microservices realm, such as connecting to for JSON storage and diagramming best practices in microservices isolation with newSQL.
Join the DZone community and get the full member experience.Join For Free
microservices use distributed computing to isolate and scale application service components, and this is the hot trend for application development. memsql sees this trend continuing because of the prolific increase of real-time applications. these applications require deep analytics and a strategy for manageable components delivering speed and scale.
each application service component has its own independent service deployment and flexible data model. the goal is to allow developers to focus on building business logic rather than coordinating with corporate models and infrastructure constraints.
microservices has promise for improving developer productivity but also has known drawbacks that need to be addressed. decisions and struggles with microservices include distributed transactions, eventual consistency, and high-performance analytics. one approach to addressing these challenges is to define the most appropriate data repository for your services, which also provides the flexibility to modify the data model at a service level while also delivering high performance joins to other objects. in addition, the repository will also need to provide high-performance analytics across all the data within a domain.
by making a few base decisions and leveraging memsql as the data repository a highly flexible, scalable and performant solution can be delivered. the first choice is to leverage a single database table per service. the second choice is to leverage json as the model for your service data.
memsql and microservices architecture
how the components work together:
- each service is independent and scales by adding nodes.
- services manage and use data within a json object.
- services persist json objects to memsql.
- memsql indexes and stores the json in memsql tables.
- memsql scales by adding either aggregator and/or leaf nodes.
- analytics tools use sql to query the json data.
- convert to computed sql columns from json for speed improvements.
memsql has extended its sql to support the traversing of json objects as well as the extraction of data from a json object so it can be fully indexed. additionally, once indexed, it can also deliver fast, distributed join performance across memsql tables. microservices addresses performance and scale of independent services; by adding memsql you also get high-speed analytics, transactions and sql queries across a distributed platform without having to restructure or move your data.
one complexity of microservices is the need to perform transactions across json objects (i.e. customer orders have to update customer spend, place the order, and reserve inventory). while spending time on application development for committing complex transactions is possible, it adds an entirely new set of programming challenges for a developer. memsql supports distributed transactions across the memsql nodes so the developer simply submits the required sql transaction and memsql handles the rest.
memsql supports flexible service definitions by using a json model. developers can add data attributes without impacting memsql database queries or requiring etl modifications. additionally, memsql supports the streaming of json data directly into tables without having to build out a table schema. streaming of json data allows developers to take advantage of event-driven models as well as immediately consistent transactional models.
the ability to deliver real-time analytics within a microservices architecture is uniquely enabled by memsql. combining memsql into your microservices architecture supports the goals of independent scaling and flexible development while also reducing the challenges of microservices architectures.
memsql helps eliminate the struggles with microservices. memsql includes a distributed transaction capability so developers are not burdened with distributed transaction complexity. using memsql means there is no need to settle for eventual consistency as memsql provides immediate consistency within its read commit model.
Published at DZone with permission of Dale Deloy, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.