Can gatling load test SQL database or MongoDB? - scala

I need to make load testing on my persistent storages Postgres and MongoDB.
I'm wondering if it is possible to do with gatling? Because as I see gating supports only http and jms out of the box.

Unfortunately no, it was under discussion some time ago, however the functionality didn't appear to have high enough demand from the community hence it was discarded.
You can use Apache JMeter for database testing, it comes with MongoDB Script sampler for Mongo and JDBC Request sampler for any other databases which support JDBC protocol.
New JMeter tests and existing Gatling tests can be combined into a single test harness via i.e. Taurus tool which supports JMeter, Gatling and few more underlying load testing tools.

Related

Spring Cloud Integration test, embedded kafka vs testcontainers

I have a Spring cloud stream application which I need to make an integration test for (to be specific using cucumber). The application communicate with other services using Kafka message broker. From what I know I could make this work using either a kafka testcontainers or using spring provided embedded kafka. But what I don't know is which one would be the best solution so are there anything that the testcontainer could do but embedded can't or the other way around? (use cases or example would be appreciate!)
p.s This integration should be able to run on ci/cd pipeline.
It is called embedded for a reason. It really can be only accessed from the process which spawned it. With Testcontainers you really can reuse existing container and have access to it from the other process. But that's probably to exotic.
I guess with properly configured Testcontainers you can reach as much as possible similarities with the prod you'd deploy your solution. The embedded Kafka might be limited in some areas, e.g. SSL configuration or so.

How Can I do performance testing using Rest Assured

I am using rest assured to automate my project. In the same project, I want to do performance testing in the API. I want to know how can I achieve this task??
If you have existing set of tests and want to run them in multithreaded manner the options are in:
use ExecutorService to run them in parallel
"wrap" them into functions with JMH annotations
use a load testing tool capable of running JUnit tests (or whatever is your xUnit framework) like JUnit Sampler of Apache JMeter
However the above approaches will only allow you to kick off your tests in parallel and you won't be able to collect a lot of metrics like:
number of active threads
number of hits per seconds
response time
HTTP-protocol-based metrics like response code, connect time, latency
so it makes sense considering converting your restassured tests into "real" tests driven by the "normal" load testing tool, the majority of load testing tools provide record-and-replay capability by exposing a HTTP Proxy so if you run your restassured tests via this proxy the load testing tool will capture them and convert them into corresponding HTTP requests.

Spring boot Kogito Mongodb integration

I'm working on creating a kogito bpm spring boot project. I'm very happy to see reduced level of complexity on integration on jbpm in spring boot with the help of KOGITO. I'm struggling to find answers for my question, so posting them here,
Kogito is a open source cloud offering for jbpm. I'm I correct?
I see only mongodb or infinispan can only be used or supported with Kogito. I can't integrate psql with kogito. I'm I correct?
I successfully created the spring boot kogito mongodb project and when I placed a .bpmn file in the resource folder, automatically endpoints got created. I was able to access, run the process and get response. But I don't see any entries created in MONGODB :| I don't even see the table being created. The .bpmn contains a simple hello world flow with start+scripttask+end nodes. Please explain help me understand this. Is the RuntimeMangar configured for per request stratergy? How can I change it?
Answers inline.
Kogito is a open source cloud offering for jbpm. I'm I correct?
Kogito is open-source and has jBPM integrated into its codebase to run on a cloud-native environment. In addition, a lot has been made to make it also run with native compilation if used with Quarkus.
I see only mongodb or infinispan can only be used or supported with Kogito. I can't integrate psql with kogito. I'm I correct?
To this date, Kogito has the following add-ons to support persistence:
Infinispan
Postgres
MongoDB
JDBC (so you can extend to support any database you wish)
See more about it here https://docs.jboss.org/kogito/release/latest/html_single/#con-persistence_kogito-developing-process-services.
But I don't see any entries created in MONGODB
Do you mind sharing a reproducer? Have you taken a look at the examples in https://github.com/kiegroup/kogito-examples/tree/stable/process-mongodb-persistence-springboot? This example shows a call to a sub-process that relies on a user task. Hence the process must be persisted to fire up again on a new request to solve the task. However, since your process starts and ends in one request, there's nothing to be persisted in the DB:
Runtime persistence is intended primarily for storing data that is required to resume workflow execution for a particular process instance. Persistence applies to both public and private processes that are not yet complete. Once a process completes, persistence is no longer applied. This persistence behavior means that only the information that is required to resume execution is persisted.

Elastic search to be deployed as embedded or client/server mode

Which is the preferred mode of deployment for Elasticsearch, embedded mode (embedded in to the product/application) or client/server mode?
Apache Solr and most of the SQL, NOSQL databases are usually deployed in client/server mode. Where server runs as standalone, the client might be a driver library which will be used in the application.
In case of Elasticsearch, client and server binaries are the same. It would be difficult to package two separate Elasticsearch binaries, one for client to use in the application and another for the standalone server. I am planning to go with Rest API because I cannot package two set of Elasticsearch binaries in my product.
What is the general practice for Elasticsearch deployment? Keep Elasticsearch as standalone and use Rest API or embedded Elasticsearch within the application?
For production usage it is better to decouple your application from elasticsearch srever.
Lets say you want to upgrade to elastic 2.X that mean that you will need to re-compile your application - wouldnt it be overhead?
If you to run unit/data integration test you can use elasticsearch as embedded service to your testing needs

Using oreintdb in production with jdbc

I am planning to use orientdb in production using the jdbc drive so i need confirm some points
is jdbc driver can give all the orientdb Features like (transaction and links ...etc) or using the the java api is the best choice
I noticed that you have spring data implementation in the orientdb github is it ready to use in the production
At this link a discussion on the issue that you wrote.
in general, JDBC driver supports only a subset of OrientDB, only the part you can use with commands.
If you're a Java developer, I suggest you to use the Java Graph API: http://orientdb.com/docs/last/Graph-Database-Tinkerpop.html