New around here? Register your SA Forums Account here!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

CPColin posted:

Cognos Analytics by IBM has a CMOBJECT table that hold reports and like sixty CMOBJPROPS# tables that hold various properties. Each table has a different set of columns. No table is named something useful. I had to select a list of all the column names in the database to discover that the "Hidden" flag is in CMOBJPROPS55. No idea why they didn't make a single table and use it as a key->value store.

very early in my career i helped support some add-on apps to an ancient ERP system called BPCS. because it was originally an as/400 system the table and column names were all something like 6 characters or fewer and completely inscrutable, so you spent basically all day looking poo poo up in the data dictionary so you could figure out what poo poo like

SELECT INFDT, SLG12 FROM DEFB1 WHERE LOGTR4 = @var

meant and it scared me away from ERP systems forever

Adbot
ADBOT LOVES YOU

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
excel has a query engine that’s a separate addon and it’s called power query

my manager loves it, it works with way more than just sql server, and I’ve deliberately avoided learning anything else about it

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Powerful Two-Hander posted:

yeah this'll probably gently caress up at some point.

don't sign my pull requests

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

AWWNAW posted:

drat. I’m talking to a Scala company soon and all I keep hearing is bad things :mrwhite:

AWWNAW posted:

I heard bad things about ruby and found out they were all true

friend of mine is a ruby coder who took a scala job because it was an extra $30/hr and he won't stop talking about how much he misses ruby now

good luck :unsmigghh:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Xarn posted:

This. Knowing the fact that something called "template method pattern" exists is not nearly as helpful in learning to use it as seeing a real-world problem being solved by it.

true but knowing patterns exist even if you don’t know them inside and out does have value

I’ve never written my own pool in prod code but knowing the object pool pattern exists will keep me from doing a lovely version of my own from scratch if it does come up, for example

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
op, a lot of patterns are actually simple and intuitive and you may have used them without realizing even in non-OO code

reading the descriptions on wikipedia even might help you connect those dots

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i mean unless you're doing hobby projects in PL/SQL in which case

what the gently caress

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\
r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)
?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t]
)*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)
*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+
|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r
\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t
]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031
]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?
:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?
:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?
:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"
(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t]
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?
:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[
\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-
\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(
?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\"
.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\
]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\
[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\
r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]
|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0
00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\
.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[
^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]
]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(
?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(
?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t
])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t
])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?
:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:
[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)
?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["
()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)
?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>
@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
\t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,
;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?
(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:
\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
"()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])
*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\
.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(
?:\r\n)?[ \t])*))*)?;\s*)

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
lol forgot to wrap it in a code block but that's ok the :( make it perfect

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i wish ms sql server had native regex support

there i said it

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

it does cause you can call clr procs

that doesn't count and you know it

not everyone likes me enabling that poo poo and installing sql#, i'd like to have decent string handling out of the box thanks

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Powerful Two-Hander posted:


*this is my favourite: performed every single logical test by returning a magic string from the db and checking its value, not even just "true" or whatever but poo poo like if(caniDoIt = "yes you can go ahead")
lmao

did you outsource to galaxybrain consulting llc??

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

floatman posted:

There was recently a jobs queue system implemented in SQL.
Jobs went in a table, then something picked jobs out. Jobs were then done.
Because there was multiple users who could queue jobs, a random picking algorithm was required so that the job system doesn't get stuck doing all the jobs for user A before user B (gotta be fair).
BUT then there was the concept that some jobs were of higher priority than other jobs, so there must be a random picking of jobs, but "randomly" pick the higher priority jobs first. And it was decided that random was not fair enough, so we must pick user jobs by round robin (i.e. high priority job for user A, high priority job for userB, normal job for user A, etc).

So how did this pan out? Some loving poo poo giant rear end SQL statement embedded in the codebase that used recursive CTEs. Since jobs were either waiting status or completed status, whenever a job was picked, the job record needed a lock to lock the job so if the SQL did run again while this job was running it wouldn't pick up the same job. This lock also touched the other tables that were involved in the job (I E. Updating of user details, etc you can imagine the loving shitshow). The recursive CTE query also had this group/order by statement that did JACK poo poo and was not needed but formed 90% of the query plan. Database just loving mysteriously died one-day once the amount of data that needed to be scanned through surpassed the query planned limits and the SQL server just loving gave up and decided to chug along row by row.
And here's the kicker:
The codebase called that SQL query to pick up a "semi-random" job if it wanted to get the next job to process. But if the codebase KNEW the primary key of the job it wanted to process and needed to get that job, it would still call this idiot hellfucker SQL query but with the primary key specified so even though you're getting just that one record you could have gotten with a straight up select you're still going to pay the costs of the recursive CTE and the 90% group/order by statement.

