Closed balhar-jakub closed 3 years ago
We ( @jandadav and @balhar-jakub ) would like to refine the following and then meet with external expert.
This will be something between a spike and a PoC in the end. A performance benchmark could be a part of this as well for our awarenes and to spot obvious problems soon.
ActiveMQ: Built for messaging, not specifically for caching/persistence. Architecture would be one service instance sends a persistent message to other service instances which then use that message to update their own local cache stores. Another option would be to use a message receiver that stores the data using JDBC, but this is SQL and is overhead when we could just simply communicate with a database directly.
Activemq can run on a wide variety of environments, including z/OS Can run embedded within Spring boot, however it may be best practices to not run embedded (research this further if activemq is chosen) Native Java client as well as REST API available Can configure to transport with ssl
Redis: Redis should be used on Linux systems, with no real support on other systems. Hostbridge offers redis on Z as a commercial option. Can easily configure maximum memory to use, and has reject, TTL, and best effort less recently used eviction. Redis Cluster and Redis Sentinel are options for high availability. Works in memory, with periodic disk dumps or a disk log for persistence. Key-value data model that can handle data structures Single-threaded, can scale horizontally via clustering spring-boot-starter-data-redis 3 clause BSD license Joe Winchester has worked with Hostbridge in the past, potentially go via him in figuring out if Zowe can use Redis Can run with TLS transport
memcached: Seems to have support on ibm z least recently used eviction Just works in server memory, no disk storage Memcached is optimized to use less memory for metadata. Only stores strings, so must serialize data structures Multi-threaded, can scale with more computer resources memcached-spring-boot-starter In general less features and less flexible than redis Revised BSD license Can transport with TLS
Hazelcast: Works in memory, can write to disk via a db but have to set up db and write code to export cache to db Seems very similar in design to memcached, but with more features and interfaces, like RESTful API, consistency configuration, partitioning, replication, etc. Apache license Open source version does not have secure transport, enterprise license does
MongoDB Most popular noSQL DB, "JSON like document storage" NoSchema so very flexible with data to be stored Built in replication/failover and horizontal scaling Only available on zLinux (plus distributed platforms) https://spring.io/projects/spring-data-mongodb Only Community edition is free to use (lacks encrypting stored data and connection to LDAP) Data stored to disk by default but can switch to "in-memory engine" General impression when comparing with Redis is that MongoDB is faster to learn but less flexible. (general stack overflow impression is that Redis is typically the more suitable solution unless rapid development is essential) SSPL license (Previously GPL) Can transport with TLS
Etcd Can't run on z/OS Can run embedded in spring Key-value store Can use TLS in transport Made to store k8s objects, not flexible data types Only stores data on disk, not in RAM, may not be performant
So basically we are looking at either:
Test repository: https://github.com/jandadav/hazelcast-cluster
To provide a POC for implementing caching service under Zowe/Api Mediation Layer
Brief summary of caching service requirements and how Hazelcast fits into each one
Can be embedded to springboot app, reducing number of processes to just the caching api.
Pure java impl, should run without problem. Not tested
Data not persisted, opensource does not provide mechanisms for persistent data.
Handlers can be made and hooked on internal evenr model, that can serialize the data on events (inserted, deleted, .....) and custom serialization logic can be implemented.
Hazelcast provides native integration with Eureka discovery. The integration works very well and is easy to configure.
Normally, Hazelcast uses multicast for discovery, which might be problematic for customers in production environment. Luckilly the discovery plugin can circumvent this problem. Other discovery plugins are provided for other discovery solutions as well.
Yes, but with caveat that secure transport is not available. Can be implemented but effort is significant.
Opensource solution does not offer TLS security on transport. Alternative solution usin AT-TLS or NGINX/TOMCAT as reverse proxy providing TLS should be possible (not tested)
Custom implementation could be made.
Customizing the nio networking: Effort is significant. Experimented with customization of Hazelcast instance and the mechanism is done in the repo.
Replacing the networking with blocking secure socket: Effort unknown
Profiling of memmory vs data should be done to understand capacity.
As above.
Multiple clients combine heap and extend capacity.
Very fast replication in cluster. Backups are kept so when instance goes down data does not get lost.
Nice integration wiht SpringBoot. Autoconfigure or custom creation can be done with beans. Very Spring like!
Apache License, Version 2.0
Available
While some aspects still remain to be tested, Hazelcast seems like solid option that fits on almost all requirements.
The only challenge is securing the transport. Some options are availabe and need to be evaluated.
Speaking of Redis: I ported Redis 5 (including Redis Cluster and Redis Sentinel) to z/os last year. Just let me know if you're interested in the port.
I don't have experience on Hazelcast and just learned from this thread so I would rather not comment on it. David's comments look great to me. Except for Mongodb, which I'm not sure, all other choices listed are cross platforms as far I learned. To compile etcd, we can expect a go compiler on Z really soon, so I also consider it as cross-platform solution.
For other options:
Overall there are 2 questions are most important to me:
Ideally, we can enable other developers to create plugins to extend persistent method, so people can create DB2 extension if they want. I understand this is out of the topic here, but could benefit us for long term.
Need to run a separate redis server process in addition to the caching service.
Will with Hostbridge support, a commercial option.
Periodic disk dumps or logging to persist data. Can (although unlikely) lose data between the dump intervals, as a trade-off for the better performance. Ideal for non-critical data.
Redis cluster: each node auto-discovery other nodes Redis Sentinel: use sentinel nodes to discovery other nodes
Seems to be highly performant, more-so than memcached. May not scale as well as Hazelcast.
Will need to profile. Can optimize key length to make more use of memory. Can partition data to increase available memory, at the cost of multi-key transactions.
Fast replication via Redis Cluster or Redis Sentinel. Uses leader-follower architecture with exact copies of the leader.
Nice integration with Spring Boot. Typical Spring bean configuration.
BSD license
Available via Hostbridge on z/OS, or Redis Enterprise.
Redis is very popular and should be easy to spin up as a PoC. May not be able to scale as well as we want, and inability to run on z/OS without a commercial license may be a problem. Data durability is also a concern, although 100% durability may not be a true requirement.
Separate process to run a memcached server.
Docker images exist for IBM Z, but then obviously this requires docker.
Works in memory, no real data persistence. Can configure to re-start without losing data, but this isn't "real" persistence.
Yes
TLS support.
Seems to be beat by redis and Hazelcast, but would need to profile.
Will need to profile. Combines memory across web servers.
Does not support replication. Would have to manually replicate data.
Has spring boot integration. Bean configuration available.
BSD license
No, rely on opensource support.
Older technology that isn't easy to use. Limited features compared to other options, would require complex administration and/or custom extension.
Requires another process to run the etcd server.
No. However there may be a go compiler ready on Z soon, which would allow etcd to run on z/OS
Yes, writes to disk by default.
Has discovery client implementation in spring boot.
TLS in transport.
We can expect it to be performant, though will need to profile it. Some benchmarks show it being as performant as redis despite not working in memory.
To avoid performance degradation, capacity is limited by RAM, 8 GB typically enough.
Cluster for availability, after cluster consensus request is accepted and replicated across the cluster.
Spring boot integration.
Apache license 2.0
No, rely on open source support.
Ideal option for containerized environment, given its use in Kubernetes. Really good, robust features, and should be performant. Only problem is lack of z/OS options.
@lchudinov Yes please, is there a repository where we can take a look?
So far we are looking at the following decision
@jandadav I am waiting for approval to push the Redis port to the Github.
By the way, "SSL/TLS is supported by Redis starting with version 6": https://redis.io/topics/encryption. Redis 5, which we have, doesn't support TLS.
@jandadav Please checkout https://github.com/lchudinov/redis and run ./build-zos.sh
script. By default it builds 64-bit ASCII version. Let me know if you have any questions.
from @Ichudinov: By the way, Golang for z/os goes now with a doc named "porting guide", where they demonstrate how to port etcd so etcd now should work on z/os, though I haven't tried Leonty Chudinov go version go1.14.9 zos/s390x
The question about additional address spaces has been discussed on HA call, and it has not been identified as a showstopper to have more address spaces, even though not ideal.
Just based on the previous knowledge and comparison my personal preferences are: 1) Hazelcast - AT-TLS on platform and Reverse proxy setup off-platform 2) Redis - Off-platform works well for on platform support may be needed 3) ETCD - More or less same as Redis, but in Redis case we may get additional support outside of Zowe
@jandadav Could you please add a Row uses ZIIP to your table? It seems that only Hazelcast does from the Hazelcast, Redis and ETCD
Quick update from the discussion with Redis yesterday. Redis indicated an interest to participate in Zowe. As such, they have a working port for z/os which they will share with us in the coming weeks once ready. Support details for this port are yet to be finalized.
Once we have the port for z/os we will proceed with a PoC. In the meantime, we may look closer at the Redis off-platform solution.
@jalel01 Can we close this issue now as the decision has been made? And that is to do the PoC using Redis.
Is your feature request related to a problem? Please describe. The dockerized deployment of the Zowe needs to have a Caching service supporting the run off-platform.
Describe the solution you'd like Understand the options we have and figure out which one to use and have a small POC with it to verify our expectations
Consider ActiveMQ, ETCD, MongoDB, Redis, Memcached, Hazelcast, ehcache, etc.
Some requirements to consider:
Describe alternatives you've considered