This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-08-13
Channels
- # aleph (6)
- # architecture (29)
- # beginners (175)
- # cider (22)
- # clara (5)
- # cljdoc (5)
- # cljs-dev (28)
- # cljsrn (6)
- # clojure (62)
- # clojure-finland (7)
- # clojure-italy (7)
- # clojure-nl (2)
- # clojure-spec (23)
- # clojure-uk (194)
- # clojurescript (90)
- # core-async (2)
- # cursive (23)
- # datomic (41)
- # defnpodcast (2)
- # editors (4)
- # emacs (1)
- # figwheel-main (41)
- # fulcro (53)
- # hoplon (15)
- # hyperfiddle (4)
- # immutant (1)
- # jobs (7)
- # jobs-discuss (103)
- # lein-figwheel (9)
- # off-topic (34)
- # onyx (3)
- # parinfer (1)
- # portkey (1)
- # re-frame (7)
- # reagent (2)
- # remote-jobs (2)
- # rum (1)
- # shadow-cljs (148)
- # sql (54)
- # tools-deps (3)
- # vim (7)
This might belong in #beginners but... What's the idiomatic way to copy over a table (for backup) from one database to another with constant memory usage (table fits neither in memory nor on disk)?
Maybe this helps http://clojure-doc.org/articles/ecosystem/java_jdbc/using_sql.html#processing-a-result-set-lazily
But.. if you don’t need to do it programmatically, I’d do just something like
pg_dump my_first_db -t my_table | psql my_other_db
I got a beginner question, honestly, the jdbc (mysql), how does it work when you use query
?
open con > open stt > read > close stt > close con
???
Or it always maintain 1 connection open?
I’m really having problems with c3p0 or hikari because there’r TOO MUCH DBs to connect, pooling is not working since I cannot do 1 pool for all dbs
@hiredman its an ecommerce, so there’s more than 500 stores, and they are separated dbs
I know what you mean… c3p0 or hikari its really helpful, so mysql does not go crazy
YEah @jgh we are thinking about remove the MySQL, but till there… trying to use clojure to do some stuffs
i mean im not sure mysql is your problem. Is having one application connect to all of your servers directly really the best way to do it?
I have no idea what you're trying to do so it's hard for me to make suggestions, but I suspect that there's a better way to do whatever it is you're trying to do than have a single clojure app connect to hundreds of databases.
database is sort of an overloaded term, it can mean sort of a namespace within a database server, or it can mean a database server itself, from "500 stores" my guess is your project started as a single store, and to make it multi-tenant database (in the namespace of tables sense) was added for each tenant instead of making the schema multi tenant in a single database
@hiredman its a in-company project, it was like that when I got hired, not much to do, and yeah.. schemas, multi-schemas
I think if I was in that situation, I might start by creating a pool of connection pools
because, I dunno, it seems like it should be a valid thing to do, but I think in general it is done the otherway, so most off the shelf solutions are going to fight you
my guess would be you don't have enough connections (either allowed by the database, or made available by your connection pool)
And you have a different user/password for every one of the 500 DBs?
@seancorfield nope, just 1 user/pass
OK, and that user has permissions to read/write every DB schema?
If that's the case, I would use a single connection pool and use it everywhere for all of the DBs.
In other words, don't create a separate pool for each DB.
Yes, use the schema name in your queries.
I see… gonna try that out @seancorfield
That's much more scalable (given the constraints you're already running under).
And, yes, you can have a decent sized pool, since you'll only have one of them for the entire app.