All these loving problems could have been avoided if we just did a naive random select from a queue of jobs. "But what about higher priority jobs," You may ask.
Welp, JUST USE TWO SEPARATE QUEUES and empty the priority one first duhhhhhhhhhhhhhh

lol

please tell me this was in sql server or oracle where there are proper queues built into the loving database engine that are miles better than trying to write your own from scratch :allears:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
wait

"Since jobs were either waiting status or completed status, whenever a job was picked, the job record needed a lock to lock the job so if the SQL did run again while this job was running it wouldn't pick up the same job."

they left the jobs in the "queue" ?!?!?!

:cripes:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i seriously don't understand why you wouldn't just use a service broker queue if you're using mssql

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

at some point im gonna use service broker to do pub sub instead of polling, but i'll still have the same table structure for reporting and app needs. service broker would basically be running the same query to get the list if items to queue tho.

i was more responding to the op, but in your case why not just push messages to your queue when you update the operational table instead of updating an operational table to query later to queue messages? seems like an extra pointless step to me.

if the problem is they can't be processed until a later time, use a conversation timer.

if you're dealing with multiple dependencies then check and only queue the message when all dependencies are satisfied.

if the messages need to be "cancellable" things get hairy but you can still update the operational table to say "don't process that message we nulled the process timestamp" and then double check when processing that message you queued up for 1 am, and since you're always looking poo poo up via the pk of the table the check is fast.

basically i don't see the point of turning operational tables into queues and i really have to stretch to come up with scenarios where it would be the only choice

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
all of that said, queues are way overused too. i mostly use them in async scenarios such as file drops and api requests coming in waves to smooth out processing. ideally your system can just make whatever api calls it needs to and everything just works, i.e. read this i guess: https://ferd.ca/queues-don-t-fix-overload.html

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shaggar posted:

its easier to just handle control and statusing in a table vs an opaque message queue and ive never seen a purpose built message queue that isn't fragile as hell and relies on the ability to dump everything in the queue and restart when things go wrong.

i have literally never had to do that but since i am updating an operational table with statuses when creating messages i could rebuild if i have to whether I use sql server broker queue or a custom queue table. we’ve had queues survive loss of power situations without losing any messages and just pick up where they left off when restored vOv

mixing state with event messages is not a good design no matter how you slice it, and if your queue doesn’t drain (as in op example I was ultimately addressing) you’re gonna eventually hit some hard limits

more discussion here if you really want to do your own queue table (in particular Remus rusani’s comments): https://dba.stackexchange.com/questions/20399/fifo-queue-table-for-multiple-workers-in-sql-server

re:rabbitmq, we looked at rabbitmq but my boss loves mssql and we wanted a solution where a dequeue operation would write to a table within a database txn so never lose a message to an error and always have something to go back and report on and reprocess

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Phobeste posted:

This all seems like a slightly roundabout and unnecessarily complex way of summoning tef

lol

before he arrives to school us all, i should reiterate that most of the time you think you need a queue, you don't, and it won't help you deal with a true overload scenario because you still have a choke point somewhere i.e. instead of being overwhelmed at your api maybe you'll be overwhelmed at your database

i pretty much only use them for pub/sub activation, smoothing out processing message volume peaks, and creating sinks that can hold messages when a target system goes down

e: i guess i could have just wrote "i use them as buffers" :shobon:

Cold on a Cob fucked around with this message at 16:20 on Dec 22, 2018

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
in addition to that mononcqc article i posted earlier, just read what tef has to say about decomposing a monolith, it's good stuff

https://programmingisterrible.com/post/162346490883/how-do-you-cut-a-monolith-in-half

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Blinkz0rz posted:

i used to be of the opinion that queues between services let you reasonably distribute work to n number of consumers of m types and decouple services but all you end up doing is adding an unbounded, ephemeral transport between services which means you have to continually monitor scaling and queue depth to identify bottlenecks and can't actually apply back-pressure from the consumer

