Giter Site home page Giter Site logo

bookstore-demo-performance's People

Contributors

fh-ms avatar fullben avatar hg-ms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bookstore-demo-performance's Issues

Error with MariaDB

I'd like to run this against a MariaDB server, but failed.

I started a MariaDB server locally and created the bookstoredemo schema:

CREATE SCHEMA bookstoredemo;

I changed from the PostgreSQL to the MariaDB JDBC driver in the pom.xml file:

<dependency>
    <groupId>org.mariadb.jdbc</groupId>
    <artifactId>mariadb-java-client</artifactId>
    <scope>runtime</scope>
</dependency>

And modified the connection properties in the application.properties file accordingly:

# commented out these are they are not needed:
#spring.datasource.driverClassName = org.postgresql.Driver
#spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect

# modified these to point to MariaDB:
spring.datasource.url = jdbc:mariadb://localhost:3306/bookstoredemo
spring.datasource.username = user
spring.datasource.password = Password123!

The database connection works. However, when I run the app, I get a BadSqlGrammarException. Here are the relevant parts from the log:

2023-11-10 21:17:54.847  INFO 89070 --- [           main] o.m.demo.bookstore.Initializer           : JPA database is empty, migrating data from MicroStream, strategy = batch_insert
2023-11-10 21:17:54.847  INFO 89070 --- [           main] o.m.d.b.jpa.DataMigrator$BatchInsert     : > addresses
2023-11-10 21:17:54.866  INFO 89070 --- [           main] o.m.d.b.jpa.dal.CountryRepositoryImpl    : Executing 3 inserts...
2023-11-10 21:17:54.868  WARN 89070 --- [           main] o.m.jdbc.message.server.ErrorPacket      : Error: 1064-42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)...' at line 1
2023-11-10 21:17:54.892  WARN 89070 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initializer': Invocation of init method failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[3,'United States','US']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[1,'Canada','CA']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[2,'Germany','DE']};]; nested exception is java.sql.SQLSyntaxErrorException: (conn=337) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)...' at line 1

...

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initializer': Invocation of init method failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[3,'United States','US']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[1,'Canada','CA']};
ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)', parameters:[2,'Germany','DE']};]; nested exception is java.sql.SQLSyntaxErrorException: (conn=337) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ClientPreparedStatement{sql:'INSERT INTO COUNTRY (ID,NAME,CODE) VALUES(?,?,?)...' at line 1
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:440) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1796) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.25.jar:5.3.25]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.25.jar:5.3.25]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.25.jar:5.3.25]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.8.jar:2.7.8]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.8.jar:2.7.8]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.8.jar:2.7.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.8.jar:2.7.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.8.jar:2.7.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.8.jar:2.7.8]
        at one.microstream.demo.bookstore.Application.main(Application.java:20) ~[classes/:na]

why microstream write performance is so bad? write cost is about 100ms+--400ms+ when adding a very small object

I just fork the bookstore-demo and add an api to add boot(call the microstream store), I only add the log but find that it is very slow when adding one boot. you can my project https://github.com/yqbjtu/bookstore-demo/tree/feat/write_perf_log, use the feat/write_perf_log branch, https://github.com/yqbjtu/bookstore-demo/blob/feat/write_perf_log/perf-log/perf-log.md
I used the ssd and my machine has 32G main memory, Java jdk-17.0.4
@fh-ms @hg-ms @fullben

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.