contrast this with http/rpc/whatever calls to a load balancer with each services maintaining internal queues for re-work in case the downstream service applies back-pressure and imo it's pretty clear that all a queue does is provide non-durable storage outside of individual transaction handling at the operational expense of maintaining an opaque system that's really easy to tip over (i'm looking at you rabbitmq)

fwiw you can use database transactions with a sql server service broker queue i.e. receive and push to a table in a transaction (though you have to be careful to not throw exceptions because a poison message can turn off your queue)

they're pretty durable and not opaque, they use tables internally, you can query them without receiving, and you can set them to retain received messages as well if you need to i.e. debugging scenarios

they're are a lot of annoyances for using them too; they're not as turn-key as using something like rabbitmq nor as popular so documentation is scarce*, so you'll have to bootstrap a bunch of poo poo yourself if you use them

*if anyone reading this does decide to try service broker, Remus Rusanu is probably the best resource out there

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

floatman posted:

To put it this way I would have rather had a badly managed rabbitmq implementation to fix and debug rather than some idiot bespoke MSSQL server queue that one guy was so loving proud he did but didn't stay in the company long enough to see first hand the destruction it wrought

yeah if you were using rabbitmq at least then you can pay a consultant to fix your poo poo instead of, say, ripping it all out and starting from scratch

collect that salary but always be looking for something better :shobon:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
ctes are awesome and it makes me sad that people use them in obtuse and confusing ways because they can really clean up a code base if used correctly

i've only used them for recursion a few times, but they work really well non-recursively too and i pretty much always use them instead of sub-queries now because i can chain them together nicely:

with foo as ( /* query */ ),
bar1 as ( /* query using foo */ ),
bar2 as ( /* different query using foo or maybe bar1*/ )
select * from bar1 join bar2 on /* join etc */

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Corla Plankun posted:

i like ctes too but i learned a couple months ago that they're dumber than subselects because postgres doesnt use indexes in the same way or something when its a cte

i was actually talking from an mssqlserver perspective but good to know

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

toiletbrush posted:

yeah, people just want to contribute, or at least be seen to contribute, and sometimes the low hanging fruit is all they've got.

A previous architect made everyone on the team use StyleCop as it immediately killed this sort of bike-shedding outright. He also banned UI chat from demos for the same reason.

Dude was good.

agreed, coding styles are arbitrary so it's definitely in your best interest to define asap on any greenfield project and preferably just go with the community default

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
GET /somelist
200: ["foo", "bar", null]

GET /somelist/1
200: "foo"

GET /somelist/2
200: "bar"

GET /somelist/3
204

GET /somelist/4
404

:hehe:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i do that for querystring results because my front end coder says 204s break her binding or something vOv

i deliberately haven't investigated if this is true or if she just can't be bothered

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
as someone that hasn't touched front end since jquery was the new hotness*, i want to know: is modern front end architecture bikeshedding all the way down? be honest with me pls

*not counting some razor views here and there

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

akadajet posted:

now if we're talking about re-inventing the wheel, there is a TON of that going on in modern frontend dev

yeah this is probably more what i was thinking and idk why i mentally slotted it as "bikeshedding"

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice


looks fine to me vOv

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
unless you're working contract and being paid for every hour or you get time in lieu, don't work OT

and even then, reconsider

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Shinku ABOOKEN posted:

do buses or queues require the task runner to consume the published task? i want tasks to be available indefinitely but *access* to tasks to be exclusive to whichever runner acquired it (until the runner dies)


realistic example: i may have a task "download the frontpage and verify http 200 every hour" that should only be done by one runner. i don't want the runner to delete the task from the database, just acquire it. i also want the task to become available if the runner dies.

my gut is this is needs a scheduler like quartz/quartz.net or something similar

i wouldn't use a bus/queue/etc for this

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

congrats :)

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Jabor posted:

What the hell sort of "unit tests" are you writing that you need to have them interact with a database?

technically it's an integration test, but any non-trivial sql ought to be tested

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

abigserve posted:

I'm not sure I got back to this one but basically;

- I want to be able to test schema changes
- I want to make sure that said schema changes do not break my queries, for instance, conversion of column type int to bigint
- I call them unit tests because my application can interact with several types of databases (poorly!) so each one is tested as their own unit!

perhaps there is some way of doing all that w/o having an actual database but I can't think of one that wouldn't be more work than simply starting a database up

but this is for one of my hobby projects and not a huge enterprise application

those are integration tests. there's nothing wrong with integration tests and they often have more value than unit tests, especially with code that is difficult to unit test.

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
yeah tests are pretty great tbh

abigserve posted:

i'll start calling 'em that then!

cool beans

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
c# owns and i wish it was used more outside of line of biz coding because i really want to get out of line of biz coding

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
you know, if you want software that will save lives, make it evaluate a human driver's skill and safety

and if they are driving dangerously too often, revoke their ability to start their car :colbert:

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

DONT THREAD ON ME posted:

i'm going to implement sorting algorithms with sc2 units

nice

Adbot
ADBOT LOVES YOU

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

floatman posted:

My favourite trigger is one that triggers on update/create of rows for table A. What it does is it creates a new record in another table, which has two columns: classname and args. Args is a text data type but it stores XML.
So what happens is there is a Cron job that would poll that table, use the language equivalent of "eval" to create a new "classname", deserialise the XML "args" and feed it into the class, then execute the class to do stuff.
So when you look at the project there are all these little class files that can't be connected with "find usages"

yeah but you can deploy code changes so easily now

lmao

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply